From eedc2b098c0505b6192fb8e04085687dc113f998 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Fri, 18 Aug 2023 15:28:40 -0500 Subject: [PATCH 001/420] insert missing backticks --- website/docs/cdktf/csharp/r/registry_module.html.markdown | 2 +- website/docs/cdktf/go/r/registry_module.html.markdown | 2 +- website/docs/cdktf/java/r/registry_module.html.markdown | 2 +- website/docs/cdktf/python/r/registry_module.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_module.html.markdown | 2 +- website/docs/r/registry_module.html.markdown | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index ba6f09de0..aafb0dc5e 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -183,7 +183,7 @@ The `VcsRepo` block supports: string. * `Identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index d4862f846..33eb4eddf 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -206,7 +206,7 @@ The `VcsRepo` block supports: string. * `Identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 518780e3e..0de24fdb7 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -186,7 +186,7 @@ The `vcsRepo` block supports: string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index ae9892e84..fecb6accb 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -189,7 +189,7 @@ The `vcs_repo` block supports: string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 3773989f7..3ddc93c1e 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -212,7 +212,7 @@ The `vcsRepo` block supports: string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index f2d45a48b..32efa530f 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -132,7 +132,7 @@ The `vcs_repo` block supports: string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) - and repository in your VCS provider. The format for Azure DevOps is //\_git/. + and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. From 075da7090278a4016a324c8cf85dfb4fc038e7eb Mon Sep 17 00:00:00 2001 From: sebhcp Date: Fri, 18 Aug 2023 15:54:13 -0500 Subject: [PATCH 002/420] add azdevops exception note --- website/docs/cdktf/csharp/r/registry_module.html.markdown | 2 +- website/docs/cdktf/go/r/registry_module.html.markdown | 2 +- website/docs/cdktf/java/r/registry_module.html.markdown | 2 +- website/docs/cdktf/python/r/registry_module.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_module.html.markdown | 2 +- website/docs/r/registry_module.html.markdown | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index aafb0dc5e..1a680203d 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -179,7 +179,7 @@ The following arguments are supported: The `VcsRepo` block supports: * `DisplayIdentifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `Identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `Identifier` string. * `Identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index 33eb4eddf..f5f19f77e 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -202,7 +202,7 @@ The following arguments are supported: The `VcsRepo` block supports: * `DisplayIdentifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `Identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `Identifier` string. * `Identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 0de24fdb7..589e8abf6 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -182,7 +182,7 @@ The following arguments are supported: The `vcsRepo` block supports: * `displayIdentifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index fecb6accb..a55a54f39 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -185,7 +185,7 @@ The following arguments are supported: The `vcs_repo` block supports: * `display_identifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 3ddc93c1e..e4643583a 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -208,7 +208,7 @@ The following arguments are supported: The `vcsRepo` block supports: * `displayIdentifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index 32efa530f..2e46190e2 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -128,7 +128,7 @@ The following arguments are supported: The `vcs_repo` block supports: * `display_identifier` - (Required) The display identifier for your VCS repository. - For most VCS providers outside of BitBucket Cloud, this will match the `identifier` + For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) From 1fe1268138bd743215adda3b01fe674be58e04c8 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Mon, 21 Aug 2023 13:03:24 -0400 Subject: [PATCH 003/420] Rebased "azdevops_docs" onto a local branch From c819ce647c244642078bae0dc0b639abddd674a9 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Wed, 30 Aug 2023 16:06:03 -0700 Subject: [PATCH 004/420] support org-level default agent pool and execution mode --- tfe/resource_tfe_workspace.go | 179 ++++++++++++++++++++++++++++++++-- 1 file changed, 169 insertions(+), 10 deletions(-) diff --git a/tfe/resource_tfe_workspace.go b/tfe/resource_tfe_workspace.go index 0aea5e2ed..9d334124b 100644 --- a/tfe/resource_tfe_workspace.go +++ b/tfe/resource_tfe_workspace.go @@ -46,6 +46,10 @@ func resourceTFEWorkspace() *schema.Resource { return err } + if err := overwriteDefaultExecutionMode(c, d); err != nil { + return err + } + if err := validateAgentExecution(c, d); err != nil { return err } @@ -82,7 +86,8 @@ func resourceTFEWorkspace() *schema.Resource { "agent_pool_id": { Type: schema.TypeString, Optional: true, - Default: "", + Computed: true, + Default: nil, ConflictsWith: []string{"operations"}, }, @@ -113,6 +118,24 @@ func resourceTFEWorkspace() *schema.Resource { ), }, + "setting_overwrites": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "execution_mode": { + Type: schema.TypeBool, + Required: true, + }, + + "agent_pool": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, + "file_triggers_enabled": { Type: schema.TypeBool, Optional: true, @@ -316,10 +339,24 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), + AgentPool: tfe.Bool(true), + } } if v, ok := d.GetOk("execution_mode"); ok { - options.ExecutionMode = tfe.String(v.(string)) + executionMode := tfe.String(v.(string)) + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), + AgentPool: tfe.Bool(true), + } + options.ExecutionMode = executionMode + } else { + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(false), + AgentPool: tfe.Bool(false), + } } if v, ok := d.GetOkExists("operations"); ok { @@ -464,6 +501,18 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { d.Set("organization", workspace.Organization.Name) d.Set("resource_count", workspace.ResourceCount) + var settingOverwrites []interface{} + if workspace.SettingOverwrites != nil { + settingOverwrites = append(settingOverwrites, map[string]interface{}{ + "execution_mode": workspace.SettingOverwrites.ExecutionMode, + "agent_pool": workspace.SettingOverwrites.AgentPool, + }) + } + err = d.Set("setting_overwrites", settingOverwrites) + if err != nil { + return err + } + if workspace.Links["self-html"] != nil { baseAPI := config.Client.BaseURL() htmlURL := url.URL{ @@ -533,15 +582,18 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error config := meta.(ConfiguredClient) id := d.Id() + workspaceControlsAgentPool := isSettingOverwritten("agent_pool", d) + workspaceControlsExecutionMode := isSettingOverwritten("execution_mode", d) + if d.HasChange("name") || d.HasChange("auto_apply") || d.HasChange("queue_all_runs") || d.HasChange("terraform_version") || d.HasChange("working_directory") || d.HasChange("vcs_repo") || d.HasChange("file_triggers_enabled") || d.HasChange("trigger_prefixes") || d.HasChange("trigger_patterns") || d.HasChange("allow_destroy_plan") || d.HasChange("speculative_enabled") || - d.HasChange("operations") || d.HasChange("execution_mode") || - d.HasChange("description") || d.HasChange("agent_pool_id") || + d.HasChange("operations") || (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || + d.HasChange("description") || (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || d.HasChange("global_remote_state") || d.HasChange("structured_run_output_enabled") || - d.HasChange("assessments_enabled") || d.HasChange("project_id") { + d.HasChange("assessments_enabled") || d.HasChange("project_id") || d.HasChange("setting_overwrites") { // Create a new options struct. options := tfe.WorkspaceUpdateOptions{ Name: tfe.String(d.Get("name").(string)), @@ -568,15 +620,42 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("agent_pool_id") { + if d.HasChange("agent_pool_id") && workspaceControlsAgentPool { if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) + + if options.SettingOverwrites == nil { + // avoid overwriting setting-overwrites that may have been set previously + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} + } } } - if d.HasChange("execution_mode") { - if v, ok := d.GetOk("execution_mode"); ok { - options.ExecutionMode = tfe.String(v.(string)) + if (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || d.HasChange("setting_overwrites") { + executionMode := d.GetRawConfig().GetAttr("execution_mode") + + // if the TFE instance knows about setting setting-overwrites... + if _, ok := d.GetOk("setting_overwrites"); ok { + + if options.SettingOverwrites == nil { + // avoid overwriting setting-overwrites that may have been set previously + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} + } + + // if execution mode is current unset... + if executionMode.IsNull() { + // set execution mode to default (inherit from the parent organization/project) + options.SettingOverwrites.ExecutionMode = tfe.Bool(false) + } else { + options.ExecutionMode = tfe.String(executionMode.AsString()) + options.SettingOverwrites.ExecutionMode = tfe.Bool(true) + } + + } else { + // since the TFE instances doesn't know about setting-overwrites, set the execution mode as normal + if v, ok := d.GetOk("execution_mode"); ok { + options.ExecutionMode = tfe.String(v.(string)) + } } } @@ -843,6 +922,22 @@ func setExecutionModeDefault(_ context.Context, d *schema.ResourceDiff) error { executionMode, executionModeReadOk := configMap["execution_mode"] executionModeState := d.Get("execution_mode") if operationsReadOk && executionModeReadOk { + + // forcefully setting the execution mode default is only necessary when an existing workspace is being updated + isRecordPersisted := d.Id() != "" + if isRecordPersisted != true { + return nil + } + + // if current TFE version supports setting-overwrites... + if v, ok := d.GetOkExists("setting_overwrites"); ok { + settingOverwrites := v.([]interface{}) + if operations.IsNull() && executionMode.IsNull() && len(settingOverwrites) != 0 { + // ... don't set execution mode to remote + return nil + } + } + if operations.IsNull() && executionMode.IsNull() && executionModeState != "remote" { err := d.SetNew("execution_mode", "remote") if err != nil { @@ -854,12 +949,56 @@ func setExecutionModeDefault(_ context.Context, d *schema.ResourceDiff) error { return nil } +func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) error { + configMap := d.GetRawConfig().AsValueMap() + executionMode, executionModeReadOk := configMap["execution_mode"] + + // if the execution mode is currently overwritten, but being set to default in the current config, make sure that + // the setting overwrites will be set to false + if executionMode.IsNull() { + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{})[0].(map[string]interface{}) + if settingOverwrites["execution_mode"] == true { + newSettingOverwrites := map[string]interface{}{ + "execution_mode": false, + "agent_pool": false, + } + d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) + } + return nil + } + } + + if executionMode.IsNull() || !executionModeReadOk { + return nil + } + + // if the default execution mode and the execution_mode setting the user desires matches, nothing will happen + // unless we inform TFE that the new execution_mode is meant to overwrite the current execution mode + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{})[0].(map[string]interface{}) + if settingOverwrites["execution_mode"] == false { + agentPool, agentPoolReadOk := configMap["agent_pool"] + + newSettingOverwrites := map[string]interface{}{ + "execution_mode": true, + "agent_pool": agentPool.IsKnown() && agentPoolReadOk, + } + d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) + } + } + + return nil +} + // An agent pool can only be specified when execution_mode is set to "agent". You currently cannot specify a // schema validation based on a different argument's value, so we do so here at plan time instead. func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { if executionMode, ok := d.GetOk("execution_mode"); ok { executionModeIsAgent := executionMode.(string) == "agent" - if !executionModeIsAgent && d.Get("agent_pool_id") != "" { + configMap := d.GetRawConfig().AsValueMap() + agentPool, agentPoolReadOk := configMap["agent_pool_id"] + if !executionModeIsAgent && agentPoolReadOk && !agentPool.IsNull() { return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") } else if executionModeIsAgent && d.NewValueKnown("agent_pool_id") && d.Get("agent_pool_id") == "" { return fmt.Errorf("agent_pool_id must be provided when execution_mode is 'agent'") @@ -961,3 +1100,23 @@ func errWorkspaceResourceCountCheck(workspaceID string, resourceCount int) error } return nil } + +// isSettingOverwritten checks if the value of a setting is being overwritten by the workspace or not. in other words, +// if the value of the setting is determined by the workspace, this function will return true for that setting +func isSettingOverwritten(setting string, d *schema.ResourceData) bool { + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{}) + if len(settingOverwrites) != 1 { + // current TFE version does not support setting-overwrites, so all settings are set at workspace-level + return true + } + + // check the value of the setting + settingOverwritesValue := settingOverwrites[0].(map[string]interface{}) + executionModeOverwritten := settingOverwritesValue[setting] + + return executionModeOverwritten.(bool) + } + + return true +} From e09d1b9dc45dd97c6408d86222d07419d94125ed Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 5 Sep 2023 18:47:28 -0700 Subject: [PATCH 005/420] horrific first attempt at allowing users to set organization default execution modes in tf --- tfe/resource_tfe_organization.go | 29 +++++++++++ tfe/resource_tfe_organization_test.go | 72 +++++++++++++++++++++++++++ tfe/resource_tfe_workspace.go | 1 + tfe/resource_tfe_workspace_test.go | 57 +++++++++++++++++++++ tfe/testing.go | 47 +++++++++++++++++ 5 files changed, 206 insertions(+) diff --git a/tfe/resource_tfe_organization.go b/tfe/resource_tfe_organization.go index 50b81bc7b..b841862be 100644 --- a/tfe/resource_tfe_organization.go +++ b/tfe/resource_tfe_organization.go @@ -91,6 +91,17 @@ func resourceTFEOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "default_execution_mode": { + Type: schema.TypeString, + Optional: true, + Default: "remote", + }, + + "default_agent_pool_id": { + Type: schema.TypeString, + Optional: true, + }, }, } } @@ -141,6 +152,8 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) + d.Set("default_execution_mode", org.DefaultExecutionMode) + // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false d.Set("assessments_enforced", org.AssessmentsEnforced) @@ -150,6 +163,10 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("default_project_id", org.DefaultProject.ID) } + if org.DefaultAgentPool != nil { + d.Set("default_agent_pool_id", org.DefaultAgentPool.ID) + } + return nil } @@ -202,6 +219,18 @@ func resourceTFEOrganizationUpdate(d *schema.ResourceData, meta interface{}) err options.AllowForceDeleteWorkspaces = tfe.Bool(allowForceDeleteWorkspaces.(bool)) } + // If default_execution_mode is supplied, set it using the options struct. + if defaultExecutionMode, ok := d.GetOkExists("default_execution_mode"); ok { + options.DefaultExecutionMode = tfe.String(defaultExecutionMode.(string)) + } + + // If default_agent_pool_id is supplied, set it using the options struct. + if defaultAgentPoolId, ok := d.GetOkExists("default_agent_pool_id"); ok { + options.DefaultAgentPool = &tfe.AgentPool{ + ID: defaultAgentPoolId.(string), + } + } + log.Printf("[DEBUG] Update configuration of organization: %s", d.Id()) org, err := config.Client.Organizations.Update(ctx, d.Id(), options) if err != nil { diff --git a/tfe/resource_tfe_organization_test.go b/tfe/resource_tfe_organization_test.go index bd42fd3b8..ff548aee5 100644 --- a/tfe/resource_tfe_organization_test.go +++ b/tfe/resource_tfe_organization_test.go @@ -80,6 +80,8 @@ func TestAccTFEOrganization_full(t *testing.T) { "tfe_organization.foobar", "assessments_enforced", "false"), resource.TestCheckResourceAttr( "tfe_organization.foobar", "allow_force_delete_workspaces", "false"), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "default_execution_mode", "remote"), ), }, }, @@ -112,6 +114,52 @@ func TestAccTFEOrganization_defaultProject(t *testing.T) { }) } +func TestAccTFEOrganization_update_defaultExecutionMode(t *testing.T) { + org := &tfe.Organization{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganization_full(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "default_execution_mode", "remote"), + ), + }, + { + Config: testAccTFEOrganization_agent_execution_mode(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "default_execution_mode", "agent"), + resource.TestCheckResourceAttrWith("tfe_organization.foobar", "default_agent_pool_id", func(value string) error { + if value == "" { + return errors.New("default agent pool ID not exposed") + } + return nil + }), + ), + }, + { + Config: testAccTFEOrganization_full(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "default_execution_mode", "remote"), + ), + }, + }, + }) +} + func TestAccTFEOrganization_update_costEstimation(t *testing.T) { t.Skip("Skipping this test until the SDK can support importing resources before applying a configuration") @@ -418,9 +466,33 @@ resource "tfe_organization" "foobar" { cost_estimation_enabled = false assessments_enforced = false allow_force_delete_workspaces = false + default_execution_mode = "remote" }`, rInt) } +func testAccTFEOrganization_agent_execution_mode(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" + session_timeout_minutes = 30 + session_remember_minutes = 30 + collaborator_auth_policy = "password" + owners_team_saml_role_id = "owners" + cost_estimation_enabled = false + assessments_enforced = false + allow_force_delete_workspaces = false + default_execution_mode = "agent" + default_agent_pool_id = tfe_agent_pool.foobar.id +} + +resource "tfe_agent_pool" "foobar" { + name = "agent-pool-test" + organization = "tst-terraform-%d" +} +`, rInt, rInt) +} + func testAccTFEOrganization_update(orgName string, orgEmail string, costEstimationEnabled bool, assessmentsEnforced bool, allowForceDeleteWorkspaces bool) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { diff --git a/tfe/resource_tfe_workspace.go b/tfe/resource_tfe_workspace.go index 9d334124b..d664efcec 100644 --- a/tfe/resource_tfe_workspace.go +++ b/tfe/resource_tfe_workspace.go @@ -964,6 +964,7 @@ func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) er "agent_pool": false, } d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) + d.SetNewComputed("execution_mode") } return nil } diff --git a/tfe/resource_tfe_workspace_test.go b/tfe/resource_tfe_workspace_test.go index 7c6ef6713..3f7389842 100644 --- a/tfe/resource_tfe_workspace_test.go +++ b/tfe/resource_tfe_workspace_test.go @@ -1919,6 +1919,63 @@ func TestAccTFEWorkspace_unsetExecutionMode(t *testing.T) { }) } +func TestAccTFEWorkspace_unsetExecutionModeWithOrgLevelDefault(t *testing.T) { + skipIfEnterprise(t) + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, agentPool, orgCleanup := createBusinessOrganizationWithAgentDefaultExecutionMode(t, tfeClient) + t.Cleanup(orgCleanup) + + workspace := &tfe.Workspace{} + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_executionModeAgent(org.Name), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists( + "tfe_workspace.foobar", workspace, testAccProvider), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "operations", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "execution_mode", "agent"), + resource.TestCheckResourceAttrSet( + "tfe_workspace.foobar", "agent_pool_id"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "setting_overwrites.0.execution_mode", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "setting_overwrites.0.agent_pool", "true"), + ), + }, + { + Config: testAccTFEWorkspace_executionModeNull(org.Name), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists( + "tfe_workspace.foobar", workspace, testAccProvider), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "operations", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "execution_mode", "agent"), + // workspace should now be using the organization default agent pool + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "agent_pool_id", agentPool.ID), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "setting_overwrites.0.execution_mode", "false"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "setting_overwrites.0.agent_pool", "false"), + ), + }, + }, + }) +} + func TestAccTFEWorkspace_globalRemoteState(t *testing.T) { workspace := &tfe.Workspace{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() diff --git a/tfe/testing.go b/tfe/testing.go index 8c56a31ba..7794990ec 100644 --- a/tfe/testing.go +++ b/tfe/testing.go @@ -127,6 +127,35 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza return org, orgCleanup } +func createBusinessOrganizationWithAgentDefaultExecutionMode(t *testing.T, tfeClient *tfe.Client) (*tfe.Organization, *tfe.AgentPool, func()) { + org, orgCleanup := createBusinessOrganization(t, tfeClient) + + agentPool, agentPoolCleanup := createAgentPool(t, tfeClient, org) + + // update organization to use default execution mode of "agent" + org, err := tfeClient.Organizations.Update(context.Background(), org.Name, tfe.OrganizationUpdateOptions{ + DefaultExecutionMode: tfe.String("agent"), + DefaultAgentPool: agentPool, + }) + if err != nil { + t.Fatal(err) + } + + return org, agentPool, func() { + org, err = tfeClient.Organizations.Update(context.Background(), org.Name, tfe.OrganizationUpdateOptions{ + DefaultExecutionMode: tfe.String("remote"), + DefaultAgentPool: nil, + }) + if err != nil { + err = fmt.Errorf("failure occured while trying to unlink organization from agent pool: %w", err) + t.Fatal(err) + } + + agentPoolCleanup() + orgCleanup() + } +} + func createOrganization(t *testing.T, client *tfe.Client, options tfe.OrganizationCreateOptions) (*tfe.Organization, func()) { ctx := context.Background() org, err := client.Organizations.Create(ctx, options) @@ -143,6 +172,24 @@ func createOrganization(t *testing.T, client *tfe.Client, options tfe.Organizati } } +func createAgentPool(t *testing.T, client *tfe.Client, org *tfe.Organization) (*tfe.AgentPool, func()) { + ctx := context.Background() + pool, err := client.AgentPools.Create(ctx, org.Name, tfe.AgentPoolCreateOptions{ + Name: tfe.String(randomString(t)), + }) + if err != nil { + t.Fatal(err) + } + + return pool, func() { + if err := client.AgentPools.Delete(ctx, pool.ID); err != nil { + t.Logf("Error destroying agent pool! WARNING: Dangling resources "+ + "may exist! The full error is shown below.\n\n"+ + "Agent pool ID: %s\nError: %s", pool.ID, err) + } + } +} + func createOrganizationMembership(t *testing.T, client *tfe.Client, orgName string, options tfe.OrganizationMembershipCreateOptions) *tfe.OrganizationMembership { ctx := context.Background() orgMembership, err := client.OrganizationMemberships.Create(ctx, orgName, options) From 1e3c62c34cb246a4bf0aeb2d542fca570c439e92 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Wed, 6 Sep 2023 18:11:09 -0700 Subject: [PATCH 006/420] use seperate model to support default execution mode to avoid circular depedency between agent pool and organization --- tfe/provider.go | 75 +++---- tfe/resource_tfe_organization.go | 28 --- ...tfe_organization_default_execution_mode.go | 161 ++++++++++++++ ...rganization_default_execution_mode_test.go | 209 ++++++++++++++++++ tfe/resource_tfe_organization_test.go | 70 ------ 5 files changed, 408 insertions(+), 135 deletions(-) create mode 100644 tfe/resource_tfe_organization_default_execution_mode.go create mode 100644 tfe/resource_tfe_organization_default_execution_mode_test.go diff --git a/tfe/provider.go b/tfe/provider.go index 40475c910..abaee9d28 100644 --- a/tfe/provider.go +++ b/tfe/provider.go @@ -135,43 +135,44 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), - "tfe_agent_pool": resourceTFEAgentPool(), - "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), - "tfe_agent_token": resourceTFEAgentToken(), - "tfe_notification_configuration": resourceTFENotificationConfiguration(), - "tfe_oauth_client": resourceTFEOAuthClient(), - "tfe_organization": resourceTFEOrganization(), - "tfe_organization_membership": resourceTFEOrganizationMembership(), - "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), - "tfe_organization_run_task": resourceTFEOrganizationRunTask(), - "tfe_organization_token": resourceTFEOrganizationToken(), - "tfe_policy": resourceTFEPolicy(), - "tfe_policy_set": resourceTFEPolicySet(), - "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), - "tfe_project": resourceTFEProject(), - "tfe_project_policy_set": resourceTFEProjectPolicySet(), - "tfe_project_variable_set": resourceTFEProjectVariableSet(), - "tfe_registry_module": resourceTFERegistryModule(), - "tfe_no_code_module": resourceTFENoCodeModule(), - "tfe_run_trigger": resourceTFERunTrigger(), - "tfe_sentinel_policy": resourceTFESentinelPolicy(), - "tfe_ssh_key": resourceTFESSHKey(), - "tfe_team": resourceTFETeam(), - "tfe_team_access": resourceTFETeamAccess(), - "tfe_team_organization_member": resourceTFETeamOrganizationMember(), - "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), - "tfe_team_project_access": resourceTFETeamProjectAccess(), - "tfe_team_member": resourceTFETeamMember(), - "tfe_team_members": resourceTFETeamMembers(), - "tfe_team_token": resourceTFETeamToken(), - "tfe_terraform_version": resourceTFETerraformVersion(), - "tfe_workspace": resourceTFEWorkspace(), - "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), - "tfe_variable_set": resourceTFEVariableSet(), - "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), - "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), - "tfe_workspace_run": resourceTFEWorkspaceRun(), + "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), + "tfe_agent_pool": resourceTFEAgentPool(), + "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), + "tfe_agent_token": resourceTFEAgentToken(), + "tfe_notification_configuration": resourceTFENotificationConfiguration(), + "tfe_oauth_client": resourceTFEOAuthClient(), + "tfe_organization": resourceTFEOrganization(), + "tfe_organization_default_execution_mode": resourceTFEOrganizationDefaultExecutionMode(), + "tfe_organization_membership": resourceTFEOrganizationMembership(), + "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), + "tfe_organization_run_task": resourceTFEOrganizationRunTask(), + "tfe_organization_token": resourceTFEOrganizationToken(), + "tfe_policy": resourceTFEPolicy(), + "tfe_policy_set": resourceTFEPolicySet(), + "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), + "tfe_project": resourceTFEProject(), + "tfe_project_policy_set": resourceTFEProjectPolicySet(), + "tfe_project_variable_set": resourceTFEProjectVariableSet(), + "tfe_registry_module": resourceTFERegistryModule(), + "tfe_no_code_module": resourceTFENoCodeModule(), + "tfe_run_trigger": resourceTFERunTrigger(), + "tfe_sentinel_policy": resourceTFESentinelPolicy(), + "tfe_ssh_key": resourceTFESSHKey(), + "tfe_team": resourceTFETeam(), + "tfe_team_access": resourceTFETeamAccess(), + "tfe_team_organization_member": resourceTFETeamOrganizationMember(), + "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), + "tfe_team_project_access": resourceTFETeamProjectAccess(), + "tfe_team_member": resourceTFETeamMember(), + "tfe_team_members": resourceTFETeamMembers(), + "tfe_team_token": resourceTFETeamToken(), + "tfe_terraform_version": resourceTFETerraformVersion(), + "tfe_workspace": resourceTFEWorkspace(), + "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), + "tfe_variable_set": resourceTFEVariableSet(), + "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), + "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), + "tfe_workspace_run": resourceTFEWorkspaceRun(), }, ConfigureContextFunc: configure(), } diff --git a/tfe/resource_tfe_organization.go b/tfe/resource_tfe_organization.go index b841862be..ac752761b 100644 --- a/tfe/resource_tfe_organization.go +++ b/tfe/resource_tfe_organization.go @@ -91,17 +91,6 @@ func resourceTFEOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, - - "default_execution_mode": { - Type: schema.TypeString, - Optional: true, - Default: "remote", - }, - - "default_agent_pool_id": { - Type: schema.TypeString, - Optional: true, - }, }, } } @@ -152,7 +141,6 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) - d.Set("default_execution_mode", org.DefaultExecutionMode) // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false @@ -163,10 +151,6 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("default_project_id", org.DefaultProject.ID) } - if org.DefaultAgentPool != nil { - d.Set("default_agent_pool_id", org.DefaultAgentPool.ID) - } - return nil } @@ -219,18 +203,6 @@ func resourceTFEOrganizationUpdate(d *schema.ResourceData, meta interface{}) err options.AllowForceDeleteWorkspaces = tfe.Bool(allowForceDeleteWorkspaces.(bool)) } - // If default_execution_mode is supplied, set it using the options struct. - if defaultExecutionMode, ok := d.GetOkExists("default_execution_mode"); ok { - options.DefaultExecutionMode = tfe.String(defaultExecutionMode.(string)) - } - - // If default_agent_pool_id is supplied, set it using the options struct. - if defaultAgentPoolId, ok := d.GetOkExists("default_agent_pool_id"); ok { - options.DefaultAgentPool = &tfe.AgentPool{ - ID: defaultAgentPoolId.(string), - } - } - log.Printf("[DEBUG] Update configuration of organization: %s", d.Id()) org, err := config.Client.Organizations.Update(ctx, d.Id(), options) if err != nil { diff --git a/tfe/resource_tfe_organization_default_execution_mode.go b/tfe/resource_tfe_organization_default_execution_mode.go new file mode 100644 index 000000000..cb3d7adef --- /dev/null +++ b/tfe/resource_tfe_organization_default_execution_mode.go @@ -0,0 +1,161 @@ +package tfe + +import ( + "context" + "fmt" + tfe "github.com/hashicorp/go-tfe" + "log" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { + return &schema.Resource{ + Create: resourceTFEOrganizationDefaultExecutionModeCreate, + Read: resourceTFEOrganizationDefaultExecutionModeRead, + Delete: resourceTFEOrganizationDefaultExecutionModeDelete, + Importer: &schema.ResourceImporter{ + StateContext: resourceTFEOrganizationDefaultExecutionModeImporter, + }, + + Schema: map[string]*schema.Schema{ + "organization": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "default_execution_mode": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice( + []string{ + "agent", + "local", + "remote", + }, + false, + ), + ForceNew: true, + }, + + "default_agent_pool_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + }, + } +} + +func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + // Get the organization name. + organization, err := config.schemaOrDefaultOrganization(d) + if err != nil { + return err + } + + // If the "default_agent_pool_id" was provided, get the agent pool + var agentPool *tfe.AgentPool + if v, ok := d.GetOk("default_agent_pool_id"); ok && v.(string) != "" { + agentPool = &tfe.AgentPool{ + ID: v.(string), + } + } + + defaultExecutionMode := "" + if v, ok := d.GetOk("default_execution_mode"); ok { + defaultExecutionMode = v.(string) + } else { + return fmt.Errorf("default_execution_mode was missing from tfstate, please create an issue to report this error") + } + + // set organization default execution mode + _, err = config.Client.Organizations.Update(context.Background(), organization, tfe.OrganizationUpdateOptions{ + DefaultExecutionMode: tfe.String(defaultExecutionMode), + DefaultAgentPool: agentPool, + }) + if err != nil { + return err + } + + d.SetId(organization) + + return resourceTFEOrganizationDefaultExecutionModeRead(d, meta) +} + +func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Read the organization: %s", d.Id()) + organization, err := config.Client.Organizations.Read(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + log.Printf("[DEBUG] organization %s no longer exists", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("error reading organization %s: %w", d.Id(), err) + } + + defaultExecutionMode := "" + if v, ok := d.GetOk("default_execution_mode"); ok { + defaultExecutionMode = v.(string) + } else { + return fmt.Errorf("default_execution_mode was missing from tfstate, please create an issue to report this error") + } + if organization.DefaultExecutionMode != defaultExecutionMode { + // set id to empty string so that the provider knows it needs to set the default execution mode again + d.SetId("") + } + + return nil +} + +func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + // Get the organization name. + organization, err := config.schemaOrDefaultOrganization(d) + if err != nil { + return err + } + + log.Printf("[DEBUG] Reseting default execution mode of organization: %s", organization) + // reset organization default execution mode + _, err = config.Client.Organizations.Update(context.Background(), organization, tfe.OrganizationUpdateOptions{ + DefaultExecutionMode: tfe.String("remote"), + DefaultAgentPool: nil, + }) + if err != nil { + return err + } + + return nil +} + +func resourceTFEOrganizationDefaultExecutionModeImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Read the organization: %s", d.Id()) + organization, err := config.Client.Organizations.Read(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + log.Printf("[DEBUG] organization %s no longer exists", d.Id()) + d.SetId("") + } + return nil, fmt.Errorf("error reading organization %s: %w", d.Id(), err) + } + + // Set the organization field. + d.Set("organization", d.Id()) + d.Set("default_execution_mode", organization.DefaultExecutionMode) + if organization.DefaultAgentPool != nil { + d.Set("default_agent_pool_id", organization.DefaultAgentPool.ID) + } + + return []*schema.ResourceData{d}, nil +} diff --git a/tfe/resource_tfe_organization_default_execution_mode_test.go b/tfe/resource_tfe_organization_default_execution_mode_test.go new file mode 100644 index 000000000..ff4bd4a09 --- /dev/null +++ b/tfe/resource_tfe_organization_default_execution_mode_test.go @@ -0,0 +1,209 @@ +package tfe + +import ( + "fmt" + "math/rand" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "errors" +) + +func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) { + org := &tfe.Organization{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + ), + }, + }, + }) +} + +func TestAccTFEOrganizationDefaultExecutionMode_local(t *testing.T) { + org := &tfe.Organization{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"), + ), + }, + }, + }) +} + +func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) { + org := &tfe.Organization{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), + testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org), + ), + }, + }, + }) +} + +func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) { + org := &tfe.Organization{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + ), + }, + { + Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), + testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org), + ), + }, + { + Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"), + ), + }, + { + Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationExists( + "tfe_organization.foobar", org), + testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + ), + }, + }, + }) +} + +func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOrganizationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + }, + + { + ResourceName: "tfe_organization_default_execution_mode.foobar", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckTFEOrganizationDefaultExecutionMode(org *tfe.Organization, expectedExecutionMode string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if org.DefaultExecutionMode != expectedExecutionMode { + return fmt.Errorf("default Execution Mode did not match, expected: %s, but was: %s", expectedExecutionMode, org.DefaultExecutionMode) + } + + return nil + } +} + +func testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org *tfe.Organization) resource.TestCheckFunc { + return func(s *terraform.State) error { + if org.DefaultAgentPool == nil { + return errors.New("default agent pool was not set") + } + + return nil + } +} + +func testAccTFEOrganizationDefaultExecutionMode_remote(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_organization_default_execution_mode" "foobar" { + organization = tfe_organization.foobar.name + default_execution_mode = "remote" +}`, rInt) +} + +func testAccTFEOrganizationDefaultExecutionMode_local(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_organization_default_execution_mode" "foobar" { + organization = tfe_organization.foobar.name + default_execution_mode = "local" +}`, rInt) +} + +func testAccTFEOrganizationDefaultExecutionMode_agent(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_agent_pool" "foobar" { + name = "agent-pool-test" + organization = tfe_organization.foobar.name +} + +resource "tfe_organization_default_execution_mode" "foobar" { + organization = tfe_organization.foobar.name + default_execution_mode = "agent" + default_agent_pool_id = tfe_agent_pool.foobar.id +}`, rInt) +} diff --git a/tfe/resource_tfe_organization_test.go b/tfe/resource_tfe_organization_test.go index ff548aee5..e67158036 100644 --- a/tfe/resource_tfe_organization_test.go +++ b/tfe/resource_tfe_organization_test.go @@ -114,52 +114,6 @@ func TestAccTFEOrganization_defaultProject(t *testing.T) { }) } -func TestAccTFEOrganization_update_defaultExecutionMode(t *testing.T) { - org := &tfe.Organization{} - rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEOrganizationDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFEOrganization_full(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEOrganizationExists( - "tfe_organization.foobar", org), - resource.TestCheckResourceAttr( - "tfe_organization.foobar", "default_execution_mode", "remote"), - ), - }, - { - Config: testAccTFEOrganization_agent_execution_mode(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEOrganizationExists( - "tfe_organization.foobar", org), - resource.TestCheckResourceAttr( - "tfe_organization.foobar", "default_execution_mode", "agent"), - resource.TestCheckResourceAttrWith("tfe_organization.foobar", "default_agent_pool_id", func(value string) error { - if value == "" { - return errors.New("default agent pool ID not exposed") - } - return nil - }), - ), - }, - { - Config: testAccTFEOrganization_full(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEOrganizationExists( - "tfe_organization.foobar", org), - resource.TestCheckResourceAttr( - "tfe_organization.foobar", "default_execution_mode", "remote"), - ), - }, - }, - }) -} - func TestAccTFEOrganization_update_costEstimation(t *testing.T) { t.Skip("Skipping this test until the SDK can support importing resources before applying a configuration") @@ -466,33 +420,9 @@ resource "tfe_organization" "foobar" { cost_estimation_enabled = false assessments_enforced = false allow_force_delete_workspaces = false - default_execution_mode = "remote" }`, rInt) } -func testAccTFEOrganization_agent_execution_mode(rInt int) string { - return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" - session_timeout_minutes = 30 - session_remember_minutes = 30 - collaborator_auth_policy = "password" - owners_team_saml_role_id = "owners" - cost_estimation_enabled = false - assessments_enforced = false - allow_force_delete_workspaces = false - default_execution_mode = "agent" - default_agent_pool_id = tfe_agent_pool.foobar.id -} - -resource "tfe_agent_pool" "foobar" { - name = "agent-pool-test" - organization = "tst-terraform-%d" -} -`, rInt, rInt) -} - func testAccTFEOrganization_update(orgName string, orgEmail string, costEstimationEnabled bool, assessmentsEnforced bool, allowForceDeleteWorkspaces bool) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { From d11d3897e6609bce808eccefb3ee956ca365308e Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Sep 2023 00:14:30 +0000 Subject: [PATCH 007/420] cdktf: update d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown --- website/docs/cdktf/python/d/policy_set.html.markdown | 3 ++- website/docs/cdktf/typescript/d/policy_set.html.markdown | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 86723d1eb..1650cb017 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -50,6 +50,7 @@ The following arguments are supported: * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspace_ids` - IDs of the workspaces that use the policy set. +* `excluded_workspace_ids` - IDs of the workspaces that do not use the policy set. * `project_ids` - IDs of the projects that use the policy set. * `policy_ids` - IDs of the policies attached to the policy set. * `policies_path` - The sub-path within the attached VCS repository when using `vcs_repo`. @@ -66,4 +67,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 8a2e62ddc..4ed6c1d99 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -53,6 +53,7 @@ The following arguments are supported: * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspaceIds` - IDs of the workspaces that use the policy set. +* `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `projectIds` - IDs of the projects that use the policy set. * `policyIds` - IDs of the policies attached to the policy set. * `policiesPath` - The sub-path within the attached VCS repository when using `vcsRepo`. @@ -69,4 +70,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file From f776fc4ce4e5659cc90c65643ecf1f7cd9a6fd1c Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Sep 2023 00:14:54 +0000 Subject: [PATCH 008/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown --- ...rkspace_policy_set_exclusion.html.markdown | 79 +++++++++++++++++ ...rkspace_policy_set_exclusion.html.markdown | 86 +++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown create mode 100644 website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown new file mode 100644 index 000000000..41d31f440 --- /dev/null +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -0,0 +1,79 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_policy_set_exclusion" +description: |- + Add a policy set to an excluded workspace +--- + + + +# tfe_workspace_policy_set_exclusion + +Adds and removes policy sets from an excluded workspace + +-> **Note:** `tfe_policy_set` has an argument `workspace_ids` that should not be used alongside this resource. They attempt to manage the same attachments. + +## Example Usage + +Basic usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import WorkspacePolicySetExclusion +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_policy_set_test = PolicySet(self, "test_1", + description="Some description.", + name="my-policy-set", + organization=test.name + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_policy_set_test.override_logical_id("test") + tfe_workspace_test = Workspace(self, "test_2", + name="my-workspace-name", + organization=test.name + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_workspace_test.override_logical_id("test") + tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=tfe_policy_set_test.id, + workspace_id=tfe_workspace_test.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_workspace_policy_set_exclusion_test.override_logical_id("test") +``` + +## Argument Reference + +The following arguments are supported: + +* `policy_set_id` - (Required) ID of the policy set. +* `workspace_id` - (Required) Excluded workspace ID to add the policy set to. + +## Attributes Reference + +* `id` - The ID of the policy set attachment. ID format: `_` + +## Import + +Excluded Workspace Policy Sets can be imported; use `//`. For example: + +```shell +terraform import tfe_workspace_policy_set_exclusion.test 'my-org-name/workspace/policy-set-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown new file mode 100644 index 000000000..1b4da302f --- /dev/null +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -0,0 +1,86 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_policy_set_exclusion" +description: |- + Add a policy set to an excluded workspace +--- + + + +# tfe_workspace_policy_set_exclusion + +Adds and removes policy sets from an excluded workspace + +-> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. + +## Example Usage + +Basic usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { + description: "Some description.", + name: "my-policy-set", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + const tfeWorkspaceTest = new Workspace(this, "test_2", { + name: "my-workspace-name", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( + this, + "test_3", + { + policy_set_id: tfePolicySetTest.id, + workspace_id: tfeWorkspaceTest.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `policySetId` - (Required) ID of the policy set. +* `workspaceId` - (Required) Excluded workspace ID to add the policy set to. + +## Attributes Reference + +* `id` - The ID of the policy set attachment. ID format: `_` + +## Import + +Excluded Workspace Policy Sets can be imported; use `//`. For example: + +```shell +terraform import tfe_workspace_policy_set_exclusion.test 'my-org-name/workspace/policy-set-name' +``` + + \ No newline at end of file From 59fde01520d4c46ccd1e91ecd2ba8fe5467011b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:38:31 -0500 Subject: [PATCH 009/420] Build(deps): Bump github.com/zclconf/go-cty from 1.13.2 to 1.14.0 (#1031) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.13.2 to 1.14.0. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.13.2...v1.14.0) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 5 +++-- go.sum | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 340225fd3..2e5b95519 100644 --- a/go.mod +++ b/go.mod @@ -24,12 +24,12 @@ require ( github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/zclconf/go-cty v1.13.2 + github.com/zclconf/go-cty v1.14.0 golang.org/x/crypto v0.10.0 // indirect golang.org/x/net v0.11.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) @@ -67,6 +67,7 @@ require ( require ( github.com/ProtonMail/go-crypto v0.0.0-20230619160724-3fbb1f12458c // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/hashicorp/hc-install v0.5.2 // indirect github.com/hashicorp/terraform-registry-address v0.2.1 // indirect diff --git a/go.sum b/go.sum index 389b29f78..a490b7dd0 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= @@ -147,8 +149,8 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= -github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= +github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -213,8 +215,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From df57e9e05eda76a9508714948af3ea64f9db75bd Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 11 Sep 2023 16:52:06 -0500 Subject: [PATCH 010/420] resolve various package failures (#1046) * run go get -u on terraform-plugin-framework * go get terraform-plugin-mux * get github.com/hashicorp/terraform-plugin-sdk * get terraform-plugin-sdk/v2@v2.29.0 * add new GetMetadata method * return &tfprotov5.GetMetadataResponse{} from new method --- go.mod | 38 +++++------ go.sum | 95 +++++++++++++++------------- internal/provider/plugin_provider.go | 4 ++ 3 files changed, 74 insertions(+), 63 deletions(-) diff --git a/go.mod b/go.mod index 2e5b95519..df7953630 100644 --- a/go.mod +++ b/go.mod @@ -15,39 +15,38 @@ require ( github.com/hashicorp/go-tfe v1.33.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 - github.com/hashicorp/hcl/v2 v2.17.0 // indirect - github.com/hashicorp/terraform-plugin-framework v1.3.5 + github.com/hashicorp/hcl/v2 v2.18.0 // indirect + github.com/hashicorp/terraform-plugin-framework v1.4.0 github.com/hashicorp/terraform-plugin-framework-validators v0.11.0 - github.com/hashicorp/terraform-plugin-go v0.18.0 - github.com/hashicorp/terraform-plugin-mux v0.11.2 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 + github.com/hashicorp/terraform-plugin-go v0.19.0 + github.com/hashicorp/terraform-plugin-mux v0.12.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.0 - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/net v0.11.0 // indirect + golang.org/x/crypto v0.13.0 // indirect + golang.org/x/net v0.13.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) require ( - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-plugin v1.5.1 // indirect github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.18.1 // indirect - github.com/hashicorp/terraform-json v0.17.0 // indirect + github.com/hashicorp/terraform-exec v0.19.0 // indirect + github.com/hashicorp/terraform-json v0.17.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -57,7 +56,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/grpc v1.56.1 // indirect + google.golang.org/grpc v1.57.0 // indirect ) require ( @@ -66,16 +65,19 @@ require ( ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230619160724-3fbb1f12458c // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect - github.com/hashicorp/hc-install v0.5.2 // indirect - github.com/hashicorp/terraform-registry-address v0.2.1 // indirect + github.com/hashicorp/hc-install v0.6.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.2 // indirect + github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/sync v0.3.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a490b7dd0..2cb2c27e4 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,18 @@ -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/ProtonMail/go-crypto v0.0.0-20230619160724-3fbb1f12458c h1:figwFwYep1Qnl64Y+Rc8tyQWE0xvYAN+5EX+rD40pTU= -github.com/ProtonMail/go-crypto v0.0.0-20230619160724-3fbb1f12458c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= +github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -19,10 +20,11 @@ github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= +github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -52,8 +54,8 @@ github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= +github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.12.1 h1:lYhmKXXonP4KGSz3JBmks6YpDRjP1cMA/yvcoPxoNw8= @@ -65,47 +67,48 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= -github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= +github.com/hashicorp/hc-install v0.6.0 h1:fDHnU7JNFNSQebVKYhHZ0va1bC6SrPQ8fpebsvNr2w4= +github.com/hashicorp/hc-install v0.6.0/go.mod h1:10I912u3nntx9Umo1VAeYPUUuehk0aRQJYpMwbX5wQA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= -github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= +github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= +github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d h1:9ARUJJ1VVynB176G1HCwleORqCaXm/Vx0uUi0dL26I0= github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= -github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= -github.com/hashicorp/terraform-json v0.17.0 h1:EiA1Wp07nknYQAiv+jIt4dX4Cq5crgP+TsTE45MjMmM= -github.com/hashicorp/terraform-json v0.17.0/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= -github.com/hashicorp/terraform-plugin-framework v1.3.5 h1:FJ6s3CVWVAxlhiF/jhy6hzs4AnPHiflsp9KgzTGl1wo= -github.com/hashicorp/terraform-plugin-framework v1.3.5/go.mod h1:2gGDpWiTI0irr9NSTLFAKlTi6KwGti3AoU19rFqU30o= +github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= +github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= +github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= +github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= +github.com/hashicorp/terraform-plugin-framework v1.4.0 h1:WKbtCRtNrjsh10eA7NZvC/Qyr7zp77j+D21aDO5th9c= +github.com/hashicorp/terraform-plugin-framework v1.4.0/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0= github.com/hashicorp/terraform-plugin-framework-validators v0.11.0 h1:DKb1bX7/EPZUTW6F5zdwJzS/EZ/ycVD6JAW5RYOj4f8= github.com/hashicorp/terraform-plugin-framework-validators v0.11.0/go.mod h1:dzxOiHh7O9CAwc6p8N4mR1H++LtRkl+u+21YNiBVNno= -github.com/hashicorp/terraform-plugin-go v0.18.0 h1:IwTkOS9cOW1ehLd/rG0y+u/TGLK9y6fGoBjXVUquzpE= -github.com/hashicorp/terraform-plugin-go v0.18.0/go.mod h1:l7VK+2u5Kf2y+A+742GX0ouLut3gttudmvMgN0PA74Y= +github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= +github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-mux v0.11.2 h1:XMkAmWQN+6F+l4jwNeqdPom/8Vly6ZNDxHoKjiRHx5c= -github.com/hashicorp/terraform-plugin-mux v0.11.2/go.mod h1:qjoF/pI49rILSNQzKIuDtU+ZX9mpQD0B8YNE1GceLPc= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 h1:I8efBnjuDrgPjNF1MEypHy48VgcTIUY4X6rOFunrR3Y= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0/go.mod h1:cUEP4ly/nxlHy5HzD6YRrHydtlheGvGRJDhiWqqVik4= -github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= -github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= +github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gSNgvMEng2Rn9z3WZY= +github.com/hashicorp/terraform-plugin-mux v0.12.0/go.mod h1:8MR0AgmV+Q03DIjyrAKxXyYlq2EUnYBQP8gxAAA0zeM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 h1:wcOKYwPI9IorAJEBLzgclh3xVolO7ZorYd6U1vnok14= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0/go.mod h1:qH/34G25Ugdj5FcM95cSoXzUgIbgfhVLXCcEcYaMwq8= +github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= +github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -132,7 +135,7 @@ github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -156,13 +159,13 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -172,8 +175,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -201,8 +204,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -215,14 +218,15 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -233,15 +237,16 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/internal/provider/plugin_provider.go b/internal/provider/plugin_provider.go index 9ec7a3328..c51141ba3 100644 --- a/internal/provider/plugin_provider.go +++ b/internal/provider/plugin_provider.go @@ -45,6 +45,10 @@ type providerMeta struct { organization string } +func (p *pluginProviderServer) GetMetadata(ctx context.Context, req *tfprotov5.GetMetadataRequest) (*tfprotov5.GetMetadataResponse, error) { + return &tfprotov5.GetMetadataResponse{}, nil +} + func (p *pluginProviderServer) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error) { return &tfprotov5.GetProviderSchemaResponse{ Provider: p.providerSchema, From 8acf4037d8095d01e65deb49ead0aff08c68f93b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:29:10 -0500 Subject: [PATCH 011/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework-validators (#1032) Bumps [github.com/hashicorp/terraform-plugin-framework-validators](https://github.com/hashicorp/terraform-plugin-framework-validators) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework-validators/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework-validators/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework-validators dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index df7953630..c4ca757a9 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect github.com/hashicorp/terraform-plugin-framework v1.4.0 - github.com/hashicorp/terraform-plugin-framework-validators v0.11.0 + github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.19.0 github.com/hashicorp/terraform-plugin-mux v0.12.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 diff --git a/go.sum b/go.sum index 2cb2c27e4..2e52a76e8 100644 --- a/go.sum +++ b/go.sum @@ -83,8 +83,8 @@ github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQH github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= github.com/hashicorp/terraform-plugin-framework v1.4.0 h1:WKbtCRtNrjsh10eA7NZvC/Qyr7zp77j+D21aDO5th9c= github.com/hashicorp/terraform-plugin-framework v1.4.0/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0= -github.com/hashicorp/terraform-plugin-framework-validators v0.11.0 h1:DKb1bX7/EPZUTW6F5zdwJzS/EZ/ycVD6JAW5RYOj4f8= -github.com/hashicorp/terraform-plugin-framework-validators v0.11.0/go.mod h1:dzxOiHh7O9CAwc6p8N4mR1H++LtRkl+u+21YNiBVNno= +github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= +github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= From b43342d696929261d4b079a99168aaa543736dae Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Tue, 12 Sep 2023 11:38:02 -0700 Subject: [PATCH 012/420] update warning logs for credential files --- internal/client/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/client/config.go b/internal/client/config.go index 420af8cb2..fa20b8ee0 100644 --- a/internal/client/config.go +++ b/internal/client/config.go @@ -117,26 +117,27 @@ func locateConfigFile() string { return filePath } +// All the errors returned by the helper methods called in this function get ignored (down the road we throw an error when all auth methods have failed.) We only use these errors to log warnings to the user. func readCliConfigFile(configFilePath string) CLIHostConfig { config := CLIHostConfig{} // Read the CLI config file content. content, err := os.ReadFile(configFilePath) if err != nil { - log.Printf("[ERROR] Error reading CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Error reading CLI config or credentials file %s: %v", configFilePath, err) return config } // Parse the CLI config file content. obj, err := hcl.Parse(string(content)) if err != nil { - log.Printf("[ERROR] Error parsing CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Error parsing CLI config or credentials file %s: %v", configFilePath, err) return config } // Decode the CLI config file content. if err := hcl.DecodeObject(&config, obj); err != nil { - log.Printf("[ERROR] Error decoding CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Error decoding CLI config or credentials file %s: %v", configFilePath, err) } return config From 015a97e3725a01d2e7a55d7f66343a2a113525f5 Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Tue, 12 Sep 2023 11:53:10 -0700 Subject: [PATCH 013/420] adjust language to not use the word error --- internal/client/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/client/config.go b/internal/client/config.go index fa20b8ee0..855c949f5 100644 --- a/internal/client/config.go +++ b/internal/client/config.go @@ -124,20 +124,20 @@ func readCliConfigFile(configFilePath string) CLIHostConfig { // Read the CLI config file content. content, err := os.ReadFile(configFilePath) if err != nil { - log.Printf("[WARN] Error reading CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Unable to read CLI config or credentials file %s: %v", configFilePath, err) return config } // Parse the CLI config file content. obj, err := hcl.Parse(string(content)) if err != nil { - log.Printf("[WARN] Error parsing CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Unable to parse CLI config or credentials file %s: %v", configFilePath, err) return config } // Decode the CLI config file content. if err := hcl.DecodeObject(&config, obj); err != nil { - log.Printf("[WARN] Error decoding CLI config or credentials file %s: %v", configFilePath, err) + log.Printf("[WARN] Unable to decode CLI config or credentials file %s: %v", configFilePath, err) } return config From 48f2d9e882db492284ceb9bfaab0e2b539a814ad Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Thu, 14 Sep 2023 14:57:52 -0500 Subject: [PATCH 014/420] Update Create Jira Ticket workflow * Add repo label * Add conditional logic to set the correct epic * Strip EOL whitespace --- .github/workflows/call-jira-issue-sync.yml | 29 ++++++++++++++++------ .github/workflows/jira-issue-sync.yml | 4 +-- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 9fc5e2207..6db828fc1 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -6,11 +6,26 @@ on: issue_comment: types: [created] +env: + EPIC_LINK: "TF-3484" + jobs: - call-workflow: - uses: ./.github/workflows/jira-issue-sync.yml - with: - project: TF - issue-extra-fields: | - { "customfield_10091": ["TF-CLI"] } - secrets: inherit + sync: + runs-on: ubuntu-latest + steps: + # Conditionally change the Epic link if the issue contains the bug label + # customfield_10008 is the epic link + - name: Is this a bug + run: echo "EPIC_LINK=TF-7331" >> $GITHUB_ENV + if: contains(github.event.issue.labels.*.name, 'bug') + + - name: call-workflow + uses: ./.github/workflows/jira-issue-sync.yml + with: + project: TF + issue-extra-fields: | + { "customfield_10091": ["TF-CLI"], + "customfield_10008": "${{ env.EPIC_LINK }}" + "labels": "${{ github.event.repository.name }}" + } + secrets: inherit diff --git a/.github/workflows/jira-issue-sync.yml b/.github/workflows/jira-issue-sync.yml index b11da6841..c7ff880d1 100644 --- a/.github/workflows/jira-issue-sync.yml +++ b/.github/workflows/jira-issue-sync.yml @@ -34,8 +34,8 @@ jobs: "labels": ${{ toJSON(github.event.issue.labels.*.name) }} } run: | - echo "extra=$(echo '${{ env.EXTRA_FIELDS }}' '${{ inputs.issue-extra-fields }}' | jq -rcs '.[0] * .[1]')" >> $GITHUB_OUTPUT - + echo "extra=$(echo '${{ env.EXTRA_FIELDS }}' '${{ inputs.issue-extra-fields }}' | jq -rcs '.[0] * .[1]')" >> $GITHUB_OUTPUT + # Creates a new issue, only if this is a new PR or GH Issue, and only if an existing issue is not in the branch name - name: Create Issue From e0d219c520e80232c8883d43caaea14c9e665f88 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 12:21:37 -0500 Subject: [PATCH 015/420] Another try at updating the GH action --- .github/workflows/call-jira-issue-sync.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 6db828fc1..19271f210 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -19,13 +19,13 @@ jobs: run: echo "EPIC_LINK=TF-7331" >> $GITHUB_ENV if: contains(github.event.issue.labels.*.name, 'bug') - - name: call-workflow - uses: ./.github/workflows/jira-issue-sync.yml - with: - project: TF - issue-extra-fields: | - { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ env.EPIC_LINK }}" - "labels": "${{ github.event.repository.name }}" - } - secrets: inherit + call-workflow: + uses: ./.github/workflows/jira-issue-sync.yml + with: + project: TF + issue-extra-fields: | + { "customfield_10091": ["TF-CLI"], + "customfield_10008": "${{ github.env.EPIC_LINK }}" + "labels": "${{ github.event.repository.name }}" + } + secrets: inherit From 7058ca864940d9fe99ca0bcb2664e1b2b306b798 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 13:46:29 -0500 Subject: [PATCH 016/420] Update Jira ticket create workflow again --- .github/workflows/call-jira-issue-sync.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 19271f210..64e3e7515 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -7,25 +7,17 @@ on: types: [created] env: - EPIC_LINK: "TF-3484" + EPIC_LINK_BUG: "TF-7331" + EPIC_LINK_FEATURE: "TF-3484" jobs: - sync: - runs-on: ubuntu-latest - steps: - # Conditionally change the Epic link if the issue contains the bug label - # customfield_10008 is the epic link - - name: Is this a bug - run: echo "EPIC_LINK=TF-7331" >> $GITHUB_ENV - if: contains(github.event.issue.labels.*.name, 'bug') - call-workflow: uses: ./.github/workflows/jira-issue-sync.yml with: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ github.env.EPIC_LINK }}" + "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}" "labels": "${{ github.event.repository.name }}" } secrets: inherit From 14ce99f2735b563ac30fc378ae7c4384701bbdb8 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 13:56:23 -0500 Subject: [PATCH 017/420] Update call-jira-issue-sync.yml --- .github/workflows/call-jira-issue-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 64e3e7515..5a280519d 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -17,7 +17,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}" + "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}", "labels": "${{ github.event.repository.name }}" } secrets: inherit From da3646e89847a9059c81c2b4bb7b043fbfb36087 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:01:36 -0500 Subject: [PATCH 018/420] Jira field wants an array --- .github/workflows/call-jira-issue-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 5a280519d..b98f3f847 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -17,7 +17,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}", + "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}"], "labels": "${{ github.event.repository.name }}" } secrets: inherit From c7147b8116aae5e91bb942962c8b537b734fc6bc Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:05:56 -0500 Subject: [PATCH 019/420] Update call-jira-issue-sync.yml --- .github/workflows/call-jira-issue-sync.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index b98f3f847..5c15127cf 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -6,10 +6,6 @@ on: issue_comment: types: [created] -env: - EPIC_LINK_BUG: "TF-7331" - EPIC_LINK_FEATURE: "TF-3484" - jobs: call-workflow: uses: ./.github/workflows/jira-issue-sync.yml @@ -17,7 +13,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && github.env.EPIC_LINK_BUG || github.env.EPIC_LINK_FEATURE }}"], + "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && 'TF-7331' || 'TF-3484' }}"], "labels": "${{ github.event.repository.name }}" } secrets: inherit From afbcf10b1047ebc794720490a282126114a464e8 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:12:54 -0500 Subject: [PATCH 020/420] Update call-jira-issue-sync.yml Hopefully Jira likes _this_ epic link --- .github/workflows/call-jira-issue-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 5c15127cf..2443e496b 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -13,7 +13,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && 'TF-7331' || 'TF-3484' }}"], + "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && 'Bugs in terraform-provider-tfe' || 'terraform-provider-tfe Feature Requests' }}"], "labels": "${{ github.event.repository.name }}" } secrets: inherit From b52b4e8a70a73e7700d5e6de3ea4fe4c65d0ec75 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:16:21 -0500 Subject: [PATCH 021/420] Update call-jira-issue-sync.yml --- .github/workflows/call-jira-issue-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 2443e496b..a80ef15a2 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -13,7 +13,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": ["${{ contains(github.event.issue.labels.*.name, 'bug') && 'Bugs in terraform-provider-tfe' || 'terraform-provider-tfe Feature Requests' }}"], + "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && 'Bugs in terraform-provider-tfe' || 'terraform-provider-tfe Feature Requests' }}", "labels": "${{ github.event.repository.name }}" } secrets: inherit From 4e34e96f69fb6b8749974dacabe5a5747b6e080b Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:23:27 -0500 Subject: [PATCH 022/420] Jiraaaaa --- .github/workflows/call-jira-issue-sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index a80ef15a2..4cfb5319b 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -13,7 +13,7 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && 'Bugs in terraform-provider-tfe' || 'terraform-provider-tfe Feature Requests' }}", - "labels": "${{ github.event.repository.name }}" + "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && 'TF-7331' || 'TF-3484' }}", + "labels": [ "${{ github.event.repository.name }} ]" } secrets: inherit From 4f5c2f91e4a9bbd56fd8635de188e5ca1e980b9d Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Fri, 15 Sep 2023 14:28:05 -0500 Subject: [PATCH 023/420] Just the epic link --- .github/workflows/call-jira-issue-sync.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/call-jira-issue-sync.yml b/.github/workflows/call-jira-issue-sync.yml index 4cfb5319b..1c6c1a096 100644 --- a/.github/workflows/call-jira-issue-sync.yml +++ b/.github/workflows/call-jira-issue-sync.yml @@ -13,7 +13,6 @@ jobs: project: TF issue-extra-fields: | { "customfield_10091": ["TF-CLI"], - "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && 'TF-7331' || 'TF-3484' }}", - "labels": [ "${{ github.event.repository.name }} ]" + "customfield_10008": "${{ contains(github.event.issue.labels.*.name, 'bug') && 'TF-7331' || 'TF-3484' }}" } secrets: inherit From cd485ae3d529c062a159efe28cc6b44ecc295a2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:34:15 -0500 Subject: [PATCH 024/420] Build(deps): Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#1042) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/0b7f8abb1508181956e8e162db84b466c27e18ce...a8a3f3ad30e3422c9c7b888a15615d19a852ae32) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b0cafbf5..59379d8bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index f00336005..b88249cd9 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4c586f16..45e0c3b9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: release-notes path: release-notes.txt From 5b667051dbaa856c200f874e35ccacf96148eb42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:38:50 -0500 Subject: [PATCH 025/420] Build(deps): Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#1042) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/0b7f8abb1508181956e8e162db84b466c27e18ce...a8a3f3ad30e3422c9c7b888a15615d19a852ae32) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From 2f928da4ea15e1b2f7f6213bab3407c9223bb291 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Sep 2023 14:50:16 -0600 Subject: [PATCH 026/420] Empty commit to trigger CI From 4d15f67ddb9509bd557af18742fc1beb2a4fabe7 Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 25 Sep 2023 10:58:53 -0500 Subject: [PATCH 027/420] [TF-9505] fix TestAccTFEWorkspace_updateRemoveVCSRepoWithTagsRegex (#1076) * remove unused fn testAccTFEWorkspace_updateUpdateVCSRepoBranchFileTriggersDisabled * fix linter warning * alphabetize long list of arg references * remove vcs_repo block for now * replace repo, prev repo deleted * alphabetize vcs_repo args in docs * change GITHUB_WORKSPACE_IDENTIFIER * update branch - testing theory --- .github/actions/test-provider-tfe/action.yml | 4 +- internal/provider/resource_tfe_workspace.go | 2 +- .../provider/resource_tfe_workspace_test.go | 38 +------------------ website/docs/r/workspace.html.markdown | 20 +++++----- 4 files changed, 14 insertions(+), 50 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 7f5990cfb..d2a34ad26 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -99,8 +99,8 @@ runs: TFC_RUN_TASK_URL: "https://httpstat.us/200" GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" - GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-1" - GITHUB_WORKSPACE_BRANCH: "test" + GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" + GITHUB_WORKSPACE_BRANCH: "main" GITHUB_TOKEN: "${{ inputs.testing-github-token }}" MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 74c105678..70db1645e 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -410,7 +410,7 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error } remoteStateConsumerIDs, ok := d.GetOk("remote_state_consumer_ids") - if ok && globalRemoteState.(bool) == false { + if ok && !globalRemoteState.(bool) { options := tfe.WorkspaceAddRemoteStateConsumersOptions{} for _, remoteStateConsumerID := range remoteStateConsumerIDs.(*schema.Set).List() { options.Workspaces = append(options.Workspaces, &tfe.Workspace{ID: remoteStateConsumerID.(string)}) diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index f0b454239..971fdd19d 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -1613,6 +1613,7 @@ func TestAccTFEWorkspace_updateVCSRepoChangeTagRegexToTriggerPattern(t *testing. func TestAccTFEWorkspace_updateRemoveVCSRepoWithTagsRegex(t *testing.T) { workspace := &tfe.Workspace{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -3213,41 +3214,6 @@ resource "tfe_workspace" "foobar" { ) } -func testAccTFEWorkspace_updateUpdateVCSRepoBranchFileTriggersDisabled(rInt int) string { - return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" -} - -resource "tfe_oauth_client" "test" { - organization = tfe_organization.foobar.id - api_url = "https://api.github.com" - http_url = "https://github.com" - oauth_token = "%s" - service_provider = "github" -} - -resource "tfe_workspace" "foobar" { - name = "workspace-test" - description = "workspace-test-update-vcs-repo-branch" - organization = tfe_organization.foobar.id - auto_apply = true - ## file_triggers_enabled = false - vcs_repo { - identifier = "%s" - oauth_token_id = tfe_oauth_client.test.oauth_token_id - branch = "%s" - } -} -`, - rInt, - envGithubToken, - envGithubWorkspaceIdentifier, - envGithubWorkspaceBranch, - ) -} - func testAccTFEWorkspace_updateUpdateVCSRepoBranch(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { @@ -3458,7 +3424,7 @@ func testAccTFEWorkspace_updateRemoveVCSBlockFromTagsRegex(rInt int) string { description = "workspace-test-update-vcs-repo-tags-regex" organization = tfe_organization.foobar.id auto_apply = true - force_delete = true + force_delete = true file_triggers_enabled = true trigger_patterns = ["foo/**/*"] } diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 3f69a6719..dc522f2b4 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -54,31 +54,30 @@ resource "tfe_workspace" "test" { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `description` - (Optional) A description for the workspace. * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is provided. * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. -* `auto_apply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `false`. +* `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. +* `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. -* `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. 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. +* `force_delete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `global_remote_state` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remote_state_consumer_ids`). -* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for state storage only. This value _must not_ be provided if `execution_mode` is provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `project_id` - (Optional) ID of the project where the workspace should be created. * `queue_all_runs` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -88,6 +87,7 @@ The following arguments are supported: is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. +* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `source_name` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -116,15 +116,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `trigger_prefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. -* `working_directory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `vcs_repo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `force_delete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `working_directory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `vcs_repo` block supports: @@ -133,11 +131,11 @@ The `vcs_repo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. * `ingress_submodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauth_token_id` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. -* `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. * `tags_regex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `trigger_patterns` and `trigger_prefixes`. Should only set this value if the former is not being used. ## Attributes Reference From 1541e25e89208cbb217abf2cbec25bab58182025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:50:07 -0500 Subject: [PATCH 028/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.33.0 to 1.34.0 (#1047) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.33.0 to 1.34.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.33.0...v1.34.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index c4ca757a9..61894544f 100644 --- a/go.mod +++ b/go.mod @@ -11,8 +11,8 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect - github.com/hashicorp/go-slug v0.12.1 - github.com/hashicorp/go-tfe v1.33.0 + github.com/hashicorp/go-slug v0.12.2 + github.com/hashicorp/go-tfe v1.34.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect diff --git a/go.sum b/go.sum index 2e52a76e8..c7e1583e8 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBY github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.12.1 h1:lYhmKXXonP4KGSz3JBmks6YpDRjP1cMA/yvcoPxoNw8= -github.com/hashicorp/go-slug v0.12.1/go.mod h1:JZVtycnZZbiJ4oxpJ/zfhyfBD8XxT4f0uOSyjNLCqFY= -github.com/hashicorp/go-tfe v1.33.0 h1:UQ04F/Dd+IgjQDciBZz/BKHTFwc7zXbJTI1+zNN355U= -github.com/hashicorp/go-tfe v1.33.0/go.mod h1:Js4M/3kv14oTBlvLxqh0bbrWfosmNsEb9ad9YazsyfM= +github.com/hashicorp/go-slug v0.12.2 h1:Gb6nxnV5GI1UVa3aLJGUj66J8AOZFnjIoYalNCp2Cbo= +github.com/hashicorp/go-slug v0.12.2/go.mod h1:JZVtycnZZbiJ4oxpJ/zfhyfBD8XxT4f0uOSyjNLCqFY= +github.com/hashicorp/go-tfe v1.34.0 h1:33xcVQ8sbkdPVhubpVH208+S72l6l5bFEi14363yOIE= +github.com/hashicorp/go-tfe v1.34.0/go.mod h1:xA+N8r81ldvS7PC/DVbL+FqGsgfrcu1Ak4+6His+51s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 87f013a0e255d093b662fe6b350569bceae636ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:06:10 -0500 Subject: [PATCH 029/420] Build(deps): Bump actions/checkout from 4.0.0 to 4.1.0 (#1079) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/3df4ab11eba7bda6032a0b82a6bb43b11571feac...8ade135a41bc03ea155e62e844d188df1ea18608) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59379d8bb..7b5743447 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b88249cd9..0b97de306 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index b3ddcdc7f..15874671a 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 6eb920e91..7673458d7 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45e0c3b9d..e8606614c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 with: fetch-depth: 0 - name: Generate Release Notes From e3d16c57a585c845aebcbc8d5d03e1316c343a85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:25:30 -0500 Subject: [PATCH 030/420] Build(deps): Bump actions/cache from 3.3.1 to 3.3.2 (#1044) Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8...704facf57e6136b1bc63b828d79edcd491f0ee84) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 0b97de306..22fe2e85c 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -74,7 +74,7 @@ jobs: - name: Get yarn cache directory path id: global-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 id: global-cache with: path: ${{ steps.global-cache-dir-path.outputs.dir }} From ac43481f0d1eec64f21b41d4e83fd397b3758ca3 Mon Sep 17 00:00:00 2001 From: team-tf-cdk <84392119+team-tf-cdk@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:53:42 -0400 Subject: [PATCH 031/420] cdktf: update r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_module.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown (#1078) --- website/docs/cdktf/python/r/registry_module.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_module.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index a55a54f39..11c5bef3b 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -218,4 +218,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index e4643583a..d318812d2 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -241,4 +241,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file From 223ad91d2268fe232875c4e777f1219d897e5c76 Mon Sep 17 00:00:00 2001 From: Jeff Bonhag Date: Wed, 27 Sep 2023 15:59:41 -0400 Subject: [PATCH 032/420] experiment: remove workspace includes from policy set reads --- internal/provider/resource_tfe_workspace_policy_set.go | 4 +--- .../provider/resource_tfe_workspace_policy_set_exclusion.go | 4 +--- .../resource_tfe_workspace_policy_set_exclusion_test.go | 5 +---- internal/provider/resource_tfe_workspace_policy_set_test.go | 5 +---- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/internal/provider/resource_tfe_workspace_policy_set.go b/internal/provider/resource_tfe_workspace_policy_set.go index 99a1f9d74..82bb6dd19 100644 --- a/internal/provider/resource_tfe_workspace_policy_set.go +++ b/internal/provider/resource_tfe_workspace_policy_set.go @@ -66,9 +66,7 @@ func resourceTFEWorkspacePolicySetRead(d *schema.ResourceData, meta interface{}) workspaceID := d.Get("workspace_id").(string) log.Printf("[DEBUG] Read configuration of workspace policy set: %s", policySetID) - policySet, err := config.Client.PolicySets.ReadWithOptions(ctx, policySetID, &tfe.PolicySetReadOptions{ - Include: []tfe.PolicySetIncludeOpt{tfe.PolicySetWorkspaces}, - }) + policySet, err := config.Client.PolicySets.Read(ctx, policySetID) if err != nil { if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] Policy set %s no longer exists", policySetID) diff --git a/internal/provider/resource_tfe_workspace_policy_set_exclusion.go b/internal/provider/resource_tfe_workspace_policy_set_exclusion.go index 41ea744b4..c23165ebb 100644 --- a/internal/provider/resource_tfe_workspace_policy_set_exclusion.go +++ b/internal/provider/resource_tfe_workspace_policy_set_exclusion.go @@ -66,9 +66,7 @@ func resourceTFEWorkspacePolicySetExclusionRead(d *schema.ResourceData, meta int workspaceExclusionsID := d.Get("workspace_id").(string) log.Printf("[DEBUG] Read configuration of excluded workspace policy set: %s", policySetID) - policySet, err := config.Client.PolicySets.ReadWithOptions(ctx, policySetID, &tfe.PolicySetReadOptions{ - Include: []tfe.PolicySetIncludeOpt{tfe.PolicySetWorkspaceExclusions}, - }) + policySet, err := config.Client.PolicySets.Read(ctx, policySetID) if err != nil { if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] Policy set %s no longer exists", policySetID) diff --git a/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go b/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go index dc9f65352..4a1691b97 100644 --- a/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go +++ b/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go @@ -10,7 +10,6 @@ import ( "testing" "time" - tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -102,9 +101,7 @@ func testAccCheckTFEWorkspacePolicySetExclusionExists(n string) resource.TestChe return fmt.Errorf("no excluded workspace id set") } - policySet, err := config.Client.PolicySets.ReadWithOptions(ctx, policySetID, &tfe.PolicySetReadOptions{ - Include: []tfe.PolicySetIncludeOpt{tfe.PolicySetWorkspaces}, - }) + policySet, err := config.Client.PolicySets.Read(ctx, policySetID) if err != nil { return fmt.Errorf("error reading polciy set %s: %w", policySetID, err) } diff --git a/internal/provider/resource_tfe_workspace_policy_set_test.go b/internal/provider/resource_tfe_workspace_policy_set_test.go index fcfe42c7b..99b7bd92b 100644 --- a/internal/provider/resource_tfe_workspace_policy_set_test.go +++ b/internal/provider/resource_tfe_workspace_policy_set_test.go @@ -10,7 +10,6 @@ import ( "testing" "time" - tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -100,9 +99,7 @@ func testAccCheckTFEWorkspacePolicySetExists(n string) resource.TestCheckFunc { return fmt.Errorf("No workspace id set") } - policySet, err := config.Client.PolicySets.ReadWithOptions(ctx, policySetID, &tfe.PolicySetReadOptions{ - Include: []tfe.PolicySetIncludeOpt{tfe.PolicySetWorkspaces}, - }) + policySet, err := config.Client.PolicySets.Read(ctx, policySetID) if err != nil { return fmt.Errorf("error reading polciy set %s: %w", policySetID, err) } From c346981751753d619a634516f57db963a3c640ae Mon Sep 17 00:00:00 2001 From: Jeff Bonhag Date: Fri, 29 Sep 2023 11:52:44 -0400 Subject: [PATCH 033/420] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c4032e64..2ca3fc312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ BUG FIXES: * `r/tfe_team_project_access`: Fixes a panic that occurs when the client is configured against an older TFE release, by @sebasslash [1011](https://github.com/hashicorp/terraform-provider-tfe/pull/1011) * The provider no longer makes two service discovery requests per provider config, by @brandonc [1034](https://github.com/hashicorp/terraform-provider-tfe/pull/1034) * `d/tfe_policy_set`: Add `excluded_workspace_ids` attribute, by @Netra2104 [1035](https://github.com/hashicorp/terraform-provider-tfe/pull/1035) +* `r/tfe_workspace_policy_set` and `r/tfe_workspace_policy_set_exclusion`: Removed workspace-related `include` parameters since included workspace data is not required to manage these resources, by @jbonhag [1080](https://github.com/hashicorp/terraform-provider-tfe/pull/1080) FEATURES: * `d/tfe_organization_membership`: Add `organization_membership_id` attribute, by @laurenolivia [997](https://github.com/hashicorp/terraform-provider-tfe/pull/997) From 027ee20b2f4c9605566527f9b73f6259af7c6ec5 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 2 Oct 2023 00:15:28 +0000 Subject: [PATCH 034/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown --- .../cdktf/python/r/workspace.html.markdown | 22 +++++++++---------- .../typescript/r/workspace.html.markdown | 22 +++++++++---------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index b274a91e8..97f02223c 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -78,31 +78,30 @@ class MyConvertedCode(TerraformStack): The following arguments are supported: * `name` - (Required) Name of the workspace. -* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `description` - (Optional) A description for the workspace. * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is provided. * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. -* `auto_apply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `false`. +* `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. +* `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. -* `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. 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. +* `force_delete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `global_remote_state` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remote_state_consumer_ids`). -* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for state storage only. This value _must not_ be provided if `execution_mode` is provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `project_id` - (Optional) ID of the project where the workspace should be created. * `queue_all_runs` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -112,6 +111,7 @@ The following arguments are supported: is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. +* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `source_name` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -140,15 +140,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `trigger_prefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. -* `working_directory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `vcs_repo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `force_delete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `working_directory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `vcs_repo` block supports: @@ -157,11 +155,11 @@ The `vcs_repo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. * `ingress_submodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauth_token_id` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. -* `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. * `tags_regex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `trigger_patterns` and `trigger_prefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -185,4 +183,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 0c3c3c5e3..0e9cecb61 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -84,31 +84,30 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `description` - (Optional) A description for the workspace. * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value or if `operations` is provided. * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. -* `autoApply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `false`. +* `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. +* `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. -* `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. 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. +* `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remoteStateConsumerIds`). -* `remoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for state storage only. This value _must not_ be provided if `executionMode` is provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `projectId` - (Optional) ID of the project where the workspace should be created. * `queueAllRuns` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -118,6 +117,7 @@ The following arguments are supported: is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. +* `remoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `sourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -146,15 +146,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. -* `workingDirectory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `workingDirectory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `vcsRepo` block supports: @@ -163,11 +161,11 @@ The `vcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -191,4 +189,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file From b69efbb44298142fa8076628b4a3aaebf8f6dfe9 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 14:19:19 -0600 Subject: [PATCH 035/420] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca3fc312..212cd3a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## Unreleased +## v0.49.0 (October 2, 2023) BUG FIXES: * `r/tfe_team_project_access`: Fixes a panic that occurs when the client is configured against an older TFE release, by @sebasslash [1011](https://github.com/hashicorp/terraform-provider-tfe/pull/1011) From 6fceb13a94e1155fcc49212007e247e7adc17651 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 14:36:29 -0600 Subject: [PATCH 036/420] Bump release version in docs --- README.md | 2 +- website/docs/index.html.markdown | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08a591e39..9190b7629 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.48.0" + version = "~> 0.49.0" } } } diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 6657cc99c..05777efd7 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.48.0" + version = "~> 0.49.0" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.0" ... } ``` From c5b0a2b0b8943e8fb024d671d1c484a8085a6169 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 17:16:29 -0600 Subject: [PATCH 037/420] Revert 'add client caching by config, extract client and logging packages' --- internal/client/client.go | 263 ----------- internal/client/config.go | 254 ----------- internal/client/config_test.go | 158 ------- internal/client/init.go | 19 - internal/{client => provider}/config_unix.go | 2 +- .../{client => provider}/config_windows.go | 2 +- internal/{logging => provider}/logging.go | 2 +- internal/provider/plugin_provider.go | 3 +- internal/provider/provider.go | 412 +++++++++++++++++- internal/provider/provider_next.go | 3 +- internal/provider/provider_test.go | 156 ++++++- 11 files changed, 567 insertions(+), 707 deletions(-) delete mode 100644 internal/client/client.go delete mode 100644 internal/client/config.go delete mode 100644 internal/client/config_test.go delete mode 100644 internal/client/init.go rename internal/{client => provider}/config_unix.go (98%) rename internal/{client => provider}/config_windows.go (98%) rename internal/{logging => provider}/logging.go (99%) diff --git a/internal/client/client.go b/internal/client/client.go deleted file mode 100644 index c058b4902..000000000 --- a/internal/client/client.go +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package client - -import ( - "errors" - "fmt" - "log" - "net/url" - "os" - "sort" - "strings" - "sync" - - tfe "github.com/hashicorp/go-tfe" - "github.com/hashicorp/go-version" - providerVersion "github.com/hashicorp/terraform-provider-tfe/version" - svchost "github.com/hashicorp/terraform-svchost" - "github.com/hashicorp/terraform-svchost/disco" -) - -const ( - DefaultHostname = "app.terraform.io" -) - -var ( - ErrMissingAuthToken = errors.New("required token could not be found. Please set the token using an input variable in the provider configuration block or by using the TFE_TOKEN environment variable") - tfeServiceIDs = []string{"tfe.v2.2"} -) - -type ClientConfigMap struct { - mu sync.Mutex - values map[string]*tfe.Client -} - -func (c *ClientConfigMap) GetByConfig(config *ClientConfiguration) *tfe.Client { - if c.mu.TryLock() { - defer c.Unlock() - } - - return c.values[config.Key()] -} - -func (c *ClientConfigMap) Lock() { - c.mu.Lock() -} - -func (c *ClientConfigMap) Unlock() { - c.mu.Unlock() -} - -func (c *ClientConfigMap) Set(client *tfe.Client, config *ClientConfiguration) { - if c.mu.TryLock() { - defer c.Unlock() - } - c.values[config.Key()] = client -} - -func getTokenFromEnv() string { - log.Printf("[DEBUG] TFE_TOKEN used for token value") - return os.Getenv("TFE_TOKEN") -} - -func getTokenFromCreds(services *disco.Disco, hostname svchost.Hostname) string { - log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %s...", hostname) - creds, err := services.CredentialsForHost(hostname) - if err != nil { - log.Printf("[DEBUG] Failed to get credentials for %s: %s (ignoring)", hostname, err) - } - if creds != nil { - return creds.Token() - } - return "" -} - -// GetClient encapsulates the logic for configuring a go-tfe client instance for -// the provider, including fallback to values from environment variables. This -// is useful because we're muxing multiple provider servers together and each -// one needs an identically configured client. -// -// Internally, this function caches configured clients using the specified -// parameters -func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { - config, err := configure(tfeHost, token, insecure) - if err != nil { - return nil, err - } - - clientCache.Lock() - defer clientCache.Unlock() - - // Try to retrieve the client from cache - cached := clientCache.GetByConfig(config) - if cached != nil { - return cached, nil - } - - // Discover the Terraform Enterprise address. - host, err := config.Services.Discover(config.TFEHost) - if err != nil { - return nil, err - } - - // Get the full Terraform Enterprise service address. - var address *url.URL - var discoErr error - for _, tfeServiceID := range tfeServiceIDs { - service, err := host.ServiceURL(tfeServiceID) - if _, ok := err.(*disco.ErrVersionNotSupported); !ok && err != nil { - return nil, err - } - // If discoErr is nil we save the first error. When multiple services - // are checked and we found one that didn't give an error we need to - // reset the discoErr. So if err is nil, we assign it as well. - if discoErr == nil || err == nil { - discoErr = err - } - if service != nil { - address = service - break - } - } - - if providerVersion.ProviderVersion != "dev" { - // We purposefully ignore the error and return the previous error, as - // checking for version constraints is considered optional. - constraints, _ := host.VersionConstraints(tfeServiceIDs[0], "tfe-provider") - - // First check any constraints we might have received. - if constraints != nil { - if err := CheckConstraints(constraints); err != nil { - return nil, err - } - } - } - - // When we don't have any constraints errors, also check for discovery - // errors before we continue. - if discoErr != nil { - return nil, discoErr - } - - // Create a new TFE client. - client, err := tfe.NewClient(&tfe.Config{ - Address: address.String(), - Token: token, - HTTPClient: config.HTTPClient, - }) - if err != nil { - return nil, err - } - - client.RetryServerErrors(true) - clientCache.Set(client, config) - - return client, nil -} - -// CheckConstraints checks service version constrains against our own -// version and returns rich and informational diagnostics in case any -// incompatibilities are detected. -func CheckConstraints(c *disco.Constraints) error { - if c == nil || c.Minimum == "" || c.Maximum == "" { - return nil - } - - // Generate a parsable constraints string. - excluding := "" - if len(c.Excluding) > 0 { - excluding = fmt.Sprintf(", != %s", strings.Join(c.Excluding, ", != ")) - } - constStr := fmt.Sprintf(">= %s%s, <= %s", c.Minimum, excluding, c.Maximum) - - // Create the constraints to check against. - constraints, err := version.NewConstraint(constStr) - if err != nil { - return checkConstraintsWarning(err) - } - - // Create the version to check. - v, err := version.NewVersion(providerVersion.ProviderVersion) - if err != nil { - return checkConstraintsWarning(err) - } - - // Return if we satisfy all constraints. - if constraints.Check(v) { - return nil - } - - // Find out what action (upgrade/downgrade) we should advice. - minimum, err := version.NewVersion(c.Minimum) - if err != nil { - return checkConstraintsWarning(err) - } - - maximum, err := version.NewVersion(c.Maximum) - if err != nil { - return checkConstraintsWarning(err) - } - - var excludes []*version.Version - for _, exclude := range c.Excluding { - v, err := version.NewVersion(exclude) - if err != nil { - return checkConstraintsWarning(err) - } - excludes = append(excludes, v) - } - - // Sort all the excludes. - sort.Sort(version.Collection(excludes)) - - var action, toVersion string - switch { - case minimum.GreaterThan(v): - action = "upgrade" - toVersion = ">= " + minimum.String() - case maximum.LessThan(v): - action = "downgrade" - toVersion = "<= " + maximum.String() - case len(excludes) > 0: - // Get the latest excluded version. - action = "upgrade" - toVersion = "> " + excludes[len(excludes)-1].String() - } - - switch { - case len(excludes) == 1: - excluding = fmt.Sprintf(", excluding version %s", excludes[0].String()) - case len(excludes) > 1: - var vs []string - for _, v := range excludes { - vs = append(vs, v.String()) - } - excluding = fmt.Sprintf(", excluding versions %s", strings.Join(vs, ", ")) - default: - excluding = "" - } - - summary := fmt.Sprintf("Incompatible TFE provider version v%s", v.String()) - details := fmt.Sprintf( - "The configured Terraform Enterprise backend is compatible with TFE provider\n"+ - "versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding, - ) - - if action != "" && toVersion != "" { - summary = fmt.Sprintf("Please %s the TFE provider to %s", action, toVersion) - } - - // Return the customized and informational error message. - return fmt.Errorf("%s\n\n%s", summary, details) -} - -func checkConstraintsWarning(err error) error { - return fmt.Errorf( - "failed to check version constraints: %v\n\n"+ - "checking version constraints is considered optional, but this is an\n"+ - "unexpected error which should be reported", - err, - ) -} diff --git a/internal/client/config.go b/internal/client/config.go deleted file mode 100644 index 855c949f5..000000000 --- a/internal/client/config.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package client - -import ( - "crypto/sha256" - "crypto/tls" - "fmt" - "log" - "net/http" - "os" - "strconv" - - tfe "github.com/hashicorp/go-tfe" - "github.com/hashicorp/hcl" - "github.com/hashicorp/terraform-provider-tfe/internal/logging" - providerVersion "github.com/hashicorp/terraform-provider-tfe/version" - svchost "github.com/hashicorp/terraform-svchost" - "github.com/hashicorp/terraform-svchost/auth" - "github.com/hashicorp/terraform-svchost/disco" -) - -var ( - // TFEUserAgent is the user agent string sent with all requests made by the provider - TFEUserAgent = fmt.Sprintf("terraform-provider-tfe/%s", providerVersion.ProviderVersion) -) - -type CredentialsMap map[string]map[string]interface{} - -// CLIHostConfig is the structure of the configuration for the Terraform CLI. -type CLIHostConfig struct { - Hosts map[string]*ConfigHost `hcl:"host"` - Credentials CredentialsMap `hcl:"credentials"` -} - -// ConfigHost is the structure of the "host" nested block within the CLI -// configuration, which can be used to override the default service host -// discovery behavior for a particular hostname. -type ConfigHost struct { - Services map[string]interface{} `hcl:"services"` -} - -// ClientConfiguration is the refined information needed to configure a tfe.Client -type ClientConfiguration struct { - Services *disco.Disco - HTTPClient *http.Client - TFEHost svchost.Hostname - Token string - Insecure bool -} - -// Key returns a string that is comparable to other ClientConfiguration values -func (c ClientConfiguration) Key() string { - return fmt.Sprintf("%x %s/%v", sha256.New().Sum([]byte(c.Token)), c.TFEHost, c.Insecure) -} - -// cliConfig tries to find and parse the configuration of the Terraform CLI. -// This is an optional step, so any errors are ignored. -func cliConfig() CLIHostConfig { - mainConfig := CLIHostConfig{} - credentialsConfig := CLIHostConfig{} - combinedConfig := CLIHostConfig{} - - // Main CLI config file; might contain manually-entered credentials, and/or - // some host service discovery objects. Location is configurable via - // environment variables. - configFilePath := locateConfigFile() - if configFilePath != "" { - mainConfig = readCliConfigFile(configFilePath) - } - - // Credentials file; might contain credentials auto-configured by terraform - // login. Location isn't configurable. - credentialsFilePath, err := credentialsFile() - if err != nil { - log.Printf("[ERROR] Error detecting default credentials file path: %s", err) - } else { - credentialsConfig = readCliConfigFile(credentialsFilePath) - } - - // Use host service discovery configs from main config file. - combinedConfig.Hosts = mainConfig.Hosts - - // Combine both sets of credentials. Per Terraform's own behavior, the main - // config file overrides the credentials file if they have any overlapping - // hostnames. - combinedConfig.Credentials = credentialsConfig.Credentials - if combinedConfig.Credentials == nil { - combinedConfig.Credentials = make(map[string]map[string]interface{}) - } - for host, creds := range mainConfig.Credentials { - combinedConfig.Credentials[host] = creds - } - - return combinedConfig -} - -func locateConfigFile() string { - // To find the main CLI config file, follow Terraform's own logic: try - // TF_CLI_CONFIG_FILE, then try TERRAFORM_CONFIG, then try the default - // location. - - if os.Getenv("TF_CLI_CONFIG_FILE") != "" { - return os.Getenv("TF_CLI_CONFIG_FILE") - } - - if os.Getenv("TERRAFORM_CONFIG") != "" { - return os.Getenv("TERRAFORM_CONFIG") - } - filePath, err := configFile() - if err != nil { - log.Printf("[ERROR] Error detecting default CLI config file path: %s", err) - return "" - } - - return filePath -} - -// All the errors returned by the helper methods called in this function get ignored (down the road we throw an error when all auth methods have failed.) We only use these errors to log warnings to the user. -func readCliConfigFile(configFilePath string) CLIHostConfig { - config := CLIHostConfig{} - - // Read the CLI config file content. - content, err := os.ReadFile(configFilePath) - if err != nil { - log.Printf("[WARN] Unable to read CLI config or credentials file %s: %v", configFilePath, err) - return config - } - - // Parse the CLI config file content. - obj, err := hcl.Parse(string(content)) - if err != nil { - log.Printf("[WARN] Unable to parse CLI config or credentials file %s: %v", configFilePath, err) - return config - } - - // Decode the CLI config file content. - if err := hcl.DecodeObject(&config, obj); err != nil { - log.Printf("[WARN] Unable to decode CLI config or credentials file %s: %v", configFilePath, err) - } - - return config -} - -func credentialsSource(credentials CredentialsMap) auth.CredentialsSource { - creds := auth.NoCredentials - - // Add all configured credentials to the credentials source. - if len(credentials) > 0 { - staticTable := map[svchost.Hostname]map[string]interface{}{} - for userHost, creds := range credentials { - host, err := svchost.ForComparison(userHost) - if err != nil { - // We expect the config was already validated by the time we get - // here, so we'll just ignore invalid hostnames. - continue - } - staticTable[host] = creds - } - creds = auth.StaticCredentialsSource(staticTable) - } - - return creds -} - -// configure accepts the provider-level configuration values and creates a -// clientConfiguration using fallback values from the environment or CLI configuration. -func configure(tfeHost, token string, insecure bool) (*ClientConfiguration, error) { - if tfeHost == "" { - if os.Getenv("TFE_HOSTNAME") != "" { - tfeHost = os.Getenv("TFE_HOSTNAME") - } else { - tfeHost = DefaultHostname - } - } - log.Printf("[DEBUG] Configuring client for host %q", tfeHost) - - // If ssl_skip_verify is false, it is either set that way in configuration or unset. Check - // the environment to see if it was set to true there. Strictly speaking, this means that - // the env var can override an explicit 'false' in configuration (which is not true of the - // other settings), but that's how it goes with a boolean zero value. - var err error - if !insecure && os.Getenv("TFE_SSL_SKIP_VERIFY") != "" { - v := os.Getenv("TFE_SSL_SKIP_VERIFY") - insecure, err = strconv.ParseBool(v) - if err != nil { - return nil, err - } - } - - // Configure the certificate verification options. - if insecure { - log.Printf("[DEBUG] Warning: Client configured to skip certificate verifications") - } - - // Parse the hostname for comparison, - hostname, err := svchost.ForComparison(tfeHost) - if err != nil { - return nil, err - } - - httpClient := tfe.DefaultConfig().HTTPClient - - // Make sure the transport has a TLS config. - transport := httpClient.Transport.(*http.Transport) - if transport.TLSClientConfig == nil { - transport.TLSClientConfig = &tls.Config{MinVersion: tls.VersionTLS12} - } - - transport.TLSClientConfig.InsecureSkipVerify = insecure - - // Get the Terraform CLI configuration. - config := cliConfig() - - // Create a new credential source and service discovery object. - credsSrc := credentialsSource(config.Credentials) - services := disco.NewWithCredentialsSource(credsSrc) - services.SetUserAgent(TFEUserAgent) - services.Transport = logging.NewLoggingTransport("TFE", transport) - - // Add any static host configurations service discovery object. - for userHost, hostConfig := range config.Hosts { - host, err := svchost.ForComparison(userHost) - if err != nil { - // ignore invalid hostnames. - continue - } - services.ForceHostServices(host, hostConfig.Services) - } - - // If a token wasn't set in the provider configuration block, try and fetch it - // from the environment or from Terraform's CLI configuration or configured credential helper. - if token == "" { - if os.Getenv("TFE_TOKEN") != "" { - token = getTokenFromEnv() - } else { - token = getTokenFromCreds(services, hostname) - } - } - - // If we still don't have a token at this point, we return an error. - if token == "" { - return nil, ErrMissingAuthToken - } - - return &ClientConfiguration{ - Services: services, - HTTPClient: httpClient, - TFEHost: hostname, - Token: token, - Insecure: insecure, - }, nil -} diff --git a/internal/client/config_test.go b/internal/client/config_test.go deleted file mode 100644 index e985bd2c7..000000000 --- a/internal/client/config_test.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package client - -import ( - "os" - "testing" -) - -func TestConfig_locateConfigFile(t *testing.T) { - originalHome := os.Getenv("HOME") - originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") - originalTerraformConfig := os.Getenv("TERRAFORM_CONFIG") - reset := func() { - os.Setenv("HOME", originalHome) - if originalTfCliConfigFile != "" { - os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) - } else { - os.Unsetenv("TF_CLI_CONFIG_FILE") - } - if originalTerraformConfig != "" { - os.Setenv("TERRAFORM_CONFIG", originalTerraformConfig) - } else { - os.Unsetenv("TERRAFORM_CONFIG") - } - } - defer reset() - - // Use a predictable value for $HOME - os.Setenv("HOME", "/Users/someone") - - setup := func(tfCliConfigFile, terraformConfig string) { - os.Setenv("TF_CLI_CONFIG_FILE", tfCliConfigFile) - os.Setenv("TERRAFORM_CONFIG", terraformConfig) - } - - cases := map[string]struct { - tfCliConfigFile string - terraformConfig string - result string - }{ - "has TF_CLI_CONFIG_FILE": { - tfCliConfigFile: "~/.terraform_alternate/terraformrc", - terraformConfig: "", - result: "~/.terraform_alternate/terraformrc", - }, - "has TERRAFORM_CONFIG": { - tfCliConfigFile: "", - terraformConfig: "~/.terraform_alternate_rc", - result: "~/.terraform_alternate_rc", - }, - "has both env vars": { - tfCliConfigFile: "~/.from_TF_CLI", - terraformConfig: "~/.from_TERRAFORM_CONFIG", - result: "~/.from_TF_CLI", - }, - "has neither env var": { - tfCliConfigFile: "", - terraformConfig: "", - result: "/Users/someone/.terraformrc", // expect tests run on unix - }, - } - - for name, tc := range cases { - setup(tc.tfCliConfigFile, tc.terraformConfig) - - fileResult := locateConfigFile() - if tc.result != fileResult { - t.Fatalf("%s: expected config file at %s, got %s", name, tc.result, fileResult) - } - } -} - -func TestConfig_cliConfig(t *testing.T) { - // This only tests the behavior of merging various combinations of - // (credentials file, .terraformrc file, absent). Locating the .terraformrc - // file is tested separately. - originalHome := os.Getenv("HOME") - originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") - reset := func() { - os.Setenv("HOME", originalHome) - if originalTfCliConfigFile != "" { - os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) - } else { - os.Unsetenv("TF_CLI_CONFIG_FILE") - } - } - defer reset() - - // Summary of fixtures: the credentials file and terraformrc file each have - // credentials for two hosts, they both have credentials for app.terraform.io, - // and the terraformrc also has one service discovery override. - hasCredentials := "test-fixtures/cli-config-files/home" - noCredentials := "test-fixtures/cli-config-files/no-credentials" - terraformrc := "test-fixtures/cli-config-files/terraformrc" - noTerraformrc := "test-fixtures/cli-config-files/no-terraformrc" - tokenFromTerraformrc := "something.atlasv1.prod_rc_file" - tokenFromCredentials := "something.atlasv1.prod_credentials_file" - - cases := map[string]struct { - home string - rcfile string - expectCount int - expectProdToken string - expectHostsCount int - }{ - "both main config and credentials JSON": { - home: hasCredentials, - rcfile: terraformrc, - expectCount: 3, - expectProdToken: tokenFromTerraformrc, - expectHostsCount: 1, - }, - "only main config": { - home: noCredentials, - rcfile: terraformrc, - expectCount: 2, - expectProdToken: tokenFromTerraformrc, - expectHostsCount: 1, - }, - "only credentials JSON": { - home: hasCredentials, - rcfile: noTerraformrc, - expectCount: 2, - expectProdToken: tokenFromCredentials, - expectHostsCount: 0, - }, - "neither file": { - home: noCredentials, - rcfile: noTerraformrc, - expectCount: 0, - expectProdToken: "", - expectHostsCount: 0, - }, - } - - for name, tc := range cases { - os.Setenv("HOME", tc.home) - os.Setenv("TF_CLI_CONFIG_FILE", tc.rcfile) - config := cliConfig() - credentialsCount := len(config.Credentials) - if credentialsCount != tc.expectCount { - t.Fatalf("%s: expected %d credentials, got %d", name, tc.expectCount, credentialsCount) - } - prodToken := "" - if config.Credentials["app.terraform.io"] != nil { - prodToken = config.Credentials["app.terraform.io"]["token"].(string) - } - if prodToken != tc.expectProdToken { - t.Fatalf("%s: expected %s as prod token, got %s", name, tc.expectProdToken, prodToken) - } - hostsCount := len(config.Hosts) - if hostsCount != tc.expectHostsCount { - t.Fatalf("%s: expected %d `host` blocks in the final config, got %d", name, tc.expectHostsCount, hostsCount) - } - } -} diff --git a/internal/client/init.go b/internal/client/init.go deleted file mode 100644 index dfb1392d1..000000000 --- a/internal/client/init.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package client - -import ( - "sync" - - tfe "github.com/hashicorp/go-tfe" -) - -var clientCache *ClientConfigMap - -func init() { - clientCache = &ClientConfigMap{ - values: make(map[string]*tfe.Client), - mu: sync.Mutex{}, - } -} diff --git a/internal/client/config_unix.go b/internal/provider/config_unix.go similarity index 98% rename from internal/client/config_unix.go rename to internal/provider/config_unix.go index 9f8cef07f..a2e7e55bb 100644 --- a/internal/client/config_unix.go +++ b/internal/provider/config_unix.go @@ -4,7 +4,7 @@ //go:build !windows // +build !windows -package client +package provider import ( "errors" diff --git a/internal/client/config_windows.go b/internal/provider/config_windows.go similarity index 98% rename from internal/client/config_windows.go rename to internal/provider/config_windows.go index 6ba3e0815..61f40d71f 100644 --- a/internal/client/config_windows.go +++ b/internal/provider/config_windows.go @@ -4,7 +4,7 @@ //go:build windows // +build windows -package client +package provider import ( "path/filepath" diff --git a/internal/logging/logging.go b/internal/provider/logging.go similarity index 99% rename from internal/logging/logging.go rename to internal/provider/logging.go index 07c23ffa2..44b404495 100644 --- a/internal/logging/logging.go +++ b/internal/provider/logging.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package logging +package provider import ( "bytes" diff --git a/internal/provider/plugin_provider.go b/internal/provider/plugin_provider.go index c51141ba3..375609e72 100644 --- a/internal/provider/plugin_provider.go +++ b/internal/provider/plugin_provider.go @@ -11,7 +11,6 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tftypes" - "github.com/hashicorp/terraform-provider-tfe/internal/client" ) type pluginProviderServer struct { @@ -76,7 +75,7 @@ func (p *pluginProviderServer) ConfigureProvider(ctx context.Context, req *tfpro return resp, nil } - client, err := client.GetClient(meta.hostname, meta.token, meta.sslSkipVerify) + client, err := getClient(meta.hostname, meta.token, meta.sslSkipVerify) if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 9e70955c8..656155347 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -5,21 +5,50 @@ package provider import ( "context" + "crypto/tls" "errors" + "fmt" + "log" + "net/http" + "net/url" "os" + "sort" + "strconv" + "strings" tfe "github.com/hashicorp/go-tfe" + version "github.com/hashicorp/go-version" + "github.com/hashicorp/hcl" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-tfe/internal/client" + providerVersion "github.com/hashicorp/terraform-provider-tfe/version" + svchost "github.com/hashicorp/terraform-svchost" + "github.com/hashicorp/terraform-svchost/auth" + "github.com/hashicorp/terraform-svchost/disco" ) +const defaultHostname = "app.terraform.io" const defaultSSLSkipVerify = false var ( + tfeServiceIDs = []string{"tfe.v2.2"} + errMissingAuthToken = errors.New("required token could not be found. Please set the token using an input variable in the provider configuration block or by using the TFE_TOKEN environment variable") errMissingOrganization = errors.New("no organization was specified on the resource or provider") ) +// Config is the structure of the configuration for the Terraform CLI. +type Config struct { + Hosts map[string]*ConfigHost `hcl:"host"` + Credentials map[string]map[string]interface{} `hcl:"credentials"` +} + +// ConfigHost is the structure of the "host" nested block within the CLI +// configuration, which can be used to override the default service host +// discovery behavior for a particular hostname. +type ConfigHost struct { + Services map[string]interface{} `hcl:"services"` +} + // ConfiguredClient wraps the tfe.Client the provider uses, plus the default // organization name to be used by resources that need an organization but don't // specify one. @@ -173,7 +202,386 @@ func configureClient(d *schema.ResourceData) (*tfe.Client, error) { token := d.Get("token").(string) insecure := d.Get("ssl_skip_verify").(bool) - return client.GetClient(hostname, token, insecure) + return getClient(hostname, token, insecure) +} + +func getTokenFromEnv() string { + log.Printf("[DEBUG] TFE_TOKEN used for token value") + return os.Getenv("TFE_TOKEN") +} + +func getTokenFromCreds(services *disco.Disco, hostname svchost.Hostname) string { + log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %s...", hostname) + creds, err := services.CredentialsForHost(hostname) + if err != nil { + log.Printf("[DEBUG] Failed to get credentials for %s: %s (ignoring)", hostname, err) + } + if creds != nil { + return creds.Token() + } + return "" +} + +// getClient encapsulates the logic for configuring a go-tfe client instance for +// the provider, including fallback to values from environment variables. This +// is useful because we're muxing multiple provider servers together and each +// one needs an identically configured client. +func getClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { + h := tfeHost + if tfeHost == "" { + if os.Getenv("TFE_HOSTNAME") != "" { + h = os.Getenv("TFE_HOSTNAME") + } else { + h = defaultHostname + } + } + + log.Printf("[DEBUG] Configuring client for host %q", h) + + // Parse the hostname for comparison, + hostname, err := svchost.ForComparison(h) + if err != nil { + return nil, err + } + + providerUaString := fmt.Sprintf("terraform-provider-tfe/%s", providerVersion.ProviderVersion) + + httpClient := tfe.DefaultConfig().HTTPClient + + // Make sure the transport has a TLS config. + transport := httpClient.Transport.(*http.Transport) + if transport.TLSClientConfig == nil { + transport.TLSClientConfig = &tls.Config{MinVersion: tls.VersionTLS12} + } + + // If ssl_skip_verify is false, it is either set that way in configuration or unset. Check + // the environment to see if it was set to true there. Strictly speaking, this means that + // the env var can override an explicit 'false' in configuration (which is not true of the + // other settings), but that's how it goes with a boolean zero value. + if !insecure && os.Getenv("TFE_SSL_SKIP_VERIFY") != "" { + v := os.Getenv("TFE_SSL_SKIP_VERIFY") + insecure, err = strconv.ParseBool(v) + if err != nil { + return nil, err + } + } + + // Configure the certificate verification options. + if insecure { + log.Printf("[DEBUG] Warning: Client configured to skip certificate verifications") + } + transport.TLSClientConfig.InsecureSkipVerify = insecure + + // Get the Terraform CLI configuration. + config := cliConfig() + + // Create a new credential source and service discovery object. + credsSrc := credentialsSource(config) + services := disco.NewWithCredentialsSource(credsSrc) + services.SetUserAgent(providerUaString) + services.Transport = NewLoggingTransport("TFE Discovery", transport) + + // Add any static host configurations service discovery object. + for userHost, hostConfig := range config.Hosts { + host, err := svchost.ForComparison(userHost) + if err != nil { + // ignore invalid hostnames. + continue + } + services.ForceHostServices(host, hostConfig.Services) + } + + // Discover the Terraform Enterprise address. + host, err := services.Discover(hostname) + if err != nil { + return nil, err + } + + // Get the full Terraform Enterprise service address. + var address *url.URL + var discoErr error + for _, tfeServiceID := range tfeServiceIDs { + service, err := host.ServiceURL(tfeServiceID) + if _, ok := err.(*disco.ErrVersionNotSupported); !ok && err != nil { + return nil, err + } + // If discoErr is nil we save the first error. When multiple services + // are checked and we found one that didn't give an error we need to + // reset the discoErr. So if err is nil, we assign it as well. + if discoErr == nil || err == nil { + discoErr = err + } + if service != nil { + address = service + break + } + } + + if providerVersion.ProviderVersion != "dev" { + // We purposefully ignore the error and return the previous error, as + // checking for version constraints is considered optional. + constraints, _ := host.VersionConstraints(tfeServiceIDs[0], "tfe-provider") + + // First check any constraints we might have received. + if constraints != nil { + if err := checkConstraints(constraints); err != nil { + return nil, err + } + } + } + + // When we don't have any constraints errors, also check for discovery + // errors before we continue. + if discoErr != nil { + return nil, discoErr + } + + // If a token wasn't set in the provider configuration block, try and fetch it + // from the environment or from Terraform's CLI configuration or configured credential helper. + if token == "" { + if os.Getenv("TFE_TOKEN") != "" { + token = getTokenFromEnv() + } else { + token = getTokenFromCreds(services, hostname) + } + } + + // If we still don't have a token at this point, we return an error. + if token == "" { + return nil, errMissingAuthToken + } + + // Wrap the configured transport to enable logging. + httpClient.Transport = NewLoggingTransport("TFE", transport) + + // Create a new TFE client config + cfg := &tfe.Config{ + Address: address.String(), + Token: token, + HTTPClient: httpClient, + } + + // Create a new TFE client. + client, err := tfe.NewClient(cfg) + if err != nil { + return nil, err + } + + client.RetryServerErrors(true) + return client, nil +} + +// cliConfig tries to find and parse the configuration of the Terraform CLI. +// This is an optional step, so any errors are ignored. +func cliConfig() Config { + mainConfig := Config{} + credentialsConfig := Config{} + combinedConfig := Config{} + + // Main CLI config file; might contain manually-entered credentials, and/or + // some host service discovery objects. Location is configurable via + // environment variables. + configFilePath := locateConfigFile() + if configFilePath != "" { + mainConfig = readCliConfigFile(configFilePath) + } + + // Credentials file; might contain credentials auto-configured by terraform + // login. Location isn't configurable. + credentialsFilePath, err := credentialsFile() + if err != nil { + log.Printf("[ERROR] Error detecting default credentials file path: %s", err) + } else { + credentialsConfig = readCliConfigFile(credentialsFilePath) + } + + // Use host service discovery configs from main config file. + combinedConfig.Hosts = mainConfig.Hosts + + // Combine both sets of credentials. Per Terraform's own behavior, the main + // config file overrides the credentials file if they have any overlapping + // hostnames. + combinedConfig.Credentials = credentialsConfig.Credentials + if combinedConfig.Credentials == nil { + combinedConfig.Credentials = make(map[string]map[string]interface{}) + } + for host, creds := range mainConfig.Credentials { + combinedConfig.Credentials[host] = creds + } + + return combinedConfig +} + +func locateConfigFile() string { + // To find the main CLI config file, follow Terraform's own logic: try + // TF_CLI_CONFIG_FILE, then try TERRAFORM_CONFIG, then try the default + // location. + + if os.Getenv("TF_CLI_CONFIG_FILE") != "" { + return os.Getenv("TF_CLI_CONFIG_FILE") + } + + if os.Getenv("TERRAFORM_CONFIG") != "" { + return os.Getenv("TERRAFORM_CONFIG") + } + filePath, err := configFile() + if err != nil { + log.Printf("[ERROR] Error detecting default CLI config file path: %s", err) + return "" + } + + return filePath +} + +func readCliConfigFile(configFilePath string) Config { + config := Config{} + + // Read the CLI config file content. + content, err := os.ReadFile(configFilePath) + if err != nil { + log.Printf("[ERROR] Error reading CLI config or credentials file %s: %v", configFilePath, err) + return config + } + + // Parse the CLI config file content. + obj, err := hcl.Parse(string(content)) + if err != nil { + log.Printf("[ERROR] Error parsing CLI config or credentials file %s: %v", configFilePath, err) + return config + } + + // Decode the CLI config file content. + if err := hcl.DecodeObject(&config, obj); err != nil { + log.Printf("[ERROR] Error decoding CLI config or credentials file %s: %v", configFilePath, err) + } + + return config +} + +func credentialsSource(config Config) auth.CredentialsSource { + creds := auth.NoCredentials + + // Add all configured credentials to the credentials source. + if len(config.Credentials) > 0 { + staticTable := map[svchost.Hostname]map[string]interface{}{} + for userHost, creds := range config.Credentials { + host, err := svchost.ForComparison(userHost) + if err != nil { + // We expect the config was already validated by the time we get + // here, so we'll just ignore invalid hostnames. + continue + } + staticTable[host] = creds + } + creds = auth.StaticCredentialsSource(staticTable) + } + + return creds +} + +// checkConstraints checks service version constrains against our own +// version and returns rich and informational diagnostics in case any +// incompatibilities are detected. +func checkConstraints(c *disco.Constraints) error { + if c == nil || c.Minimum == "" || c.Maximum == "" { + return nil + } + + // Generate a parsable constraints string. + excluding := "" + if len(c.Excluding) > 0 { + excluding = fmt.Sprintf(", != %s", strings.Join(c.Excluding, ", != ")) + } + constStr := fmt.Sprintf(">= %s%s, <= %s", c.Minimum, excluding, c.Maximum) + + // Create the constraints to check against. + constraints, err := version.NewConstraint(constStr) + if err != nil { + return checkConstraintsWarning(err) + } + + // Create the version to check. + v, err := version.NewVersion(providerVersion.ProviderVersion) + if err != nil { + return checkConstraintsWarning(err) + } + + // Return if we satisfy all constraints. + if constraints.Check(v) { + return nil + } + + // Find out what action (upgrade/downgrade) we should advice. + minimum, err := version.NewVersion(c.Minimum) + if err != nil { + return checkConstraintsWarning(err) + } + + maximum, err := version.NewVersion(c.Maximum) + if err != nil { + return checkConstraintsWarning(err) + } + + var excludes []*version.Version + for _, exclude := range c.Excluding { + v, err := version.NewVersion(exclude) + if err != nil { + return checkConstraintsWarning(err) + } + excludes = append(excludes, v) + } + + // Sort all the excludes. + sort.Sort(version.Collection(excludes)) + + var action, toVersion string + switch { + case minimum.GreaterThan(v): + action = "upgrade" + toVersion = ">= " + minimum.String() + case maximum.LessThan(v): + action = "downgrade" + toVersion = "<= " + maximum.String() + case len(excludes) > 0: + // Get the latest excluded version. + action = "upgrade" + toVersion = "> " + excludes[len(excludes)-1].String() + } + + switch { + case len(excludes) == 1: + excluding = fmt.Sprintf(", excluding version %s", excludes[0].String()) + case len(excludes) > 1: + var vs []string + for _, v := range excludes { + vs = append(vs, v.String()) + } + excluding = fmt.Sprintf(", excluding versions %s", strings.Join(vs, ", ")) + default: + excluding = "" + } + + summary := fmt.Sprintf("Incompatible TFE provider version v%s", v.String()) + details := fmt.Sprintf( + "The configured Terraform Enterprise backend is compatible with TFE provider\n"+ + "versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding, + ) + + if action != "" && toVersion != "" { + summary = fmt.Sprintf("Please %s the TFE provider to %s", action, toVersion) + } + + // Return the customized and informational error message. + return fmt.Errorf("%s\n\n%s", summary, details) +} + +func checkConstraintsWarning(err error) error { + return fmt.Errorf( + "failed to check version constraints: %v\n\n"+ + "checking version constraints is considered optional, but this is an\n"+ + "unexpected error which should be reported", + err, + ) } var descriptions = map[string]string{ diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 6e42e3b22..4da56ff15 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-provider-tfe/internal/client" ) // frameworkProvider is a type that implements the terraform-plugin-framework @@ -95,7 +94,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur data.Organization = types.StringValue(os.Getenv("TFE_ORGANIZATION")) } - client, err := client.GetClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) + client, err := getClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) if err != nil { res.Diagnostics.AddError("Failed to initialize HTTP client", err.Error()) diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index f1e2af621..93e0444de 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -19,7 +19,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-tfe/internal/client" "github.com/hashicorp/terraform-provider-tfe/version" "github.com/hashicorp/terraform-svchost/disco" ) @@ -84,13 +83,13 @@ func setupDefaultOrganization(t *testing.T) (string, int) { } func getClientUsingEnv() (*tfe.Client, error) { - hostname := client.DefaultHostname + hostname := defaultHostname if os.Getenv("TFE_HOSTNAME") != "" { hostname = os.Getenv("TFE_HOSTNAME") } token := os.Getenv("TFE_TOKEN") - client, err := client.GetClient(hostname, token, defaultSSLSkipVerify) + client, err := getClient(hostname, token, defaultSSLSkipVerify) if err != nil { return nil, fmt.Errorf("Error getting client: %w", err) } @@ -154,7 +153,7 @@ func TestProvider_versionConstraints(t *testing.T) { // Set the version for this test. version.ProviderVersion = tc.version - err := client.CheckConstraints(tc.constraints) + err := checkConstraints(tc.constraints) if err == nil && tc.result != "" { t.Fatalf("%s: expected error to contain %q, but got no error", name, tc.result) } @@ -167,6 +166,155 @@ func TestProvider_versionConstraints(t *testing.T) { } } +func TestProvider_locateConfigFile(t *testing.T) { + originalHome := os.Getenv("HOME") + originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") + originalTerraformConfig := os.Getenv("TERRAFORM_CONFIG") + reset := func() { + os.Setenv("HOME", originalHome) + if originalTfCliConfigFile != "" { + os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) + } else { + os.Unsetenv("TF_CLI_CONFIG_FILE") + } + if originalTerraformConfig != "" { + os.Setenv("TERRAFORM_CONFIG", originalTerraformConfig) + } else { + os.Unsetenv("TERRAFORM_CONFIG") + } + } + defer reset() + + // Use a predictable value for $HOME + os.Setenv("HOME", "/Users/someone") + + setup := func(tfCliConfigFile, terraformConfig string) { + os.Setenv("TF_CLI_CONFIG_FILE", tfCliConfigFile) + os.Setenv("TERRAFORM_CONFIG", terraformConfig) + } + + cases := map[string]struct { + tfCliConfigFile string + terraformConfig string + result string + }{ + "has TF_CLI_CONFIG_FILE": { + tfCliConfigFile: "~/.terraform_alternate/terraformrc", + terraformConfig: "", + result: "~/.terraform_alternate/terraformrc", + }, + "has TERRAFORM_CONFIG": { + tfCliConfigFile: "", + terraformConfig: "~/.terraform_alternate_rc", + result: "~/.terraform_alternate_rc", + }, + "has both env vars": { + tfCliConfigFile: "~/.from_TF_CLI", + terraformConfig: "~/.from_TERRAFORM_CONFIG", + result: "~/.from_TF_CLI", + }, + "has neither env var": { + tfCliConfigFile: "", + terraformConfig: "", + result: "/Users/someone/.terraformrc", // expect tests run on unix + }, + } + + for name, tc := range cases { + setup(tc.tfCliConfigFile, tc.terraformConfig) + + fileResult := locateConfigFile() + if tc.result != fileResult { + t.Fatalf("%s: expected config file at %s, got %s", name, tc.result, fileResult) + } + } +} + +func TestProvider_cliConfig(t *testing.T) { + // This only tests the behavior of merging various combinations of + // (credentials file, .terraformrc file, absent). Locating the .terraformrc + // file is tested separately. + originalHome := os.Getenv("HOME") + originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") + reset := func() { + os.Setenv("HOME", originalHome) + if originalTfCliConfigFile != "" { + os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) + } else { + os.Unsetenv("TF_CLI_CONFIG_FILE") + } + } + defer reset() + + // Summary of fixtures: the credentials file and terraformrc file each have + // credentials for two hosts, they both have credentials for app.terraform.io, + // and the terraformrc also has one service discovery override. + hasCredentials := "test-fixtures/cli-config-files/home" + noCredentials := "test-fixtures/cli-config-files/no-credentials" + terraformrc := "test-fixtures/cli-config-files/terraformrc" + noTerraformrc := "test-fixtures/cli-config-files/no-terraformrc" + tokenFromTerraformrc := "something.atlasv1.prod_rc_file" + tokenFromCredentials := "something.atlasv1.prod_credentials_file" + + cases := map[string]struct { + home string + rcfile string + expectCount int + expectProdToken string + expectHostsCount int + }{ + "both main config and credentials JSON": { + home: hasCredentials, + rcfile: terraformrc, + expectCount: 3, + expectProdToken: tokenFromTerraformrc, + expectHostsCount: 1, + }, + "only main config": { + home: noCredentials, + rcfile: terraformrc, + expectCount: 2, + expectProdToken: tokenFromTerraformrc, + expectHostsCount: 1, + }, + "only credentials JSON": { + home: hasCredentials, + rcfile: noTerraformrc, + expectCount: 2, + expectProdToken: tokenFromCredentials, + expectHostsCount: 0, + }, + "neither file": { + home: noCredentials, + rcfile: noTerraformrc, + expectCount: 0, + expectProdToken: "", + expectHostsCount: 0, + }, + } + + for name, tc := range cases { + os.Setenv("HOME", tc.home) + os.Setenv("TF_CLI_CONFIG_FILE", tc.rcfile) + config := cliConfig() + credentialsCount := len(config.Credentials) + if credentialsCount != tc.expectCount { + t.Fatalf("%s: expected %d credentials, got %d", name, tc.expectCount, credentialsCount) + } + prodToken := "" + if config.Credentials["app.terraform.io"] != nil { + prodToken = config.Credentials["app.terraform.io"]["token"].(string) + } + if prodToken != tc.expectProdToken { + t.Fatalf("%s: expected %s as prod token, got %s", name, tc.expectProdToken, prodToken) + } + hostsCount := len(config.Hosts) + if hostsCount != tc.expectHostsCount { + t.Fatalf("%s: expected %d `host` blocks in the final config, got %d", name, tc.expectHostsCount, hostsCount) + } + } +} + func testAccPreCheck(t *testing.T) { // The credentials must be provided by the CLI config file for testing. if diags := Provider().Configure(context.Background(), &terraform.ResourceConfig{}); diags.HasError() { From 006b4e30031ff99f8c5b06667bd27201b5481f3a Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 17:27:24 -0600 Subject: [PATCH 038/420] Update CHANGELOG and bump release versions --- CHANGELOG.md | 5 +++++ README.md | 2 +- website/docs/index.html.markdown | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 212cd3a02..6273c5d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.49.1 (October 2, 2023) + +BUG FIXES: +* Reverts previous bug fix for provider making two service discovery requests per provider config. This was an internal refactor that broke some token configuration, by @brandonc [1085](https://github.com/hashicorp/terraform-provider-tfe/pull/1085)" + ## v0.49.0 (October 2, 2023) BUG FIXES: diff --git a/README.md b/README.md index 9190b7629..e981ced19 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.49.0" + version = "~> 0.49.1" } } } diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 05777efd7..bf86b92f5 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.0" + version = "~> 0.49.1" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.49.0" + version = "~> 0.49.1" ... } ``` From 492fc752e5b11eaee9c5b1e9ec043fe5ac523a3c Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 17:58:56 -0600 Subject: [PATCH 039/420] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6273c5d8d..30179c354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## v0.49.1 (October 2, 2023) BUG FIXES: -* Reverts previous bug fix for provider making two service discovery requests per provider config. This was an internal refactor that broke some token configuration, by @brandonc [1085](https://github.com/hashicorp/terraform-provider-tfe/pull/1085)" +* Reverts previous bug fix for provider making two service discovery requests per provider config. This was an internal refactor that broke provider token configuration, by @brandonc [1085](https://github.com/hashicorp/terraform-provider-tfe/pull/1085) ## v0.49.0 (October 2, 2023) From 7bb844a7ec4ebac857e46994fe7b6abe9721fd6d Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Fri, 22 Sep 2023 11:25:20 -0400 Subject: [PATCH 040/420] added to resource and data source --- internal/provider/data_source_variable_set.go | 6 + .../provider/data_source_variable_set_test.go | 112 +++++++-------- .../provider/resource_tfe_variable_set.go | 13 +- .../resource_tfe_variable_set_test.go | 131 ++++++++++-------- website/docs/d/variable_set.html.markdown | 3 +- website/docs/r/variable_set.html.markdown | 35 ++++- 6 files changed, 185 insertions(+), 115 deletions(-) diff --git a/internal/provider/data_source_variable_set.go b/internal/provider/data_source_variable_set.go index 90b692c4c..0ae079de5 100644 --- a/internal/provider/data_source_variable_set.go +++ b/internal/provider/data_source_variable_set.go @@ -35,6 +35,11 @@ func dataSourceTFEVariableSet() *schema.Resource { Computed: true, }, + "enforced": { + Type: schema.TypeBool, + Computed: true, + }, + "workspace_ids": { Type: schema.TypeSet, Optional: true, @@ -88,6 +93,7 @@ func dataSourceTFEVariableSetRead(d *schema.ResourceData, meta interface{}) erro d.Set("name", vs.Name) d.Set("description", vs.Description) d.Set("global", vs.Global) + d.Set("enforced", vs.Enforced) // Only now include vars and workspaces to cut down on request load. readOptions := tfe.VariableSetReadOptions{ diff --git a/internal/provider/data_source_variable_set_test.go b/internal/provider/data_source_variable_set_test.go index 5d2a4236b..283403dfa 100644 --- a/internal/provider/data_source_variable_set_test.go +++ b/internal/provider/data_source_variable_set_test.go @@ -30,6 +30,8 @@ func TestAccTFEVariableSetsDataSource_basic(t *testing.T) { "data.tfe_variable_set.foobar", "description", "a description"), resource.TestCheckResourceAttr( "data.tfe_variable_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "data.tfe_variable_set.foobar", "enforced", "false"), resource.TestCheckResourceAttr( "data.tfe_variable_set.foobar", "organization", orgName), ), @@ -67,62 +69,64 @@ func TestAccTFEVariableSetsDataSource_full(t *testing.T) { func testAccTFEVariableSetsDataSourceConfig_basic(rInt int) string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "org-%d" - email = "admin@company.com" -} - -resource "tfe_variable_set" "foobar" { - name = "varset-foo-%d" - description = "a description" - organization = tfe_organization.foobar.id -} - -data "tfe_variable_set" "foobar" { - name = tfe_variable_set.foobar.name - organization = tfe_variable_set.foobar.organization -}`, rInt, rInt) + resource "tfe_organization" "foobar" { + name = "org-%d" + email = "admin@company.com" + } + + resource "tfe_variable_set" "foobar" { + name = "varset-foo-%d" + description = "a description" + global = false + enforced = false + organization = tfe_organization.foobar.id + } + + data "tfe_variable_set" "foobar" { + name = tfe_variable_set.foobar.name + organization = tfe_variable_set.foobar.organization + }`, rInt, rInt) } func testAccTFEVariableSetsDataSourceConfig_full(rInt int) string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "org-%d" - email = "admin@company.com" -} - -resource "tfe_workspace" "foobar" { - name = "workspace-foo-%d" - organization = tfe_organization.foobar.id -} - -resource "tfe_project" "foobar" { - name = "project-foo-%d" - organization = tfe_organization.foobar.id -} - -resource "tfe_variable_set" "foobar" { - name = "varset-foo-%d" - description = "a description" - organization = tfe_organization.foobar.id - workspace_ids = [tfe_workspace.foobar.id] -} - -resource "tfe_project_variable_set" "foobar" { - variable_set_id = tfe_variable_set.foobar.id - project_id = tfe_project.foobar.id -} - -resource "tfe_variable" "envfoo" { - key = "vfoo" - value = "bar" - category = "env" - variable_set_id = tfe_variable_set.foobar.id -} - -data "tfe_variable_set" "foobar" { - name = tfe_variable_set.foobar.name - organization = tfe_variable_set.foobar.organization - depends_on = [tfe_variable.envfoo] -}`, rInt, rInt, rInt, rInt) + resource "tfe_organization" "foobar" { + name = "org-%d" + email = "admin@company.com" + } + + resource "tfe_workspace" "foobar" { + name = "workspace-foo-%d" + organization = tfe_organization.foobar.id + } + + resource "tfe_project" "foobar" { + name = "project-foo-%d" + organization = tfe_organization.foobar.id + } + + resource "tfe_variable_set" "foobar" { + name = "varset-foo-%d" + description = "a description" + organization = tfe_organization.foobar.id + workspace_ids = [tfe_workspace.foobar.id] + } + + resource "tfe_project_variable_set" "foobar" { + variable_set_id = tfe_variable_set.foobar.id + project_id = tfe_project.foobar.id + } + + resource "tfe_variable" "envfoo" { + key = "vfoo" + value = "bar" + category = "env" + variable_set_id = tfe_variable_set.foobar.id + } + + data "tfe_variable_set" "foobar" { + name = tfe_variable_set.foobar.name + organization = tfe_variable_set.foobar.organization + depends_on = [tfe_variable.envfoo] + }`, rInt, rInt, rInt, rInt) } diff --git a/internal/provider/resource_tfe_variable_set.go b/internal/provider/resource_tfe_variable_set.go index 387052f1f..f561022f4 100644 --- a/internal/provider/resource_tfe_variable_set.go +++ b/internal/provider/resource_tfe_variable_set.go @@ -42,6 +42,12 @@ func resourceTFEVariableSet() *schema.Resource { ConflictsWith: []string{"workspace_ids"}, }, + "enforced": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "organization": { Type: schema.TypeString, Optional: true, @@ -71,8 +77,9 @@ func resourceTFEVariableSetCreate(d *schema.ResourceData, meta interface{}) erro // Create a new options struct. options := tfe.VariableSetCreateOptions{ - Name: tfe.String(name), - Global: tfe.Bool(d.Get("global").(bool)), + Name: tfe.String(name), + Global: tfe.Bool(d.Get("global").(bool)), + Enforced: tfe.Bool(d.Get("enforced").(bool)), } if description, descriptionSet := d.GetOk("description"); descriptionSet { @@ -128,6 +135,7 @@ func resourceTFEVariableSetRead(d *schema.ResourceData, meta interface{}) error d.Set("name", variableSet.Name) d.Set("description", variableSet.Description) d.Set("global", variableSet.Global) + d.Set("enforced", variableSet.Enforced) d.Set("organization", variableSet.Organization.Name) var wids []interface{} @@ -147,6 +155,7 @@ func resourceTFEVariableSetUpdate(d *schema.ResourceData, meta interface{}) erro Name: tfe.String(d.Get("name").(string)), Description: tfe.String(d.Get("description").(string)), Global: tfe.Bool(d.Get("global").(bool)), + Enforced: tfe.Bool(d.Get("enforced").(bool)), } log.Printf("[DEBUG] Update variable set: %s", d.Id()) diff --git a/internal/provider/resource_tfe_variable_set_test.go b/internal/provider/resource_tfe_variable_set_test.go index 002882ac5..059a09417 100644 --- a/internal/provider/resource_tfe_variable_set_test.go +++ b/internal/provider/resource_tfe_variable_set_test.go @@ -35,6 +35,8 @@ func TestAccTFEVariableSet_basic(t *testing.T) { "tfe_variable_set.foobar", "description", "a test variable set"), resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "tfe_variable_set.foobar", "enforced", "false"), ), }, }, @@ -62,6 +64,8 @@ func TestAccTFEVariableSet_full(t *testing.T) { "tfe_variable_set.foobar", "description", "a test variable set"), resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "tfe_variable_set.foobar", "enforced", "false"), testAccCheckTFEVariableSetExists( "tfe_variable_set.applied", variableSet), testAccCheckTFEVariableSetApplication(variableSet), @@ -92,6 +96,8 @@ func TestAccTFEVariableSet_update(t *testing.T) { "tfe_variable_set.foobar", "description", "a test variable set"), resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "tfe_variable_set.foobar", "enforced", "false"), testAccCheckTFEVariableSetApplicationUpdate(variableSet), ), }, @@ -108,6 +114,8 @@ func TestAccTFEVariableSet_update(t *testing.T) { "tfe_variable_set.foobar", "description", "another description"), resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "true"), + resource.TestCheckResourceAttr( + "tfe_variable_set.foobar", "enforced", "true"), ), }, }, @@ -177,6 +185,9 @@ func testAccCheckTFEVariableSetAttributes( if variableSet.Global != false { return fmt.Errorf("Bad global: %t", variableSet.Global) } + if variableSet.Enforced != false { + return fmt.Errorf("Bad enforced: %t", variableSet.Enforced) + } return nil } @@ -194,6 +205,9 @@ func testAccCheckTFEVariableSetAttributesUpdate( if variableSet.Global != true { return fmt.Errorf("Bad global: %t", variableSet.Global) } + if variableSet.Enforced != true { + return fmt.Errorf("Bad enforced: %t", variableSet.Enforced) + } return nil } @@ -242,69 +256,72 @@ func testAccCheckTFEVariableSetDestroy(s *terraform.State) error { func testAccTFEVariableSet_basic(rInt int) string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" -} - -resource "tfe_variable_set" "foobar" { - name = "variable_set_test" - description = "a test variable set" - global = false - organization = tfe_organization.foobar.id -}`, rInt) + resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" + } + + resource "tfe_variable_set" "foobar" { + name = "variable_set_test" + description = "a test variable set" + global = false + enforced = false + organization = tfe_organization.foobar.id + }`, rInt) } func testAccTFEVariableSet_full(rInt int) string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" -} - -resource "tfe_workspace" "foobar" { - name = "foobar" - organization = tfe_organization.foobar.id -} - -resource "tfe_variable_set" "foobar" { - name = "variable_set_test" - description = "a test variable set" - global = false - organization = tfe_organization.foobar.id -} - -resource "tfe_variable_set" "applied" { - name = "variable_set_applied" - description = "a test variable set" - workspace_ids = [tfe_workspace.foobar.id] - organization = tfe_organization.foobar.id -}`, rInt) + resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" + } + + resource "tfe_workspace" "foobar" { + name = "foobar" + organization = tfe_organization.foobar.id + } + + resource "tfe_variable_set" "foobar" { + name = "variable_set_test" + description = "a test variable set" + global = false + enforced = false + organization = tfe_organization.foobar.id + } + + resource "tfe_variable_set" "applied" { + name = "variable_set_applied" + description = "a test variable set" + workspace_ids = [tfe_workspace.foobar.id] + organization = tfe_organization.foobar.id + }`, rInt) } func testAccTFEVariableSet_update(rInt int) string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" -} - -resource "tfe_workspace" "foobar" { - name = "foobar" - organization = tfe_organization.foobar.id -} - -resource "tfe_variable_set" "foobar" { - name = "variable_set_test_updated" - description = "another description" - global = true - organization = tfe_organization.foobar.id -} - -resource "tfe_variable_set" "applied" { - name = "variable_set_applied" - description = "a test variable set" - workspace_ids = [] - organization = tfe_organization.foobar.id -}`, rInt) + resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" + } + + resource "tfe_workspace" "foobar" { + name = "foobar" + organization = tfe_organization.foobar.id + } + + resource "tfe_variable_set" "foobar" { + name = "variable_set_test_updated" + description = "another description" + global = true + enforced = true + organization = tfe_organization.foobar.id + } + + resource "tfe_variable_set" "applied" { + name = "variable_set_applied" + description = "a test variable set" + workspace_ids = [] + organization = tfe_organization.foobar.id + }`, rInt) } diff --git a/website/docs/d/variable_set.html.markdown b/website/docs/d/variable_set.html.markdown index bf673bfef..edb624574 100644 --- a/website/docs/d/variable_set.html.markdown +++ b/website/docs/d/variable_set.html.markdown @@ -33,7 +33,8 @@ The following arguments are supported: * `organization` - Name of the organization. * `name` - Name of the variable set. * `description` - Description of the variable set. -* `global` - Whether or not the variable set applies to all workspaces in the organization. +* `global` - Whether the variable set applies to all workspaces in the organization. +* `enforced` - Whether the variables in this set are able to be over-written. * `workspace_ids` - IDs of the workspaces that use the variable set. * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. diff --git a/website/docs/r/variable_set.html.markdown b/website/docs/r/variable_set.html.markdown index 92e3e3677..ee0e2beab 100644 --- a/website/docs/r/variable_set.html.markdown +++ b/website/docs/r/variable_set.html.markdown @@ -94,13 +94,46 @@ resource "tfe_variable" "test-b" { } ``` +Create an enforced variable set: + +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_variable_set" "test" { + name = "Global Varset" + description = "Variable set applied to all workspaces." + enforced = true + organization = tfe_organization.test.name +} + +resource "tfe_variable" "test-a" { + key = "seperate_variable" + value = "my_value_name" + category = "terraform" + description = "a useful description" + variable_set_id = tfe_variable_set.test.id +} + +resource "tfe_variable" "test-b" { + key = "another_variable" + value = "my_value_name" + category = "env" + description = "an environment variable" + variable_set_id = tfe_variable_set.test.id +} +``` + ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. -* `global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `false`. +* `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. +* `enforced` - (Optional) Whether the variables in this set are able to be over-written. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspace_ids` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource From e4f2ad5a9713ff5657d6229e49673d8b991b2d4f Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Fri, 22 Sep 2023 11:30:07 -0400 Subject: [PATCH 041/420] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30179c354..8212f2511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ FEATURES: * **New Data Source**: `d/tfe_teams` is a new data source to return names and IDs of Teams in an Organization, by @isaacmcollins [992](https://github.com/hashicorp/terraform-provider-tfe/pull/992) * **New Resource**: `r/tfe_workspace_policy_set_exclusion` is a new resource allowing the exclusion of one or more existing workspaces from an existing `policy set`, by @Netra2104 [1033](https://github.com/hashicorp/terraform-provider-tfe/pull/1033) +ENHANCEMENTS: +* `r/tfe_variable_set`: Add `enforced` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `d/tfe_variable_set`: Add `enforced` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) + ## v0.48.0 (August 7, 2023) BUG FIXES: From 6cb1db8f22d5120a36a4a1755b824d39973833ea Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Tue, 3 Oct 2023 10:32:17 -0400 Subject: [PATCH 042/420] renamed to priority --- CHANGELOG.md | 4 ++-- internal/provider/data_source_variable_set.go | 4 ++-- .../provider/data_source_variable_set_test.go | 4 ++-- .../provider/resource_tfe_variable_set.go | 8 +++---- .../resource_tfe_variable_set_test.go | 22 +++++++++---------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8212f2511..7273ec77b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ FEATURES: * **New Resource**: `r/tfe_workspace_policy_set_exclusion` is a new resource allowing the exclusion of one or more existing workspaces from an existing `policy set`, by @Netra2104 [1033](https://github.com/hashicorp/terraform-provider-tfe/pull/1033) ENHANCEMENTS: -* `r/tfe_variable_set`: Add `enforced` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) -* `d/tfe_variable_set`: Add `enforced` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) ## v0.48.0 (August 7, 2023) diff --git a/internal/provider/data_source_variable_set.go b/internal/provider/data_source_variable_set.go index 0ae079de5..01953ff09 100644 --- a/internal/provider/data_source_variable_set.go +++ b/internal/provider/data_source_variable_set.go @@ -35,7 +35,7 @@ func dataSourceTFEVariableSet() *schema.Resource { Computed: true, }, - "enforced": { + "priority": { Type: schema.TypeBool, Computed: true, }, @@ -93,7 +93,7 @@ func dataSourceTFEVariableSetRead(d *schema.ResourceData, meta interface{}) erro d.Set("name", vs.Name) d.Set("description", vs.Description) d.Set("global", vs.Global) - d.Set("enforced", vs.Enforced) + d.Set("priority", vs.Priority) // Only now include vars and workspaces to cut down on request load. readOptions := tfe.VariableSetReadOptions{ diff --git a/internal/provider/data_source_variable_set_test.go b/internal/provider/data_source_variable_set_test.go index 283403dfa..dc715fa60 100644 --- a/internal/provider/data_source_variable_set_test.go +++ b/internal/provider/data_source_variable_set_test.go @@ -31,7 +31,7 @@ func TestAccTFEVariableSetsDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr( "data.tfe_variable_set.foobar", "global", "false"), resource.TestCheckResourceAttr( - "data.tfe_variable_set.foobar", "enforced", "false"), + "data.tfe_variable_set.foobar", "priority", "false"), resource.TestCheckResourceAttr( "data.tfe_variable_set.foobar", "organization", orgName), ), @@ -78,7 +78,7 @@ func testAccTFEVariableSetsDataSourceConfig_basic(rInt int) string { name = "varset-foo-%d" description = "a description" global = false - enforced = false + priority = false organization = tfe_organization.foobar.id } diff --git a/internal/provider/resource_tfe_variable_set.go b/internal/provider/resource_tfe_variable_set.go index f561022f4..a3d8ea76b 100644 --- a/internal/provider/resource_tfe_variable_set.go +++ b/internal/provider/resource_tfe_variable_set.go @@ -42,7 +42,7 @@ func resourceTFEVariableSet() *schema.Resource { ConflictsWith: []string{"workspace_ids"}, }, - "enforced": { + "priority": { Type: schema.TypeBool, Optional: true, Default: false, @@ -79,7 +79,7 @@ func resourceTFEVariableSetCreate(d *schema.ResourceData, meta interface{}) erro options := tfe.VariableSetCreateOptions{ Name: tfe.String(name), Global: tfe.Bool(d.Get("global").(bool)), - Enforced: tfe.Bool(d.Get("enforced").(bool)), + Priority: tfe.Bool(d.Get("priority").(bool)), } if description, descriptionSet := d.GetOk("description"); descriptionSet { @@ -135,7 +135,7 @@ func resourceTFEVariableSetRead(d *schema.ResourceData, meta interface{}) error d.Set("name", variableSet.Name) d.Set("description", variableSet.Description) d.Set("global", variableSet.Global) - d.Set("enforced", variableSet.Enforced) + d.Set("priority", variableSet.Priority) d.Set("organization", variableSet.Organization.Name) var wids []interface{} @@ -155,7 +155,7 @@ func resourceTFEVariableSetUpdate(d *schema.ResourceData, meta interface{}) erro Name: tfe.String(d.Get("name").(string)), Description: tfe.String(d.Get("description").(string)), Global: tfe.Bool(d.Get("global").(bool)), - Enforced: tfe.Bool(d.Get("enforced").(bool)), + Priority: tfe.Bool(d.Get("priority").(bool)), } log.Printf("[DEBUG] Update variable set: %s", d.Id()) diff --git a/internal/provider/resource_tfe_variable_set_test.go b/internal/provider/resource_tfe_variable_set_test.go index 059a09417..c59142ef7 100644 --- a/internal/provider/resource_tfe_variable_set_test.go +++ b/internal/provider/resource_tfe_variable_set_test.go @@ -36,7 +36,7 @@ func TestAccTFEVariableSet_basic(t *testing.T) { resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), resource.TestCheckResourceAttr( - "tfe_variable_set.foobar", "enforced", "false"), + "tfe_variable_set.foobar", "priority", "false"), ), }, }, @@ -65,7 +65,7 @@ func TestAccTFEVariableSet_full(t *testing.T) { resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), resource.TestCheckResourceAttr( - "tfe_variable_set.foobar", "enforced", "false"), + "tfe_variable_set.foobar", "priority", "false"), testAccCheckTFEVariableSetExists( "tfe_variable_set.applied", variableSet), testAccCheckTFEVariableSetApplication(variableSet), @@ -97,7 +97,7 @@ func TestAccTFEVariableSet_update(t *testing.T) { resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "false"), resource.TestCheckResourceAttr( - "tfe_variable_set.foobar", "enforced", "false"), + "tfe_variable_set.foobar", "priority", "false"), testAccCheckTFEVariableSetApplicationUpdate(variableSet), ), }, @@ -115,7 +115,7 @@ func TestAccTFEVariableSet_update(t *testing.T) { resource.TestCheckResourceAttr( "tfe_variable_set.foobar", "global", "true"), resource.TestCheckResourceAttr( - "tfe_variable_set.foobar", "enforced", "true"), + "tfe_variable_set.foobar", "priority", "true"), ), }, }, @@ -185,8 +185,8 @@ func testAccCheckTFEVariableSetAttributes( if variableSet.Global != false { return fmt.Errorf("Bad global: %t", variableSet.Global) } - if variableSet.Enforced != false { - return fmt.Errorf("Bad enforced: %t", variableSet.Enforced) + if variableSet.Priority != false { + return fmt.Errorf("Bad priority: %t", variableSet.Priority) } return nil @@ -205,8 +205,8 @@ func testAccCheckTFEVariableSetAttributesUpdate( if variableSet.Global != true { return fmt.Errorf("Bad global: %t", variableSet.Global) } - if variableSet.Enforced != true { - return fmt.Errorf("Bad enforced: %t", variableSet.Enforced) + if variableSet.Priority != true { + return fmt.Errorf("Bad priority: %t", variableSet.Priority) } return nil @@ -265,7 +265,7 @@ func testAccTFEVariableSet_basic(rInt int) string { name = "variable_set_test" description = "a test variable set" global = false - enforced = false + priority = false organization = tfe_organization.foobar.id }`, rInt) } @@ -286,7 +286,7 @@ func testAccTFEVariableSet_full(rInt int) string { name = "variable_set_test" description = "a test variable set" global = false - enforced = false + priority = false organization = tfe_organization.foobar.id } @@ -314,7 +314,7 @@ func testAccTFEVariableSet_update(rInt int) string { name = "variable_set_test_updated" description = "another description" global = true - enforced = true + priority = true organization = tfe_organization.foobar.id } From b52217868af3b122643ddaf8fc286d6bf410891b Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Tue, 3 Oct 2023 10:48:51 -0400 Subject: [PATCH 043/420] changelog fix --- CHANGELOG.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7273ec77b..aa68c9851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# UNRELEASED + + + +ENHANCEMENTS: +* `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) + ## v0.49.1 (October 2, 2023) BUG FIXES: @@ -17,10 +25,6 @@ FEATURES: * **New Data Source**: `d/tfe_teams` is a new data source to return names and IDs of Teams in an Organization, by @isaacmcollins [992](https://github.com/hashicorp/terraform-provider-tfe/pull/992) * **New Resource**: `r/tfe_workspace_policy_set_exclusion` is a new resource allowing the exclusion of one or more existing workspaces from an existing `policy set`, by @Netra2104 [1033](https://github.com/hashicorp/terraform-provider-tfe/pull/1033) -ENHANCEMENTS: -* `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) -* `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) - ## v0.48.0 (August 7, 2023) BUG FIXES: From 56391e015b2d8b8f91fc7b0abeda0fa047b5fcb9 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Tue, 3 Oct 2023 10:50:36 -0400 Subject: [PATCH 044/420] name fix --- website/docs/d/variable_set.html.markdown | 2 +- website/docs/r/variable_set.html.markdown | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/d/variable_set.html.markdown b/website/docs/d/variable_set.html.markdown index edb624574..061298038 100644 --- a/website/docs/d/variable_set.html.markdown +++ b/website/docs/d/variable_set.html.markdown @@ -34,7 +34,7 @@ The following arguments are supported: * `name` - Name of the variable set. * `description` - Description of the variable set. * `global` - Whether the variable set applies to all workspaces in the organization. -* `enforced` - Whether the variables in this set are able to be over-written. +* `priority` - Whether the variables in this set are able to be over-written. * `workspace_ids` - IDs of the workspaces that use the variable set. * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. diff --git a/website/docs/r/variable_set.html.markdown b/website/docs/r/variable_set.html.markdown index ee0e2beab..7b380e965 100644 --- a/website/docs/r/variable_set.html.markdown +++ b/website/docs/r/variable_set.html.markdown @@ -94,7 +94,7 @@ resource "tfe_variable" "test-b" { } ``` -Create an enforced variable set: +Create a priority variable set: ```hcl resource "tfe_organization" "test" { @@ -105,7 +105,7 @@ resource "tfe_organization" "test" { resource "tfe_variable_set" "test" { name = "Global Varset" description = "Variable set applied to all workspaces." - enforced = true + priority = true organization = tfe_organization.test.name } @@ -133,7 +133,7 @@ The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. * `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. -* `enforced` - (Optional) Whether the variables in this set are able to be over-written. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set are able to be over-written. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspace_ids` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource From b8d74839993c8328f7cc60521c5c2f8f0e6b9a39 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Wed, 4 Oct 2023 15:10:42 -0700 Subject: [PATCH 045/420] Fix Terraform 1.6 compat by finishing GetMetadata implementation Providers implemented using the `terraform-plugin-go` library above version 0.19 or so must implement GetMetadata(), as part of supporting an optional memory usage improvement. See https://github.com/hashicorp/terraform-plugin-sdk/issues/1234 for the start of a breadcrumb trail with more details about this whole effort. Almost nobody actually implements providers using terraform-plugin-go, but we do! It's one of our THREE muxed-together providers, because we once needed to do something that was impossible in the SDK before the new framework existed. It's used for ONE data source, `tfe_outputs`. This function was added (with a blank return value) in https://github.com/hashicorp/terraform-provider-tfe/pull/1046 and no one noticed a problem, presumably because acceptance tests were running with a Terraform version that didn't exercise the new memory-saving code path, instead just calling GetProviderSchema however many times. But, Terraform 1.6 *does* exercise it, and it turns out a blank value causes it to bail out early with a not-found for the tfe_outputs data source. This commit adds our lonely data source to the low-level provider's metadata, which fixes the issue. Longer-term, we should... probably migrate that data source to the framework and delete that whole third provider. --- internal/provider/plugin_provider.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/provider/plugin_provider.go b/internal/provider/plugin_provider.go index 375609e72..af9e4c148 100644 --- a/internal/provider/plugin_provider.go +++ b/internal/provider/plugin_provider.go @@ -45,7 +45,16 @@ type providerMeta struct { } func (p *pluginProviderServer) GetMetadata(ctx context.Context, req *tfprotov5.GetMetadataRequest) (*tfprotov5.GetMetadataResponse, error) { - return &tfprotov5.GetMetadataResponse{}, nil + return &tfprotov5.GetMetadataResponse{ + ServerCapabilities: &tfprotov5.ServerCapabilities{ + GetProviderSchemaOptional: true, + }, + DataSources: []tfprotov5.DataSourceMetadata{ + { + TypeName: "tfe_outputs", + }, + }, + }, nil } func (p *pluginProviderServer) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error) { From 4446f9965dd76f61770f8c1b6db3e40bc682443e Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Wed, 4 Oct 2023 15:32:01 -0700 Subject: [PATCH 046/420] Update changelog, update version numbers in docs --- CHANGELOG.md | 5 +++++ README.md | 4 ++-- website/docs/index.html.markdown | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30179c354..25addfa8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.49.2 (October 4, 2023) + +BUG FIXES: +* `d/tfe_outputs`: Fix incompatibility with the newly-released Terraform 1.6, which would result in a "Data Source Not Implemented" error. + ## v0.49.1 (October 2, 2023) BUG FIXES: diff --git a/README.md b/README.md index e981ced19..1b332203b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.49.1" + version = "~> 0.49.2" } } } @@ -45,7 +45,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index bf86b92f5..f60d0948e 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.1" + version = "~> 0.49.2" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.49.1" + version = "~> 0.49.2" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.48.0" + version = "~> 0.49.2" } # Create an organization From 7668e03e38c6bc98797e9d75057eedabbe24d978 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 4 Oct 2023 22:41:59 +0000 Subject: [PATCH 047/420] cdktf: update documentation --- .../d/organization_membership.html.markdown | 29 ++- .../cdktf/csharp/d/policy_set.html.markdown | 3 +- .../docs/cdktf/csharp/d/teams.html.markdown | 45 ++++ .../cdktf/csharp/d/variable_set.html.markdown | 5 +- website/docs/cdktf/csharp/index.html.markdown | 8 +- .../csharp/r/registry_module.html.markdown | 2 +- .../r/team_project_access.html.markdown | 10 +- .../cdktf/csharp/r/workspace.html.markdown | 24 +- ...rkspace_policy_set_exclusion.html.markdown | 77 ++++++ .../r/workspace_variable_set.html.markdown | 6 +- .../d/organization_membership.html.markdown | 32 ++- .../docs/cdktf/go/d/policy_set.html.markdown | 3 +- website/docs/cdktf/go/d/teams.html.markdown | 48 ++++ .../cdktf/go/d/variable_set.html.markdown | 5 +- website/docs/cdktf/go/index.html.markdown | 8 +- .../cdktf/go/r/registry_module.html.markdown | 2 +- .../go/r/team_project_access.html.markdown | 36 +-- .../docs/cdktf/go/r/workspace.html.markdown | 32 +-- ...rkspace_policy_set_exclusion.html.markdown | 83 ++++++ .../go/r/workspace_variable_set.html.markdown | 14 +- .../d/organization_membership.html.markdown | 28 +- .../cdktf/java/d/policy_set.html.markdown | 3 +- website/docs/cdktf/java/d/teams.html.markdown | 44 ++++ .../cdktf/java/d/variable_set.html.markdown | 5 +- website/docs/cdktf/java/index.html.markdown | 8 +- .../java/r/registry_module.html.markdown | 2 +- .../java/r/team_project_access.html.markdown | 34 +-- .../docs/cdktf/java/r/workspace.html.markdown | 24 +- ...rkspace_policy_set_exclusion.html.markdown | 79 ++++++ .../r/workspace_variable_set.html.markdown | 6 +- .../cdktf/python/d/agent_pool.html.markdown | 17 +- .../d/github_installation.html.markdown | 32 +-- .../cdktf/python/d/ip_ranges.html.markdown | 21 +- .../cdktf/python/d/oauth_client.html.markdown | 47 ++-- .../cdktf/python/d/organization.html.markdown | 17 +- .../d/organization_members.html.markdown | 22 +- .../d/organization_membership.html.markdown | 47 ++-- .../d/organization_run_task.html.markdown | 17 +- .../python/d/organization_tags.html.markdown | 17 +- .../python/d/organizations.html.markdown | 17 +- .../docs/cdktf/python/d/outputs.html.markdown | 23 +- .../cdktf/python/d/policy_set.html.markdown | 17 +- .../docs/cdktf/python/d/project.html.markdown | 17 +- .../python/d/saml_settings.html.markdown | 42 ++- .../docs/cdktf/python/d/slug.html.markdown | 22 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/d/team.html.markdown | 17 +- .../cdktf/python/d/team_access.html.markdown | 17 +- .../d/team_project_access.html.markdown | 17 +- .../docs/cdktf/python/d/teams.html.markdown | 17 +- .../cdktf/python/d/variable_set.html.markdown | 17 +- .../cdktf/python/d/variables.html.markdown | 43 ++-- .../cdktf/python/d/workspace.html.markdown | 17 +- .../python/d/workspace_ids.html.markdown | 23 +- .../python/d/workspace_run_task.html.markdown | 17 +- website/docs/cdktf/python/index.html.markdown | 51 ++-- .../r/admin_organization_settings.markdown | 74 +++--- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 55 ++-- .../cdktf/python/r/agent_token.html.markdown | 27 +- .../python/r/no_code_module.html.markdown | 56 ++-- .../notification_configuration.html.markdown | 96 ++++--- .../cdktf/python/r/oauth_client.html.markdown | 47 ++-- .../cdktf/python/r/organization.html.markdown | 17 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../python/r/organization_token.html.markdown | 48 ++-- .../docs/cdktf/python/r/policy.html.markdown | 32 +-- .../cdktf/python/r/policy_set.html.markdown | 113 +++----- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 34 +-- .../r/project_variable_set.html.markdown | 35 ++- .../python/r/registry_module.html.markdown | 121 ++++----- .../cdktf/python/r/run_trigger.html.markdown | 33 +-- .../python/r/saml_settings.html.markdown | 35 +-- .../python/r/sentinel_policy.html.markdown | 17 +- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 32 +-- .../cdktf/python/r/team_access.html.markdown | 27 +- .../cdktf/python/r/team_member.html.markdown | 22 +- .../cdktf/python/r/team_members.html.markdown | 46 ++-- .../r/team_organization_member.html.markdown | 29 +-- .../r/team_organization_members.html.markdown | 72 +++--- .../r/team_project_access.html.markdown | 53 ++-- .../cdktf/python/r/team_token.html.markdown | 48 ++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 ++++----- .../cdktf/python/r/variable_set.html.markdown | 86 +++---- .../cdktf/python/r/workspace.html.markdown | 49 ++-- .../r/workspace_policy_set.html.markdown | 35 ++- ...rkspace_policy_set_exclusion.html.markdown | 35 ++- .../python/r/workspace_run.html.markdown | 110 ++++---- .../python/r/workspace_run_task.html.markdown | 25 +- .../r/workspace_variable_set.html.markdown | 35 ++- .../typescript/d/agent_pool.html.markdown | 21 +- .../d/github_installation.html.markdown | 56 ++-- .../typescript/d/ip_ranges.html.markdown | 29 ++- .../typescript/d/oauth_client.html.markdown | 59 ++--- .../typescript/d/organization.html.markdown | 21 +- .../d/organization_members.html.markdown | 26 +- .../d/organization_membership.html.markdown | 89 +++---- .../d/organization_run_task.html.markdown | 31 +-- .../d/organization_tags.html.markdown | 21 +- .../typescript/d/organizations.html.markdown | 21 +- .../cdktf/typescript/d/outputs.html.markdown | 37 +-- .../typescript/d/policy_set.html.markdown | 21 +- .../cdktf/typescript/d/project.html.markdown | 21 +- .../typescript/d/saml_settings.html.markdown | 41 +-- .../cdktf/typescript/d/slug.html.markdown | 26 +- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +- .../cdktf/typescript/d/team.html.markdown | 21 +- .../typescript/d/team_access.html.markdown | 21 +- .../d/team_project_access.html.markdown | 21 +- .../cdktf/typescript/d/teams.html.markdown | 21 +- .../typescript/d/variable_set.html.markdown | 21 +- .../typescript/d/variables.html.markdown | 79 +++--- .../typescript/d/workspace.html.markdown | 21 +- .../typescript/d/workspace_ids.html.markdown | 27 +- .../d/workspace_run_task.html.markdown | 21 +- .../docs/cdktf/typescript/index.html.markdown | 55 ++-- .../r/admin_organization_settings.markdown | 73 +++--- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 54 ++-- .../typescript/r/agent_token.html.markdown | 49 ++-- .../typescript/r/no_code_module.html.markdown | 140 +++++----- .../notification_configuration.html.markdown | 208 ++++++++------- .../typescript/r/oauth_client.html.markdown | 59 ++--- .../typescript/r/organization.html.markdown | 21 +- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 21 +- .../r/organization_run_task.html.markdown | 21 +- .../r/organization_token.html.markdown | 51 ++-- .../cdktf/typescript/r/policy.html.markdown | 40 ++- .../typescript/r/policy_set.html.markdown | 112 +++----- .../r/policy_set_parameter.html.markdown | 48 ++-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 54 ++-- .../r/project_variable_set.html.markdown | 51 ++-- .../r/registry_module.html.markdown | 243 ++++++++++-------- .../typescript/r/run_trigger.html.markdown | 63 +++-- .../typescript/r/saml_settings.html.markdown | 34 +-- .../r/sentinel_policy.html.markdown | 21 +- .../cdktf/typescript/r/ssh_key.html.markdown | 21 +- .../cdktf/typescript/r/team.html.markdown | 40 ++- .../typescript/r/team_access.html.markdown | 31 +-- .../typescript/r/team_member.html.markdown | 26 +- .../typescript/r/team_members.html.markdown | 54 ++-- .../r/team_organization_member.html.markdown | 47 ++-- .../r/team_organization_members.html.markdown | 115 ++++----- .../r/team_project_access.html.markdown | 65 ++--- .../typescript/r/team_token.html.markdown | 56 ++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 +++++------ .../typescript/r/variable_set.html.markdown | 122 ++++----- .../typescript/r/workspace.html.markdown | 87 ++++--- .../r/workspace_policy_set.html.markdown | 51 ++-- ...rkspace_policy_set_exclusion.html.markdown | 59 +++-- .../typescript/r/workspace_run.html.markdown | 182 +++++++------ .../r/workspace_run_task.html.markdown | 26 +- .../r/workspace_variable_set.html.markdown | 55 ++-- 162 files changed, 3222 insertions(+), 3438 deletions(-) create mode 100644 website/docs/cdktf/csharp/d/teams.html.markdown create mode 100644 website/docs/cdktf/csharp/r/workspace_policy_set_exclusion.html.markdown create mode 100644 website/docs/cdktf/go/d/teams.html.markdown create mode 100644 website/docs/cdktf/go/r/workspace_policy_set_exclusion.html.markdown create mode 100644 website/docs/cdktf/java/d/teams.html.markdown create mode 100644 website/docs/cdktf/java/r/workspace_policy_set_exclusion.html.markdown diff --git a/website/docs/cdktf/csharp/d/organization_membership.html.markdown b/website/docs/cdktf/csharp/d/organization_membership.html.markdown index d6f191a9a..6c507d22b 100644 --- a/website/docs/cdktf/csharp/d/organization_membership.html.markdown +++ b/website/docs/cdktf/csharp/d/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an organization membership. --- + + # Data Source: tfe_organization_membership Use this data source to get information about an organization membership. @@ -57,15 +59,36 @@ class MyConvertedCode : TerraformStack } ``` +### Fetch by organization membership ID + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeOrganizationMembership.DataTfeOrganizationMembership(this, "test", new DataTfeOrganizationMembershipConfig { + Organization = "my-org-name", + OrganizationMembershipId = "ou-xxxxxxxxxxx" + }); + } +} +``` + ## Argument Reference The following arguments are supported: -* `Organization` - (Required) Name of the organization. +* `Organization` - (Optional) Name of the organization. * `Email` - (Optional) Email of the user. * `Username` - (Optional) The username of the user. +* `OrganizationMembershipId` - (Optional) ID belonging to the organziation membership. -~> **NOTE:** While `Email` and `Username` are optional arguments, one or the other is required. +~> **NOTE:** While `Email` and `Username` are optional arguments, one or the other is required if `OrganizationMembershipId` argument is not provided. ## Attributes Reference @@ -75,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `UserId` - The ID of the user associated with the organization membership. * `Username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/policy_set.html.markdown b/website/docs/cdktf/csharp/d/policy_set.html.markdown index 3dc0b6cb5..71c2914c6 100644 --- a/website/docs/cdktf/csharp/d/policy_set.html.markdown +++ b/website/docs/cdktf/csharp/d/policy_set.html.markdown @@ -50,6 +50,7 @@ The following arguments are supported: * `Kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". * `Overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `WorkspaceIds` - IDs of the workspaces that use the policy set. +* `ExcludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `ProjectIds` - IDs of the projects that use the policy set. * `PolicyIds` - IDs of the policies attached to the policy set. * `PoliciesPath` - The sub-path within the attached VCS repository when using `VcsRepo`. @@ -66,4 +67,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/teams.html.markdown b/website/docs/cdktf/csharp/d/teams.html.markdown new file mode 100644 index 000000000..0a353550b --- /dev/null +++ b/website/docs/cdktf/csharp/d/teams.html.markdown @@ -0,0 +1,45 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_teams" +description: |- + Get information on Teams. +--- + + + +# Data Source: tfe_teams + +Use this data source to get a list of Teams in an Organization and a map of their IDs. The Teams returned may be a subset of all teams in an Organization based on the permissions of the API token. + +## Example Usage + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeTeams.DataTfeTeams(this, "foo", new DataTfeTeamsConfig { + Organization = "my-org-name" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: +* `Id` - Name of the organization. +* `Names` - A list of team names in an organization. +* `Ids` - A map of team names in an organization and their IDs. + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/variable_set.html.markdown b/website/docs/cdktf/csharp/d/variable_set.html.markdown index 9729f4d49..499015be7 100644 --- a/website/docs/cdktf/csharp/d/variable_set.html.markdown +++ b/website/docs/cdktf/csharp/d/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on organization variable sets. --- + + # Data Source: tfe_variable_set This data source is used to retrieve a named variable set @@ -47,5 +49,6 @@ The following arguments are supported: * `Global` - Whether or not the variable set applies to all workspaces in the organization. * `WorkspaceIds` - IDs of the workspaces that use the variable set. * `VariableIds` - IDs of the variables attached to the variable set. +* `ProjectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index dd0c0d541..aa5d383c7 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.48.0" + version = "~> 0.49.2" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.48.0" + version = "~> 0.49.2" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index 1a680203d..1fb935029 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -212,4 +212,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team_project_access.html.markdown b/website/docs/cdktf/csharp/r/team_project_access.html.markdown index 834c8e8b5..5274cbefa 100644 --- a/website/docs/cdktf/csharp/r/team_project_access.html.markdown +++ b/website/docs/cdktf/csharp/r/team_project_access.html.markdown @@ -60,7 +60,7 @@ that affect the project itself and all workspaces in the project, by using `Proj The following permissions apply to the project itself. -| project-access | Description, Default, Valid Values | +| project_access | Description, Default, Valid Values | |---------------------|---------------------------------------------| | `Settings` | The permission to grant for the project's settings. Default: `Read`. Valid strings: `Read`, `Update`, or `Delete` | | `Teams` | The permission to grant for the project's teams. Default: `None`, Valid strings: `None`, `Read`, or `Manage` | @@ -71,7 +71,7 @@ The following permissions apply to the project itself. The following permissions apply to all workpsaces (and future workspaces) in the project. -| workspace-access | Description, Default, Valid Values | +| workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| | `Runs` | The permission to grant project's workspaces' runs. Default: `Read`. Valid strings: `Read`, `Plan`, or `Apply`. | | `SentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `None`. Valid strings: `None`, or `Read`. | @@ -106,13 +106,13 @@ class MyConvertedCode : TerraformStack }); new TeamProjectAccess.TeamProjectAccess(this, "custom", new TeamProjectAccessConfig { Access = "custom", - ProjectAccess = new [] { new Struct { + ProjectAccess = new [] { new TeamProjectAccessProjectAccess { Settings = "read", Teams = "none" } }, ProjectId = Token.AsString(tfeProjectTest.Id), TeamId = Token.AsString(tfeTeamDev.Id), - WorkspaceAccess = new [] { new Struct { + WorkspaceAccess = new [] { new TeamProjectAccessWorkspaceAccess { Create = true, Delete = false, Locking = true, @@ -141,4 +141,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index abf66fae0..455d9993a 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -5,6 +5,8 @@ description: |- Manages workspaces. --- + + # tfe_workspace Provides a workspace resource. @@ -73,31 +75,30 @@ class MyConvertedCode : TerraformStack The following arguments are supported: * `Name` - (Required) Name of the workspace. -* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `Description` - (Optional) A description for the workspace. * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value or if `Operations` is provided. * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. -* `AutoApply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `False`. +* `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. +* `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. +* `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. Defaults to `Remote`. Using Terraform Enterprise, only `Remote`and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. This value _must not_ be provided if `Operations` is provided. -* `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `True`. 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. +* `ForceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `GlobalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`RemoteStateConsumerIds`). -* `RemoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `Operations` - **Deprecated** Whether to use remote execution mode. Defaults to `True`. When set to `False`, the workspace will be used for state storage only. This value _must not_ be provided if `ExecutionMode` is provided. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `ProjectId` - (Optional) ID of the project where the workspace should be created. * `QueueAllRuns` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -107,6 +108,7 @@ The following arguments are supported: is `False`. The provider uses `True` as any workspace provisioned with `False` would need to then have a run manually queued out-of-band before accepting webhooks. +* `RemoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `SourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -135,15 +137,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. * `TriggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. -* `WorkingDirectory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `VcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `ForceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `WorkingDirectory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `VcsRepo` block supports: @@ -152,11 +152,11 @@ The `VcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `Branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. * `IngressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `False`. * `OauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `TfeOauthClient` resource. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. -* `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. * `TagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `TriggerPatterns` and `TriggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -180,4 +180,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/csharp/r/workspace_policy_set_exclusion.html.markdown new file mode 100644 index 000000000..4e050e6c2 --- /dev/null +++ b/website/docs/cdktf/csharp/r/workspace_policy_set_exclusion.html.markdown @@ -0,0 +1,77 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_policy_set_exclusion" +description: |- + Add a policy set to an excluded workspace +--- + + + +# tfe_workspace_policy_set_exclusion + +Adds and removes policy sets from an excluded workspace + +-> **Note:** `TfePolicySet` has an argument `WorkspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. + +## Example Usage + +Basic usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfePolicySetTest = new PolicySet.PolicySet(this, "test_1", new PolicySetConfig { + Description = "Some description.", + Name = "my-policy-set", + Organization = Token.AsString(tfeOrganizationTest.Name) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.OverrideLogicalId("test"); + var tfeWorkspaceTest = new Workspace.Workspace(this, "test_2", new WorkspaceConfig { + Name = "my-workspace-name", + Organization = Token.AsString(tfeOrganizationTest.Name) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.OverrideLogicalId("test"); + var tfeWorkspacePolicySetExclusionTest = + new WorkspacePolicySetExclusion.WorkspacePolicySetExclusion(this, "test_3", new WorkspacePolicySetExclusionConfig { + PolicySetId = Token.AsString(tfePolicySetTest.Id), + WorkspaceId = Token.AsString(tfeWorkspaceTest.Id) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspacePolicySetExclusionTest.OverrideLogicalId("test"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `PolicySetId` - (Required) ID of the policy set. +* `WorkspaceId` - (Required) Excluded workspace ID to add the policy set to. + +## Attributes Reference + +* `Id` - The ID of the policy set attachment. ID format: `_` + +## Import + +Excluded Workspace Policy Sets can be imported; use `//`. For example: + +```shell +terraform import tfe_workspace_policy_set_exclusion.test 'my-org-name/workspace/policy-set-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_variable_set.html.markdown b/website/docs/cdktf/csharp/r/workspace_variable_set.html.markdown index 88b31dc2b..8e282e2b7 100644 --- a/website/docs/cdktf/csharp/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace_variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Add a variable set to a workspace --- + + # tfe_workspace_variable_set Adds and removes variable sets from a workspace @@ -57,7 +59,7 @@ class MyConvertedCode : TerraformStack The following arguments are supported: -* `VariableSetId` - (Required) Name of the variable set to add. +* `VariableSetId` - (Required) The variable set ID. * `WorkspaceId` - (Required) Workspace ID to add the variable set to. ## Attributes Reference @@ -72,4 +74,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/organization_membership.html.markdown b/website/docs/cdktf/go/d/organization_membership.html.markdown index 62c148240..921208eab 100644 --- a/website/docs/cdktf/go/d/organization_membership.html.markdown +++ b/website/docs/cdktf/go/d/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an organization membership. --- + + # Data Source: tfe_organization_membership Use this data source to get information about an organization membership. @@ -63,15 +65,39 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { } ``` +### Fetch by organization membership ID + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeOrganizationMembership" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeOrganizationMembership.NewDataTfeOrganizationMembership(this, jsii.String("test"), &dataTfeOrganizationMembershipConfig{ + organization: jsii.String("my-org-name"), + organizationMembershipId: jsii.String("ou-xxxxxxxxxxx"), + }) + return this +} +``` + ## Argument Reference The following arguments are supported: -* `Organization` - (Required) Name of the organization. +* `Organization` - (Optional) Name of the organization. * `Email` - (Optional) Email of the user. * `Username` - (Optional) The username of the user. +* `OrganizationMembershipId` - (Optional) ID belonging to the organziation membership. -~> **NOTE:** While `Email` and `Username` are optional arguments, one or the other is required. +~> **NOTE:** While `Email` and `Username` are optional arguments, one or the other is required if `OrganizationMembershipId` argument is not provided. ## Attributes Reference @@ -81,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `UserId` - The ID of the user associated with the organization membership. * `Username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/policy_set.html.markdown b/website/docs/cdktf/go/d/policy_set.html.markdown index 7f8b92d21..b2e4ddee0 100644 --- a/website/docs/cdktf/go/d/policy_set.html.markdown +++ b/website/docs/cdktf/go/d/policy_set.html.markdown @@ -53,6 +53,7 @@ The following arguments are supported: * `Kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". * `Overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `WorkspaceIds` - IDs of the workspaces that use the policy set. +* `ExcludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `ProjectIds` - IDs of the projects that use the policy set. * `PolicyIds` - IDs of the policies attached to the policy set. * `PoliciesPath` - The sub-path within the attached VCS repository when using `VcsRepo`. @@ -69,4 +70,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/teams.html.markdown b/website/docs/cdktf/go/d/teams.html.markdown new file mode 100644 index 000000000..bd090cddb --- /dev/null +++ b/website/docs/cdktf/go/d/teams.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_teams" +description: |- + Get information on Teams. +--- + + + +# Data Source: tfe_teams + +Use this data source to get a list of Teams in an Organization and a map of their IDs. The Teams returned may be a subset of all teams in an Organization based on the permissions of the API token. + +## Example Usage + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeTeams" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeTeams.NewDataTfeTeams(this, jsii.String("foo"), &dataTfeTeamsConfig{ + organization: jsii.String("my-org-name"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: +* `Id` - Name of the organization. +* `Names` - A list of team names in an organization. +* `Ids` - A map of team names in an organization and their IDs. + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/variable_set.html.markdown b/website/docs/cdktf/go/d/variable_set.html.markdown index 3fdf32080..1cfe6bbba 100644 --- a/website/docs/cdktf/go/d/variable_set.html.markdown +++ b/website/docs/cdktf/go/d/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on organization variable sets. --- + + # Data Source: tfe_variable_set This data source is used to retrieve a named variable set @@ -50,5 +52,6 @@ The following arguments are supported: * `Global` - Whether or not the variable set applies to all workspaces in the organization. * `WorkspaceIds` - IDs of the workspaces that use the variable set. * `VariableIds` - IDs of the variables attached to the variable set. +* `ProjectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index dd0c0d541..aa5d383c7 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.48.0" + version = "~> 0.49.2" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.48.0" + version = "~> 0.49.2" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index f5f19f77e..ba24cd66d 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -235,4 +235,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team_project_access.html.markdown b/website/docs/cdktf/go/r/team_project_access.html.markdown index e12a99221..6dd725740 100644 --- a/website/docs/cdktf/go/r/team_project_access.html.markdown +++ b/website/docs/cdktf/go/r/team_project_access.html.markdown @@ -65,7 +65,7 @@ that affect the project itself and all workspaces in the project, by using `Proj The following permissions apply to the project itself. -| project-access | Description, Default, Valid Values | +| project_access | Description, Default, Valid Values | |---------------------|---------------------------------------------| | `Settings` | The permission to grant for the project's settings. Default: `Read`. Valid strings: `Read`, `Update`, or `Delete` | | `Teams` | The permission to grant for the project's teams. Default: `None`, Valid strings: `None`, `Read`, or `Manage` | @@ -76,7 +76,7 @@ The following permissions apply to the project itself. The following permissions apply to all workpsaces (and future workspaces) in the project. -| workspace-access | Description, Default, Valid Values | +| workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| | `Runs` | The permission to grant project's workspaces' runs. Default: `Read`. Valid strings: `Read`, `Plan`, or `Apply`. | | `SentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `None`. Valid strings: `None`, or `Read`. | @@ -116,25 +116,25 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) teamProjectAccess.NewTeamProjectAccess(this, jsii.String("custom"), &teamProjectAccessConfig{ access: jsii.String("custom"), - projectAccess: []map[string]*string{ - map[string]*string{ - "settings": jsii.String("read"), - "teams": jsii.String("none"), + projectAccess: []interface{}{ + &teamProjectAccessProjectAccess{ + settings: jsii.String("read"), + teams: jsii.String("none"), }, }, projectId: cdktf.Token_AsString(tfeProjectTest.id), teamId: cdktf.Token_*AsString(tfeTeamDev.id), - workspaceAccess: []map[string]interface{}{ - map[string]interface{}{ - "create": jsii.Boolean(true), - "delete": jsii.Boolean(false), - "locking": jsii.Boolean(true), - "move": jsii.Boolean(false), - "runTasks": jsii.Boolean(false), - "runs": jsii.String("apply"), - "sentinelMocks": jsii.String("none"), - "stateVersions": jsii.String("write"), - "variables": jsii.String("write"), + workspaceAccess: []interface{}{ + &teamProjectAccessWorkspaceAccess{ + create: jsii.Boolean(true), + delete: jsii.Boolean(false), + locking: jsii.Boolean(true), + move: jsii.Boolean(false), + runTasks: jsii.Boolean(false), + runs: jsii.String("apply"), + sentinelMocks: jsii.String("none"), + stateVersions: jsii.String("write"), + variables: jsii.String("write"), }, }, }) @@ -155,4 +155,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index e9f97510b..66449648b 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -5,6 +5,8 @@ description: |- Manages workspaces. --- + + # tfe_workspace Provides a workspace resource. @@ -35,7 +37,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.*token_AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), tagNames: []*string{ jsii.String("test"), jsii.String("app"), @@ -68,13 +70,13 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ name: jsii.String("my-agent-pool-name"), - organization: cdktf.*token_AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), }) workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ - agentPoolId: cdktf.*token_*AsString(tfeAgentPoolTestAgentPool.id), + agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), executionMode: jsii.String("agent"), name: jsii.String("my-workspace-name"), - organization: cdktf.*token_*AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), }) return this } @@ -85,31 +87,30 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { The following arguments are supported: * `Name` - (Required) Name of the workspace. -* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `Description` - (Optional) A description for the workspace. * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value or if `Operations` is provided. * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. -* `AutoApply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `False`. +* `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. +* `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. +* `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. Defaults to `Remote`. Using Terraform Enterprise, only `Remote`and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. This value _must not_ be provided if `Operations` is provided. -* `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `True`. 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. +* `ForceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `GlobalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`RemoteStateConsumerIds`). -* `RemoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `Operations` - **Deprecated** Whether to use remote execution mode. Defaults to `True`. When set to `False`, the workspace will be used for state storage only. This value _must not_ be provided if `ExecutionMode` is provided. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `ProjectId` - (Optional) ID of the project where the workspace should be created. * `QueueAllRuns` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -119,6 +120,7 @@ The following arguments are supported: is `False`. The provider uses `True` as any workspace provisioned with `False` would need to then have a run manually queued out-of-band before accepting webhooks. +* `RemoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `SourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -147,15 +149,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. * `TriggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. -* `WorkingDirectory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `VcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `ForceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `WorkingDirectory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `VcsRepo` block supports: @@ -164,11 +164,11 @@ The `VcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `Branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. * `IngressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `False`. * `OauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `TfeOauthClient` resource. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. -* `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. * `TagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `TriggerPatterns` and `TriggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -192,4 +192,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/go/r/workspace_policy_set_exclusion.html.markdown new file mode 100644 index 000000000..217794e14 --- /dev/null +++ b/website/docs/cdktf/go/r/workspace_policy_set_exclusion.html.markdown @@ -0,0 +1,83 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_policy_set_exclusion" +description: |- + Add a policy set to an excluded workspace +--- + + + +# tfe_workspace_policy_set_exclusion + +Adds and removes policy sets from an excluded workspace + +-> **Note:** `TfePolicySet` has an argument `WorkspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. + +## Example Usage + +Basic usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/policySet" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspacePolicySetExclusion" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTest := organization.NewOrganization(this, jsii.String("test"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfePolicySetTest := policySet.NewPolicySet(this, jsii.String("test_1"), &policySetConfig{ + description: jsii.String("Some description."), + name: jsii.String("my-policy-set"), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.OverrideLogicalId(jsii.String("test")) + tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test_2"), &workspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: cdktf.Token_*AsString(tfeOrganizationTest.name), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.OverrideLogicalId(jsii.String("test")) + tfeWorkspacePolicySetExclusionTest := + workspacePolicySetExclusion.NewWorkspacePolicySetExclusion(this, jsii.String("test_3"), &workspacePolicySetExclusionConfig{ + policySetId: cdktf.Token_*AsString(tfePolicySetTest.id), + workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspacePolicySetExclusionTest.OverrideLogicalId(jsii.String("test")) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `PolicySetId` - (Required) ID of the policy set. +* `WorkspaceId` - (Required) Excluded workspace ID to add the policy set to. + +## Attributes Reference + +* `Id` - The ID of the policy set attachment. ID format: `_` + +## Import + +Excluded Workspace Policy Sets can be imported; use `//`. For example: + +```shell +terraform import tfe_workspace_policy_set_exclusion.test 'my-org-name/workspace/policy-set-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_variable_set.html.markdown b/website/docs/cdktf/go/r/workspace_variable_set.html.markdown index be57af26b..49fed4ec8 100644 --- a/website/docs/cdktf/go/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/go/r/workspace_variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Add a variable set to a workspace --- + + # tfe_workspace_variable_set Adds and removes variable sets from a workspace @@ -38,20 +40,20 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { tfeVariableSetTest := variableSet.NewVariableSet(this, jsii.String("test_1"), &variableSetConfig{ description: jsii.String("Some description."), name: jsii.String("Test Varset"), - organization: cdktf.*token_AsString(tfeOrganizationTest.name), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.OverrideLogicalId(jsii.String("test")) tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test_2"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.*token_*AsString(tfeOrganizationTest.name), + organization: cdktf.Token_*AsString(tfeOrganizationTest.name), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.OverrideLogicalId(jsii.String("test")) tfeWorkspaceVariableSetTest := workspaceVariableSet.NewWorkspaceVariableSet(this, jsii.String("test_3"), &workspaceVariableSetConfig{ - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), - workspaceId: cdktf.*token_*AsString(tfeWorkspaceTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), + workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.OverrideLogicalId(jsii.String("test")) @@ -63,7 +65,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { The following arguments are supported: -* `VariableSetId` - (Required) Name of the variable set to add. +* `VariableSetId` - (Required) The variable set ID. * `WorkspaceId` - (Required) Workspace ID to add the variable set to. ## Attributes Reference @@ -78,4 +80,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/organization_membership.html.markdown b/website/docs/cdktf/java/d/organization_membership.html.markdown index edd3e9a3c..f7dc4b44f 100644 --- a/website/docs/cdktf/java/d/organization_membership.html.markdown +++ b/website/docs/cdktf/java/d/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an organization membership. --- + + # Data Source: tfe_organization_membership Use this data source to get information about an organization membership. @@ -55,15 +57,35 @@ public class MyConvertedCode extends TerraformStack { } ``` +### Fetch by organization membership ID + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeOrganizationMembership.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeOrganizationMembership(this, "test", new DataTfeOrganizationMembershipConfig() + .organization("my-org-name") + .organizationMembershipId("ou-xxxxxxxxxxx") + ); + } +} +``` + ## Argument Reference The following arguments are supported: -* `organization` - (Required) Name of the organization. +* `organization` - (Optional) Name of the organization. * `email` - (Optional) Email of the user. * `username` - (Optional) The username of the user. +* `organizationMembershipId` - (Optional) ID belonging to the organziation membership. -~> **NOTE:** While `email` and `username` are optional arguments, one or the other is required. +~> **NOTE:** While `email` and `username` are optional arguments, one or the other is required if `organizationMembershipId` argument is not provided. ## Attributes Reference @@ -73,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/policy_set.html.markdown b/website/docs/cdktf/java/d/policy_set.html.markdown index 14b749010..a5973dda4 100644 --- a/website/docs/cdktf/java/d/policy_set.html.markdown +++ b/website/docs/cdktf/java/d/policy_set.html.markdown @@ -49,6 +49,7 @@ The following arguments are supported: * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspaceIds` - IDs of the workspaces that use the policy set. +* `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `projectIds` - IDs of the projects that use the policy set. * `policyIds` - IDs of the policies attached to the policy set. * `policiesPath` - The sub-path within the attached VCS repository when using `vcsRepo`. @@ -65,4 +66,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/teams.html.markdown b/website/docs/cdktf/java/d/teams.html.markdown new file mode 100644 index 000000000..2a95224ca --- /dev/null +++ b/website/docs/cdktf/java/d/teams.html.markdown @@ -0,0 +1,44 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_teams" +description: |- + Get information on Teams. +--- + + + +# Data Source: tfe_teams + +Use this data source to get a list of Teams in an Organization and a map of their IDs. The Teams returned may be a subset of all teams in an Organization based on the permissions of the API token. + +## Example Usage + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeTeams.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeTeams(this, "foo", new DataTfeTeamsConfig() + .organization("my-org-name") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: +* `id` - Name of the organization. +* `names` - A list of team names in an organization. +* `ids` - A map of team names in an organization and their IDs. + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/variable_set.html.markdown b/website/docs/cdktf/java/d/variable_set.html.markdown index 72e65e0d8..8e8ed5322 100644 --- a/website/docs/cdktf/java/d/variable_set.html.markdown +++ b/website/docs/cdktf/java/d/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on organization variable sets. --- + + # Data Source: tfe_variable_set This data source is used to retrieve a named variable set @@ -46,5 +48,6 @@ The following arguments are supported: * `global` - Whether or not the variable set applies to all workspaces in the organization. * `workspaceIds` - IDs of the workspaces that use the variable set. * `variableIds` - IDs of the variables attached to the variable set. +* `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index 6d6c898ab..0af537aa4 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.48.0" + version = "~> 0.49.2" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` token = var.token - version = "~> 0.48.0" + version = "~> 0.49.2" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 589e8abf6..17f153627 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -215,4 +215,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team_project_access.html.markdown b/website/docs/cdktf/java/r/team_project_access.html.markdown index 55f5dda87..9cd5ee592 100644 --- a/website/docs/cdktf/java/r/team_project_access.html.markdown +++ b/website/docs/cdktf/java/r/team_project_access.html.markdown @@ -61,7 +61,7 @@ that affect the project itself and all workspaces in the project, by using `proj The following permissions apply to the project itself. -| project-access | Description, Default, Valid Values | +| project_access | Description, Default, Valid Values | |---------------------|---------------------------------------------| | `settings` | The permission to grant for the project's settings. Default: `read`. Valid strings: `read`, `update`, or `delete` | | `teams` | The permission to grant for the project's teams. Default: `none`, Valid strings: `none`, `read`, or `manage` | @@ -72,7 +72,7 @@ The following permissions apply to the project itself. The following permissions apply to all workpsaces (and future workspaces) in the project. -| workspace-access | Description, Default, Valid Values | +| workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| | `runs` | The permission to grant project's workspaces' runs. Default: `read`. Valid strings: `read`, `plan`, or `apply`. | | `sentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `none`. Valid strings: `none`, or `read`. | @@ -108,21 +108,23 @@ public class MyConvertedCode extends TerraformStack { ); new TeamProjectAccess(this, "custom", new TeamProjectAccessConfig() .access("custom") - .projectAccess(List.of(Map.of( - "settings", "read", - "teams", "none"))) + .projectAccess(List.of(new TeamProjectAccessProjectAccess() + .settings("read") + .teams("none") + )) .projectId(Token.asString(tfeProjectTest.getId())) .teamId(Token.asString(tfeTeamDev.getId())) - .workspaceAccess(List.of(Map.of( - "create", true, - "delete", false, - "locking", true, - "move", false, - "runTasks", false, - "runs", "apply", - "sentinelMocks", "none", - "stateVersions", "write", - "variables", "write"))) + .workspaceAccess(List.of(new TeamProjectAccessWorkspaceAccess() + .create(true) + .delete(false) + .locking(true) + .move(false) + .runTasks(false) + .runs("apply") + .sentinelMocks("none") + .stateVersions("write") + .variables("write") + )) ); } } @@ -141,4 +143,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index e8932bf56..702a048d7 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -5,6 +5,8 @@ description: |- Manages workspaces. --- + + # tfe_workspace Provides a workspace resource. @@ -74,31 +76,30 @@ public class MyConvertedCode extends TerraformStack { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `description` - (Optional) A description for the workspace. * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value or if `operations` is provided. * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. -* `autoApply` - (Optional) Whether to automatically apply changes when a - Terraform plan is successful. Defaults to `false`. +* `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. +* `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. -* `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. 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. +* `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. * `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remoteStateConsumerIds`). -* `remoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for state storage only. This value _must not_ be provided if `executionMode` is provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `projectId` - (Optional) ID of the project where the workspace should be created. * `queueAllRuns` - (Optional) Whether the workspace should start automatically performing runs immediately after its creation. Defaults to @@ -108,6 +109,7 @@ The following arguments are supported: is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. +* `remoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. * `sourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". @@ -136,15 +138,13 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. -* `workingDirectory` - (Optional) A relative path that Terraform will execute - within. Defaults to the root of your repository. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). Omit this argument to utilize the [CLI-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/cli) and [API-driven](https://developer.hashicorp.com/terraform/cloud-docs/run/api) workflows, where runs are not driven by webhooks on your VCS provider. -* `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. +* `workingDirectory` - (Optional) A relative path that Terraform will execute within. Defaults to the root of your repository. The `vcsRepo` block supports: @@ -153,11 +153,11 @@ The `vcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -181,4 +181,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/java/r/workspace_policy_set_exclusion.html.markdown new file mode 100644 index 000000000..56d566f49 --- /dev/null +++ b/website/docs/cdktf/java/r/workspace_policy_set_exclusion.html.markdown @@ -0,0 +1,79 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_policy_set_exclusion" +description: |- + Add a policy set to an excluded workspace +--- + + + +# tfe_workspace_policy_set_exclusion + +Adds and removes policy sets from an excluded workspace + +-> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. + +## Example Usage + +Basic usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.policySet.*; +import gen.providers.tfe.workspace.*; +import gen.providers.tfe.workspacePolicySetExclusion.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTest = new Organization(this, "test", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + PolicySet tfePolicySetTest = new PolicySet(this, "test_1", new PolicySetConfig() + .description("Some description.") + .name("my-policy-set") + .organization(Token.asString(tfeOrganizationTest.getName())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + Workspace tfeWorkspaceTest = new Workspace(this, "test_2", new WorkspaceConfig() + .name("my-workspace-name") + .organization(Token.asString(tfeOrganizationTest.getName())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + WorkspacePolicySetExclusion tfeWorkspacePolicySetExclusionTest = + new WorkspacePolicySetExclusion(this, "test_3", new WorkspacePolicySetExclusionConfig() + .policySetId(Token.asString(tfePolicySetTest.getId())) + .workspaceId(Token.asString(tfeWorkspaceTest.getId())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `policySetId` - (Required) ID of the policy set. +* `workspaceId` - (Required) Excluded workspace ID to add the policy set to. + +## Attributes Reference + +* `id` - The ID of the policy set attachment. ID format: `_` + +## Import + +Excluded Workspace Policy Sets can be imported; use `//`. For example: + +```shell +terraform import tfe_workspace_policy_set_exclusion.test 'my-org-name/workspace/policy-set-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_variable_set.html.markdown b/website/docs/cdktf/java/r/workspace_variable_set.html.markdown index 539a6789c..52ada170f 100644 --- a/website/docs/cdktf/java/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/java/r/workspace_variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Add a variable set to a workspace --- + + # tfe_workspace_variable_set Adds and removes variable sets from a workspace @@ -59,7 +61,7 @@ public class MyConvertedCode extends TerraformStack { The following arguments are supported: -* `variableSetId` - (Required) Name of the variable set to add. +* `variableSetId` - (Required) The variable set ID. * `workspaceId` - (Required) Workspace ID to add the variable set to. ## Attributes Reference @@ -74,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 5ef505403..7293e009c 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeAgentPool(self, "test", + tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 4307e1f6a..8a6457b5a 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345 ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding a Github App Installation by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="installation_name" ) ``` @@ -65,4 +59,4 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index e4846574b..d51c305d5 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,20 +14,17 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformOutput, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - addresses = DataTfeIpRanges(self, "addresses") - TerraformOutput(self, "notifications_ips", - value=addresses.notifications + data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") + cdktf.TerraformOutput(self, "notifications_ips", + value=data_tfe_ip_ranges_addresses.notifications ) ``` @@ -45,4 +42,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index d597ecc3c..4aec1ba13 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its service provider ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -102,4 +93,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 138cd2228..5045a6657 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization import DataTfeOrganization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganization(self, "foo", + tfe.data_tfe_organization.DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index ccd7dcf24..73670ef47 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - bar = Organization(self, "bar", + tfe_organization_bar = tfe.organization.Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - DataTfeOrganizationMembers(self, "foo", - organization=bar.name + tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", + organization=cdktf.Token.as_string(tfe_organization_bar.name) ) ``` @@ -52,4 +48,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index ffff8bf2a..cc1def6d2 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,18 +22,15 @@ be updated manually. ### Fetch by email ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -42,18 +39,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by username ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -62,18 +56,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by organization membership ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -98,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index c7ed30ddb..8429aa128 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationRunTask(self, "example", + tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -50,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 6f11a23fa..4fffc37f9 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationTags(self, "example", + tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -47,4 +44,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index b3cf933e5..292e9c76f 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organizations import DataTfeOrganizations -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizations(self, "foo") + tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -44,4 +41,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 2e4e48760..8f6ed2dc5 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -21,28 +21,25 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.random.id import Id -from imports.tfe.data_tfe_outputs import DataTfeOutputs -class MyConvertedCode(TerraformStack): +import ...gen.providers.random as random +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. # For a more precise conversion please use the --provider flag in convert. - foo = DataTfeOutputs(self, "foo", + data_tfe_outputs_foo = tfe.data_tfe_outputs.DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) - Id(self, "vpc_id", + random.id.Id(self, "vpc_id", byte_length=8, keepers=[{ - "bar": foo.values.bar + "bar": data_tfe_outputs_foo.values.bar } ] ) @@ -62,4 +59,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 1650cb017..9b8aca2a9 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_policy_set import DataTfePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfePolicySet(self, "test", + tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -67,4 +64,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index f40145ff2..4a596f35f 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_project import DataTfeProject -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeProject(self, "foo", + tfe.data_tfe_project.DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index 376cdd483..338f92bfc 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,31 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - DataTfeSamlSettings(self, "foo", - provider=admin - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -74,4 +64,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 89ee070e4..6537c5f55 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeSlug(self, "test", + data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=Token.as_string_map(test) + slug=cdktf.Token.as_string_map(data_tfe_slug_test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -51,4 +47,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index 17ae4aad2..e95a873b6 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ssh_key import DataTfeSshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeSshKey(self, "test", + tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 8dcf44b9b..3e4f2c5e4 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team import DataTfeTeam -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeam(self, "test", + tfe.data_tfe_team.DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index 6ce1b674f..9755cf929 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_access import DataTfeTeamAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamAccess(self, "test", + tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -55,4 +52,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index 0d0da5115..503c9eb11 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamProjectAccess(self, "test", + tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index a71c94d44..d812caa3c 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import DataTfeTeams -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeams(self, "foo", + tfe.data_tfe_teams.DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -42,4 +39,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 4922935a4..93b0a22c8 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeVariableSet(self, "test", + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -51,4 +48,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 77353b5c0..86ecde0ac 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,24 +16,20 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variables import DataTfeVariables -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - workspace_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -42,24 +38,21 @@ class MyConvertedCode(TerraformStack): For variable set variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -from imports.tfe.data_tfe_variables import DataTfeVariables -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeVariableSet(self, "test", + data_tfe_variable_set_test = + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - variable_set_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -87,4 +80,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 875803789..62fd9e8da 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspace(self, "test", + tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -87,4 +84,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index 58a1fb01e..31ac562e9 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceIds(self, "all", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "app-frontend", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "prod-apps", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - DataTfeWorkspaceIds(self, "prod-only", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -64,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 1cb0789a7..a278338f7 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceRunTask(self, "foobar", + tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 64422922a..352a8263c 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,13 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.49.2" + } + } +} ``` As this provider is still at version zero, you should constrain the acceptable @@ -89,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` @@ -98,27 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name, *, email, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - Organization(self, "org", - email=email, - name=name - ) +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + token = var.token + version = "~> 0.49.2" +} + +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -138,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index a73146090..09c1f631e 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,45 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.admin_organization_settings import AdminOrganizationSettings -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - a_module_consumer = Organization(self, "a-module-consumer", - email="admin@company.com", - name="my-other-org" - ) - a_module_producer = Organization(self, "a-module-producer", - email="admin@company.com", - name="my-org" - ) - AdminOrganizationSettings(self, "test-settings", - access_beta_tools=False, - global_module_sharing=False, - module_sharing_consumer_organizations=[a_module_consumer.name], - organization=a_module_producer.name, - provider="${tfe.admin}", - workspace_limit=15 - ) +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" +} + +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -76,4 +70,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index f7947edeb..ced066093 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,25 +18,21 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - AgentPool(self, "test-agent-pool", + tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), organization_scoped=True ) ``` @@ -67,4 +63,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index e4de55116..938bc6991 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -19,38 +19,27 @@ for Business account. Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test_organization = Organization(self, "test-organization", - email="admin@company.com", - name="my-org-name" - ) - test = Workspace(self, "test", - name="my-workspace-name", - organization=Token.as_string(tfe_organization_test.name) - ) - AgentPool(self, "test-agent-pool", - name="my-agent-pool-name", - organization=test_organization.name, - organization_scoped=True - ) - AgentPoolAllowedWorkspaces(self, "foobar", - agent_pool_id=Token.as_string(tfe_agent_pool_foobar.id), - allowed_workspace_ids=[test.id] - ) +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_workspace" "test" { + name = "my-workspace-name" + organization = tfe_organization.test.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = true +} + +resource "tfe_agent_pool_allowed_workspaces" "foobar" { + agent_pool_id = tfe_agent_pool.foobar.id + allowed_workspace_ids = [tfe_workspace.test.id] +} ``` ## Argument Reference @@ -70,4 +59,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 357e859cc..7cc7972c4 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,29 +17,24 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_token import AgentToken -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - AgentToken(self, "test-agent-token", - agent_pool_id=test_agent_pool.id, + tfe.agent_token.AgentToken(self, "test-agent-token", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), description="my-agent-token-name" ) ``` @@ -57,4 +52,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 678ab8cd0..797abcd7c 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,33 +16,28 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -51,33 +46,28 @@ class MyConvertedCode(TerraformStack): Creating a no-code module with variable options: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -119,4 +109,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index 39c9d68ef..d84e282c3 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,36 +19,32 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -57,43 +53,41 @@ class MyConvertedCode(TerraformStack): With `destination_type` of `email`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -102,45 +96,43 @@ class MyConvertedCode(TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -188,4 +180,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index 7b06126a3..f739902ae 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -47,18 +44,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -77,18 +71,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -130,4 +121,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index bdcc33f7b..f32912a93 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Organization(self, "test", + tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -64,4 +61,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 390a2e73c..1582dadb2 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationMembership(self, "test", + tfe.organization_membership.OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -69,4 +66,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 165fb1666..492a62139 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_module_sharing import OrganizationModuleSharing -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationModuleSharing(self, "test", + tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -43,4 +40,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 076f8a0b6..535677464 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_run_task import OrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationRunTask(self, "example", + tfe.organization_run_task.OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -63,4 +60,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index bed2c0235..66f833f7b 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationToken(self, "test", + tfe.organization_token.OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -49,28 +46,15 @@ never expire. When a token has an expiry: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - # For a more precise conversion please use the --provider flag in convert. - example = Rotating(self, "example", - rotation_days=30 - ) - OrganizationToken(self, "test", - expired_at=Token.as_string(example.rotation_rfc3339), - organization=Token.as_string(org.name) - ) +```hcl +resource "time_rotating" "example" { + rotation_days = 30 +} + +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -87,4 +71,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 793b3429b..5da71d87c 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -45,18 +42,15 @@ class MyConvertedCode(TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -97,4 +91,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index afa0bedd6..421c6b526 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,85 +21,54 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policies_path="policies/my-policy-set", - vcs_repo=PolicySetVcsRepo( - branch="main", - identifier="my-org-name/my-policy-set-repository", - ingress_submodules=False, - oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) - ), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id + } +} ``` Using manually-specified policies: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] +} ``` Manually uploaded policy set, in lieu of VCS: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test = DataTfeSlug(self, "test", - source_path="policies/my-policy-set" - ) - tfe_policy_set_test = PolicySet(self, "test_1", - description="A brand new policy set", - name="my-policy-set", - organization="my-org-name", - slug=Token.as_string_map(test), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_policy_set_test.override_logical_id("test") +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -159,4 +128,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 002101944..9758004e6 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,32 +16,28 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.policy_set_parameter import PolicySetParameter -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = + tfe.policy_set_parameter.PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=Token.as_string(tfe_policy_set_test.id), + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -73,4 +69,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index abdf640b8..0763e2626 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,25 +16,21 @@ Provides a project resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Project(self, "test", + tfe.project.Project(self, "test", name="projectname", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -59,4 +55,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index a2687c8f0..f3a5cd235 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -16,40 +16,34 @@ Adds and removes policy sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.project import Project -from imports.tfe.project_policy_set import ProjectPolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_project_test = Project(self, "test_2", + tfe_project_test = tfe.project.Project(self, "test_2", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - project_id=Token.as_string(tfe_project_test.id) + tfe_project_policy_set_test = tfe.project_policy_set.ProjectPolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + project_id=cdktf.Token.as_string(tfe_project_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_policy_set_test.override_logical_id("test") @@ -74,4 +68,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 066c7d5e0..da5561bc7 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,40 +16,35 @@ Adds and removes variable sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_3", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -74,4 +69,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 11c5bef3b..d73e2216d 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,35 +16,30 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -52,31 +47,27 @@ class MyConvertedCode(TerraformStack): Create private registry module with GitHub App: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", + data_tfe_github_app_installation_gha_installation = + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - RegistryModule(self, "petstore", - organization=test_organization.name, + tfe.registry_module.RegistryModule(self, "petstore", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=Token.as_string(gha_installation.id), + github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -85,26 +76,22 @@ class MyConvertedCode(TerraformStack): Create private registry module without VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-private-registry-module", + tfe.registry_module.RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="private" ) ``` @@ -112,27 +99,23 @@ class MyConvertedCode(TerraformStack): Create public registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-public-registry-module", + tfe.registry_module.RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) ``` @@ -140,33 +123,29 @@ class MyConvertedCode(TerraformStack): Create no-code provisioning registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", + tfe_registry_module_test_no_code_provisioning_registry_module = + tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) - NoCodeModule(self, "foobar", - organization=test_organization.id, - registry_module=test_no_code_provisioning_registry_module.id + tfe.no_code_module.NoCodeModule(self, "foobar", + organization=cdktf.Token.as_string(tfe_organization_test_organization.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) ) ``` @@ -218,4 +197,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index e49570aed..f4dd3b56c 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,34 +19,29 @@ to up to 20 source workspaces. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.run_trigger import RunTrigger -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_sourceable = Workspace(self, "test-sourceable", + tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - test_workspace = Workspace(self, "test-workspace", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - RunTrigger(self, "test", - sourceable_id=test_sourceable.id, - workspace_id=test_workspace.id + tfe.run_trigger.RunTrigger(self, "test", + sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) ) ``` @@ -70,4 +65,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index e955b370a..0fa49386c 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,28 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.provider import TfeProvider -from imports.tfe.saml_settings import SamlSettings -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=admin_token.string_value - ) - SamlSettings(self, "this", - idp_cert="foobarCertificate", - slo_endpoint_url="https://example.com/slo_endpoint_url", - sso_endpoint_url="https://example.com/sso_endpoint_url" - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -75,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index c9f5d2db2..73d0ed16c 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_policy import SentinelPolicy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelPolicy(self, "test", + tfe.sentinel_policy.SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 5a43faf22..177974c7f 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.ssh_key import SshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SshKey(self, "test", + tfe.ssh_key.SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -52,4 +49,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 5232b4f29..bec6f6a88 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): Organization Permission usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -97,4 +91,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index 0cf68d501..ab50b1a2d 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_access import TeamAccess -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = TeamAccess(self, "test_2", + tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", access="read", - team_id=test.id, - workspace_id=Token.as_string(tfe_workspace_test.id) + team_id=cdktf.Token.as_string(tfe_team_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -82,4 +77,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index cbb0466be..e146c6558 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_member import TeamMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = TeamMember(self, "test_1", - team_id=test.id, + tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -65,4 +61,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index f04aedc6e..697cfe48b 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -52,26 +48,22 @@ class MyConvertedCode(TerraformStack): With a set of usernames: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_usernames = Fn.toset(["user1", "user2"]) - test = Team(self, "test", + all_usernames = cdktf.Fn.toset(["user1", "user2"]) + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, - usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), + usernames=cdktf.Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_members_test.override_logical_id("test") @@ -96,4 +88,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index b74af25bb..5353364f6 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,32 +24,29 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_member import TeamOrganizationMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_1", + tfe_team_test = tfe.team.Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", - organization_membership_id=test.id, - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = + tfe.team_organization_member.TeamOrganizationMember(self, "test_2", + organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -75,4 +72,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 44a247b02..04ced9cca 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,36 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - sample = OrganizationMembership(self, "sample", + tfe_organization_membership_sample = + tfe.organization_membership.OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_2", + tfe_team_test = tfe.team.Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[test.id, sample.id], - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.id), + cdktf.Token.as_string(tfe_organization_membership_sample.id) + ], + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -62,38 +63,35 @@ class MyConvertedCode(TerraformStack): With a set of organization members: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformIterator, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) + all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" + ]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - all_membership_for_each_iterator = TerraformIterator.from_list( - Token.as_any(all_users)) - OrganizationMembership(self, "all_membership", - email=Token.as_string(all_membership_for_each_iterator.key), + tfe_organization_membership_all_membership_for_each_iterator = + cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) + tfe.organization_membership.OrganizationMembership(self, "all_membership", + email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), organization="my-org-name", - for_each=all_membership_for_each_iterator + for_each=tfe_organization_membership_all_membership_for_each_iterator ) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", - organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=test.id + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", + organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -115,4 +113,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index ff15b44e0..c731f4db5 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,31 +16,27 @@ Associate a team to permissions on a project. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - admin = Team(self, "admin", + tfe_team_admin = tfe.team.Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = + tfe.team_project_access.TeamProjectAccess(self, "admin_2", access="admin", - project_id=test.id, - team_id=admin.id + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_admin.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -88,36 +84,31 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - dev = Team(self, "dev", + tfe_team_dev = tfe.team.Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - TeamProjectAccess(self, "custom", + tfe.team_project_access.TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=test.id, - team_id=dev.id, + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_dev.id), workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -146,4 +137,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index 7e1f2ec67..4c90cfbb8 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = TeamToken(self, "test_1", - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -56,31 +52,27 @@ never expire. When a token has an expiry: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +import ...gen.providers.time as time +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. # For a more precise conversion please use the --provider flag in convert. - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - example = Rotating(self, "example", + time_rotating_example = time.rotating.Rotating(self, "example", rotation_days=30 ) - tfe_team_token_test = TeamToken(self, "test_2", - expired_at=Token.as_string(example.rotation_rfc3339), - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_2", + expired_at=cdktf.Token.as_string(time_rotating_example.rotation_rfc3339), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -99,4 +91,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 4945a4a2d..5d19d8f3e 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.terraform_version import TerraformVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - TerraformVersion(self, "test", + tfe.terraform_version.TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -65,4 +62,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index 364a6b27d..a32fa5e33 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,35 +16,30 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = Variable(self, "test_2", + tfe_variable_test = tfe.variable.Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -53,44 +48,39 @@ class MyConvertedCode(TerraformStack): Basic usage for variable sets: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -129,41 +119,33 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - sensitive_var = Variable(self, "sensitive_var", - category="terraform", - key="sensitive_key", - sensitive=True, - value="sensitive_value", - workspace_id=workspace.id - ) - visible_var = Variable(self, "visible_var", - category="terraform", - key="visible_key", - sensitive=False, - value="visible_value", - workspace_id=workspace.id - ) - Workspace(self, "sensitive_workspace", - name="workspace-${" + sensitive_var.value + "}", - organization="organization name" - ) - Workspace(self, "visible_workspace", - name="workspace-${" + visible_var.readable_value + "}", - organization="organization name" - ) +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" +} + ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -189,4 +171,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index e48e36c71..40dfc740b 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,115 +16,103 @@ Creates, updates and destroys variable sets. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="projectname", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_3", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_5", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -153,4 +141,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 97f02223c..d056c9ddd 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -18,25 +18,21 @@ Provides a workspace resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Workspace(self, "test", + tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), tag_names=["test", "app"] ) ``` @@ -44,32 +40,27 @@ class MyConvertedCode(TerraformStack): With `execution_mode` of `agent`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - Workspace(self, "test", - agent_pool_id=test_agent_pool.id, + tfe.workspace.Workspace(self, "test", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), execution_mode="agent", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -183,4 +174,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index c628fedb3..733784218 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set import WorkspacePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = + tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 41d31f440..5f052b546 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import WorkspacePolicySetExclusion -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=tfe_policy_set_test.id, - workspace_id=tfe_workspace_test.id + tfe_workspace_policy_set_exclusion_test = + tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -76,4 +71,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index d32e5c6e7..e79741bc7 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,52 +24,46 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - child = Workspace(self, "child", + tfe_workspace_child = tfe.workspace.Workspace(self, "child", name="child-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - ws_run_parent = WorkspaceRun(self, "ws_run_parent", + tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -82,64 +76,58 @@ class MyConvertedCode(TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) - WorkspaceRun(self, "ws_run_child", + tfe.workspace_run.WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[ws_run_parent], + depends_on=[tfe_workspace_run_ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=child.id + workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) ) ``` With manual confirmation: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -147,49 +135,43 @@ class MyConvertedCode(TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` With no retries: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -199,7 +181,7 @@ class MyConvertedCode(TerraformStack): retry=False, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` @@ -228,4 +210,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 9f1525ed7..450d01813 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,23 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.workspace_run_task import WorkspaceRunTask -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - WorkspaceRunTask(self, "example", - enforcement_level="advisory", - task_id=tfe_organization_run_task.example.id, - workspace_id=tfe_workspace.example.id - ) +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" +} ``` ## Argument Reference @@ -58,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index 29f11de9f..de6cad570 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes variable sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index 44f318eca..ffbc8593d 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeAgentPool(this, "test", { + new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 304f6a929..54c0ea219 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,20 +16,21 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - installationId: 12345, - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + installationId: 12345, + } + ); } } @@ -38,20 +39,21 @@ class MyConvertedCode extends TerraformStack { ### Finding a Github App Installation by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - name: "installation_name", - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "installation_name", + } + ); } } @@ -71,4 +73,4 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index a4c0927da..3aef65fe1 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,20 +14,21 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformOutput, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const addresses = new DataTfeIpRanges(this, "addresses", {}); - new TerraformOutput(this, "notifications_ips", { - value: addresses.notifications, + const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( + this, + "addresses", + {} + ); + new cdktf.TerraformOutput(this, "notifications_ips", { + value: dataTfeIpRangesAddresses.notifications, }); } } @@ -48,4 +49,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index e093c1f42..fd3cee123 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -38,18 +35,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -61,18 +55,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its service provider ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -111,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 80eeb599a..97f356774 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganization(this, "foo", { + new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 95b1990cb..290c8836c 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const bar = new Organization(this, "bar", { + const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new DataTfeOrganizationMembers(this, "foo", { - organization: bar.name, + new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { + organization: cdktf.Token.asString(tfeOrganizationBar.name), }); } } @@ -55,4 +51,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index 0b43f4def..a5a620a28 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,21 +22,22 @@ be updated manually. ### Fetch by email ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - email: "user@company.com", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + email: "user@company.com", + organization: "my-org-name", + } + ); } } @@ -45,21 +46,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by username ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - username: "my-username", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + username: "my-username", + } + ); } } @@ -68,21 +70,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by organization membership ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - organization_membership_id: "ou-xxxxxxxxxxx", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + } + ); } } @@ -107,4 +110,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index c1f65f0b8..1ee342ef1 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,21 +16,22 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationRunTask(this, "example", { - name: "task-name", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( + this, + "example", + { + name: "task-name", + organization: "my-org-name", + } + ); } } @@ -53,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index 75763fa62..d608cc1e3 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationTags(this, "example", { + new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -50,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index f612f9fcb..31989059d 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizations(this, "foo", {}); + new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); } } @@ -47,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index e1230ab01..9b23d1a90 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -21,29 +21,30 @@ Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as s In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Id } from "./.gen/providers/random/id"; -import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as random from "./.gen/providers/random"; +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. For a more precise conversion please use the --provider flag in convert.*/ - const foo = new DataTfeOutputs(this, "foo", { - organization: "my-org", - workspace: "my-workspace", - }); - new Id(this, "vpc_id", { + const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( + this, + "foo", + { + organization: "my-org", + workspace: "my-workspace", + } + ); + new random.id.Id(this, "vpc_id", { byte_length: 8, keepers: [ { - bar: foo.values.bar, + bar: dataTfeOutputsFoo.values.bar, }, ], }); @@ -66,4 +67,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 4ed6c1d99..2a104a3c0 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfePolicySet(this, "test", { + new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -70,4 +67,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index 875b65281..5f30b68c5 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeProject(this, "foo", { + new tfe.dataTfeProject.DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 4045d9037..eac1110a0 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,34 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new DataTfeSamlSettings(this, "foo", { - provider: admin, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token } +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -77,4 +64,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 8fe21a539..af7210b06 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeSlug(this, "test", { + const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: Token.asStringMap(test), + slug: cdktf.Token.asStringMap(dataTfeSlugTest), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -54,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 3ba919e18..0d701abdd 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeSshKey(this, "test", { + new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 97471ee15..51606205e 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeam(this, "test", { + new tfe.dataTfeTeam.DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index f09d31bf6..8cd9aea95 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamAccess(this, "test", { + new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -58,4 +55,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 0288eca84..65ed3def9 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamProjectAccess(this, "test", { + new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index db506dba9..d19832163 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeams } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeams(this, "foo", { + new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index e63ff625a..ae9a70417 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeVariableSet(this, "test", { + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -54,4 +51,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index ec9627457..93b932f9d 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,25 +16,29 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -45,25 +49,26 @@ class MyConvertedCode extends TerraformStack { For variable set variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - variableSetId: Token.asString(test.id), - }); + const dataTfeVariableSetTest = + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -93,4 +98,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index c68212b0e..26054c3ab 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspace(this, "test", { + new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -90,4 +87,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 2b9cd5008..3f83d01b9 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceIds(this, "all", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "app-frontend", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "prod-apps", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new DataTfeWorkspaceIds(this, "prod-only", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -67,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 96d78871e..7aa26820c 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceRunTask(this, "foobar", { + new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index cc5d780c6..0af537aa4 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -73,16 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.49.2" + } } } - ``` As this provider is still at version zero, you should constrain the acceptable @@ -92,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.48.0" + version = "~> 0.49.2" ... } ``` @@ -101,34 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -interface MyConfig { - email: any; - name: any; -} -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string, config: MyConfig) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - new Organization(this, "org", { - email: config.email, - name: config.name, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + token = var.token + version = "~> 0.49.2" } +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -136,7 +117,7 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. - Defaults to `appTerraformIo`. Can be overridden by setting the + Defaults to `app.terraform.io`. Can be overridden by setting the `tfeHostname` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. @@ -148,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index a6ed9a465..93f71e023 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,48 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - const aModuleConsumer = new Organization(this, "a-module-consumer", { - email: "admin@company.com", - name: "my-other-org", - }); - const aModuleProducer = new Organization(this, "a-module-producer", { - email: "admin@company.com", - name: "my-org", - }); - new AdminOrganizationSettings(this, "test-settings", { - accessBetaTools: false, - globalModuleSharing: false, - moduleSharingConsumerOrganizations: [aModuleConsumer.name], - organization: aModuleProducer.name, - provider: "${tfe.admin}", - workspaceLimit: 15, - }); - } +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" } +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -79,4 +70,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 1b3d9b210..5b7085fc6 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new AgentPool(this, "test-agent-pool", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.agentPool.AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index ff761bf4c..9458015d2 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -19,41 +19,27 @@ for Business account. Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { - name: "my-workspace-name", - organization: Token.asString(tfeOrganizationTest.name), - }); - new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - organizationScoped: true, - }); - new AgentPoolAllowedWorkspaces(this, "foobar", { - agentPoolId: Token.asString(tfeAgentPoolFoobar.id), - allowedWorkspaceIds: [test.id], - }); - } +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" } +resource "tfe_workspace" "test" { + name = "my-workspace-name" + organization = tfe_organization.test.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = true +} + +resource "tfe_agent_pool_allowed_workspaces" "foobar" { + agent_pool_id = tfe_agent_pool.foobar.id + allowed_workspace_ids = [tfe_workspace.test.id] +} ``` ## Argument Reference @@ -73,4 +59,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index 530a19d6a..e37e6da4d 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,29 +17,32 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentToken } from "./.gen/providers/tfe/agent-token"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.id, - }); - new AgentToken(this, "test-agent-token", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.agentToken.AgentToken(this, "test-agent-token", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), description: "my-agent-token-name", }); } @@ -60,4 +63,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index bd4c0def0..f740a6434 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,34 +16,41 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -54,46 +61,53 @@ class MyConvertedCode extends TerraformStack { Creating a no-code module with variable options: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -127,4 +141,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index f772d9699..81ee6208b 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { - name: "my-workspace-name", - organization: test.id, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_2", + "test", { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: Token.asString(tfeWorkspaceTest.id), + email: "admin@company.com", + name: "my-org-name", } ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,52 +64,50 @@ class MyConvertedCode extends TerraformStack { With `destinationType` of `email`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -120,57 +118,55 @@ class MyConvertedCode extends TerraformStack { (**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -220,4 +216,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 5fe9abf31..da2e6cca5 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -50,18 +47,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -84,18 +78,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -142,4 +133,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 94f77e3c1..cbaab56b4 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Organization(this, "test", { + new tfe.organization.Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -67,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index af3a1efb7..1ba96fccd 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationMembership(this, "test", { + new tfe.organizationMembership.OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -72,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 6b1954c0d..7a8d6f4bc 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationModuleSharing(this, "test", { + new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -46,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index c7b69cabc..af88749b5 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationRunTask(this, "example", { + new tfe.organizationRunTask.OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index d37a973cf..13d4d4730 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationToken(this, "test", { + new tfe.organizationToken.OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -52,31 +49,15 @@ never expire. When a token has an expiry: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - For a more precise conversion please use the --provider flag in convert.*/ - const example = new Rotating(this, "example", { - rotation_days: 30, - }); - new OrganizationToken(this, "test", { - expiredAt: Token.asString(example.rotationRfc3339), - organization: Token.asString(org.name), - }); - } +```hcl +resource "time_rotating" "example" { + rotation_days = 30 } +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -93,4 +74,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index e5f2e8540..d99b59da7 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -48,18 +45,15 @@ class MyConvertedCode extends TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -103,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 0d970bf07..8d382fa79 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,94 +21,54 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policiesPath: "policies/my-policy-set", - vcsRepo: { - branch: "main", - identifier: "my-org-name/my-policy-set-repository", - ingressSubmodules: false, - oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), - }, - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id } } - ``` Using manually-specified policies: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policyIds: [Token.asString(tfeSentinelPolicyTest.id)], - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - } +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } - ``` Manually uploaded policy set, in lieu of VCS: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new DataTfeSlug(this, "test", { - sourcePath: "policies/my-policy-set", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { - description: "A brand new policy set", - name: "my-policy-set", - organization: "my-org-name", - slug: Token.asStringMap(test), - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfePolicySetTest.overrideLogicalId("test"); - } +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" } +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -168,4 +128,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index c1cd54e3d..f7d672c9d 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = + new tfe.policySetParameter.PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index eaee9c086..06087bc21 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Project(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.project.Project(this, "test", { name: "projectname", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 90a574997..86709c22d 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -16,41 +16,43 @@ Adds and removes policy sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new Project(this, "test_2", { + const tfeProjectTest = new tfe.project.Project(this, "test_2", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - projectId: Token.asString(tfeProjectTest.id), - }); + const tfeProjectPolicySetTest = new tfe.projectPolicySet.ProjectPolicySet( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + projectId: cdktf.Token.asString(tfeProjectTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectPolicySetTest.overrideLogicalId("test"); } @@ -77,4 +79,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index a973a2f2d..62fa66b9d 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -16,41 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_3", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); } @@ -77,4 +76,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index d318812d2..4e29b136c 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,35 +16,42 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -55,35 +62,37 @@ class MyConvertedCode extends TerraformStack { Create private registry module with GitHub App: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const ghaInstallation = new DataTfeGithubAppInstallation( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "gha_installation", + "test-organization", { - name: "YOUR_GH_NAME", + email: "admin@company.com", + name: "my-org-name", } ); - new RegistryModule(this, "petstore", { - organization: testOrganization.name, + const dataTfeGithubAppInstallationGhaInstallation = + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "YOUR_GH_NAME", + } + ); + new tfe.registryModule.RegistryModule(this, "petstore", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: Token.asString(ghaInstallation.id), + githubAppInstallationId: cdktf.Token.asString( + dataTfeGithubAppInstallationGhaInstallation.id + ), identifier: "GH_NAME/REPO_NAME", }, }); @@ -95,28 +104,34 @@ class MyConvertedCode extends TerraformStack { Create private registry module without VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-private-registry-module", { - moduleProvider: "my_provider", - name: "another_test_module", - organization: testOrganization.name, - registryName: "private", - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule( + this, + "test-private-registry-module", + { + moduleProvider: "my_provider", + name: "another_test_module", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "private", + } + ); } } @@ -125,27 +140,27 @@ class MyConvertedCode extends TerraformStack { Create public registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-public-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), registryName: "public", }); } @@ -156,37 +171,41 @@ class MyConvertedCode extends TerraformStack { Create no-code provisioning registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testNoCodeProvisioningRegistryModule = new RegistryModule( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "test-no-code-provisioning-registry-module", + "test-organization", { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: testOrganization.name, - registryName: "public", + email: "admin@company.com", + name: "my-org-name", } ); - new NoCodeModule(this, "foobar", { - organization: testOrganization.id, - registryModule: testNoCodeProvisioningRegistryModule.id, + const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = + new tfe.registryModule.RegistryModule( + this, + "test-no-code-provisioning-registry-module", + { + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "public", + } + ); + new tfe.noCodeModule.NoCodeModule(this, "foobar", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + registryModule: cdktf.Token.asString( + tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id + ), }); } } @@ -241,4 +260,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 89588e323..dcfe00943 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,34 +19,41 @@ to up to 20 source workspaces. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testSourceable = new Workspace(this, "test-sourceable", { - name: "my-sourceable-workspace-name", - organization: testOrganization.id, - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.id, - }); - new RunTrigger(this, "test", { - sourceableId: testSourceable.id, - workspaceId: testWorkspace.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( + this, + "test-sourceable", + { + name: "my-sourceable-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.runTrigger.RunTrigger(this, "test", { + sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), }); } } @@ -73,4 +80,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index d73db9393..430a810e7 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,31 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TfeProvider } from "./.gen/providers/tfe/provider"; -import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new SamlSettings(this, "this", { - idpCert: "foobarCertificate", - sloEndpointUrl: "https://example.com/slo_endpoint_url", - ssoEndpointUrl: "https://example.com/sso_endpoint_url", - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token } +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -78,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 8b6cdfcf7..206276ff4 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelPolicy(this, "test", { + new tfe.sentinelPolicy.SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -69,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 8124e2b2f..90680d24c 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SshKey } from "./.gen/providers/tfe/ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SshKey(this, "test", { + new tfe.sshKey.SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -55,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index f9fd2da7d..b793d408b 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -39,18 +36,15 @@ class MyConvertedCode extends TerraformStack { Organization Permission usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -103,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 97c4e80f1..8af746faa 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamAccess } from "./.gen/providers/tfe/team-access"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { access: "read", - teamId: test.id, - workspaceId: Token.asString(tfeWorkspaceTest.id), + teamId: cdktf.Token.asString(tfeTeamTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -85,4 +80,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index 045b3bec9..eb7cf719c 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMember } from "./.gen/providers/tfe/team-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new TeamMember(this, "test_1", { - teamId: test.id, + const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -68,4 +64,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index c1940fcc2..5ca27b059 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -55,26 +51,22 @@ class MyConvertedCode extends TerraformStack { With a set of usernames: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsernames = Fn.toset(["user1", "user2"]); - const test = new Team(this, "test", { + const allUsernames = cdktf.Fn.toset(["user1", "user2"]); + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, - usernames: Token.asList( + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), + usernames: cdktf.Token.asList( "${[ for user in ${" + allUsernames + "} : user]}" ), }); @@ -104,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index cb37b34f4..1eec91879 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,37 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_1", { + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( - this, - "test_2", - { - organizationMembershipId: test.id, - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMemberTest = + new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { + organizationMembershipId: cdktf.Token.asString( + tfeOrganizationMembershipTest.id + ), + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -82,4 +77,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 8480e22d9..ba1476eec 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,41 +24,38 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const sample = new OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_2", { + const tfeOrganizationMembershipSample = + new tfe.organizationMembership.OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_3", - { - organizationMembershipIds: [test.id, sample.id], - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { + organizationMembershipIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.id), + cdktf.Token.asString(tfeOrganizationMembershipSample.id), + ], + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -69,48 +66,48 @@ class MyConvertedCode extends TerraformStack { With a set of organization members: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); + const allUsers = cdktf.Fn.toset([ + "user1@hashicorp.com", + "user2@hashicorp.com", + ]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const allMembershipForEachIterator = TerraformIterator.fromList( - Token.asAny(allUsers) + const tfeOrganizationMembershipAllMembershipForEachIterator = + cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); + new tfe.organizationMembership.OrganizationMembership( + this, + "all_membership", + { + email: cdktf.Token.asString( + tfeOrganizationMembershipAllMembershipForEachIterator.key + ), + organization: "my-org-name", + forEach: tfeOrganizationMembershipAllMembershipForEachIterator, + } ); - new OrganizationMembership(this, "all_membership", { - email: Token.asString(allMembershipForEachIterator.key), - organization: "my-org-name", - forEach: allMembershipForEachIterator, - }); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_2", - { - organizationMembershipIds: Token.asList( + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { + organizationMembershipIds: cdktf.Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: test.id, - } - ); + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -134,4 +131,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 4c9e1f8f8..db12e574d 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,32 +16,28 @@ Associate a team to permissions on a project. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const admin = new Team(this, "admin", { + const tfeTeamAdmin = new tfe.team.Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: test.id, - teamId: admin.id, - }); + const tfeTeamProjectAccessAdmin = + new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamAdmin.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -91,28 +87,23 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const dev = new Team(this, "dev", { + const tfeTeamDev = new tfe.team.Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new TeamProjectAccess(this, "custom", { + new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -120,8 +111,8 @@ class MyConvertedCode extends TerraformStack { teams: "none", }, ], - projectId: test.id, - teamId: dev.id, + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamDev.id), workspaceAccess: [ { create: true, @@ -154,4 +145,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index 1b0eeb542..f450192af 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new TeamToken(this, "test_1", { - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -59,31 +55,27 @@ never expire. When a token has an expiry: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +import * as time from "./.gen/providers/time"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const example = new Rotating(this, "example", { + const timeRotatingExample = new time.rotating.Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new TeamToken(this, "test_2", { - expiredAt: Token.asString(example.rotationRfc3339), - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { + expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -105,4 +97,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 18d301451..f122ae910 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new TerraformVersion(this, "test", { + new tfe.terraformVersion.TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -68,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 015d5d326..1d442d61a 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,35 +16,34 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new Variable(this, "test_2", { + const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: Token.asString(tfeWorkspaceTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -56,44 +55,43 @@ class MyConvertedCode extends TerraformStack { Basic usage for variable sets: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -135,42 +133,31 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const sensitiveVar = new Variable(this, "sensitive_var", { - category: "terraform", - key: "sensitive_key", - sensitive: true, - value: "sensitive_value", - workspaceId: workspace.id, - }); - const visibleVar = new Variable(this, "visible_var", { - category: "terraform", - key: "visible_key", - sensitive: false, - value: "visible_value", - workspaceId: workspace.id, - }); - new Workspace(this, "sensitive_workspace", { - name: "workspace-${" + sensitiveVar.value + "}", - organization: "organization name", - }); - new Workspace(this, "visible_workspace", { - name: "workspace-${" + visibleVar.readableValue + "}", - organization: "organization name", - }); - } +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" } ``` @@ -198,4 +185,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index 106d723e6..fdb8480e8 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,75 +16,68 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "projectname", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_3", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_4", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -94,44 +87,43 @@ class MyConvertedCode extends TerraformStack { Creating a global variable set: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -163,4 +155,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 0e9cecb61..17da01aec 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -18,25 +18,25 @@ Provides a workspace resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), tagNames: ["test", "app"], }); } @@ -47,32 +47,37 @@ class MyConvertedCode extends TerraformStack { With `executionMode` of `agent`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - }); - new Workspace(this, "test", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + } + ); + new tfe.workspace.Workspace(this, "test", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), executionMode: "agent", name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -189,4 +194,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index f1f0420c9..08afbc792 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -18,41 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = + new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -79,4 +78,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 1b4da302f..2bca759b3 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -18,45 +18,44 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( - this, - "test_3", - { - policy_set_id: tfePolicySetTest.id, - workspace_id: tfeWorkspaceTest.id, - } - ); + const tfeWorkspacePolicySetExclusionTest = + new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -83,4 +82,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 466abe78e..f1875dbe2 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -24,80 +24,82 @@ The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or Basic usage with multiple workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const child = new Workspace(this, "child", { + const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { name: "child-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, - }, - }); - const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: parent.id, }); - new WorkspaceRun(this, "ws_run_child", { + const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( + this, + "ws_run_parent", + { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, + }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + } + ); + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [wsRunParent], + dependsOn: [tfeWorkspaceRunWsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: child.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), }); } } @@ -107,42 +109,40 @@ class MyConvertedCode extends TerraformStack { With manual confirmation: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -160,42 +160,40 @@ class MyConvertedCode extends TerraformStack { With no retries: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -205,7 +203,7 @@ class MyConvertedCode extends TerraformStack { retry: false, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -237,4 +235,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 4a9ed1f46..2af33a4b9 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,26 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new WorkspaceRunTask(this, "example", { - enforcementLevel: "advisory", - taskId: tfeOrganizationRunTask.example.id, - workspaceId: tfeWorkspace.example.id, - }); - } +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" } - ``` ## Argument Reference @@ -61,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index aa89dcd59..946d0f324 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -18,45 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_3", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -83,4 +78,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 6849cb2425783f5f93777d22f56eecc53e764507 Mon Sep 17 00:00:00 2001 From: Jeff Bonhag Date: Fri, 6 Oct 2023 11:18:14 -0400 Subject: [PATCH 048/420] fix example, set organization_scoped: false --- .../agent_pool_allowed_workspaces.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/website/docs/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/r/agent_pool_allowed_workspaces.html.markdown index eed9f2209..e09424a53 100644 --- a/website/docs/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/r/agent_pool_allowed_workspaces.html.markdown @@ -23,20 +23,20 @@ resource "tfe_organization" "test-organization" { email = "admin@company.com" } -resource "tfe_workspace" "test" { +resource "tfe_workspace" "test-workspace" { name = "my-workspace-name" - organization = tfe_organization.test.name + organization = tfe_organization.test-organization.name } resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false } -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] +resource "tfe_agent_pool_allowed_workspaces" "test-allowed-workspaces" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [tfe_workspace.test-workspace.id] } ``` From 25ff70ad45e5692ae6664d923425047e3e9ba428 Mon Sep 17 00:00:00 2001 From: Jeff Bonhag Date: Fri, 6 Oct 2023 11:26:52 -0400 Subject: [PATCH 049/420] Add note about setting organization_scoped on agent pool --- website/docs/r/agent_pool.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/agent_pool.html.markdown b/website/docs/r/agent_pool.html.markdown index ea19dbc20..50ef50a10 100644 --- a/website/docs/r/agent_pool.html.markdown +++ b/website/docs/r/agent_pool.html.markdown @@ -34,7 +34,7 @@ The following arguments are supported: * `name` - (Required) Name of the agent pool. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `organization_scoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. +* `organization_scoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. Should be `false` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference From 2750cf5e892ad4cb6c05014b19eda88ea448e0db Mon Sep 17 00:00:00 2001 From: Isaac Collins <122894610+isaacmcollins@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:18:33 -0600 Subject: [PATCH 050/420] Add ValidateFunc to resc TFE_Project name --- internal/provider/resource_tfe_project.go | 6 +++ .../provider/resource_tfe_project_test.go | 46 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index 45f634511..c4f1f5dc5 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -13,6 +13,7 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) var projectIDRegexp = regexp.MustCompile("^prj-[a-zA-Z0-9]{16}$") @@ -31,6 +32,11 @@ func resourceTFEProject() *schema.Resource { "name": { Type: schema.TypeString, Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(3, 36), + validation.StringMatch(regexp.MustCompile(`\A[\w\_\- ]+\z`), + "can only include letters, numbers, spaces, -, and _."), + ), }, "organization": { diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index b456d84dd..0dd424ae6 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -6,6 +6,7 @@ package provider import ( "fmt" "math/rand" + "regexp" "testing" "time" @@ -40,6 +41,26 @@ func TestAccTFEProject_basic(t *testing.T) { }) } +func TestAccTFEProject_invalidName(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEProject_invalidNameChar(rInt), + ExpectError: regexp.MustCompile(`can only include letters, numbers, spaces, -, and _.`), + }, + { + Config: testAccTFEProject_invalidNameLen(rInt), + ExpectError: regexp.MustCompile(`expected length of name to be in the range \(3 - 36\),`), + }, + }, + }) +} + func TestAccTFEProject_update(t *testing.T) { project := &tfe.Project{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -128,6 +149,31 @@ resource "tfe_project" "foobar" { }`, rInt) } +func testAccTFEProject_invalidNameChar(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_project" "foobar" { + organization = tfe_organization.foobar.name + name = "invalidchar#" +}`, rInt) +} +func testAccTFEProject_invalidNameLen(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_project" "foobar" { + organization = tfe_organization.foobar.name + name = "aa" +}`, rInt) +} + func testAccCheckTFEProjectDestroy(s *terraform.State) error { config := testAccProvider.Meta().(ConfiguredClient) From c19b0db3e458655782e979b5db3a99f0ebc33e1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:17:42 +0000 Subject: [PATCH 051/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 61894544f..e43335f6d 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect - github.com/hashicorp/terraform-plugin-framework v1.4.0 + github.com/hashicorp/terraform-plugin-framework v1.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.19.0 github.com/hashicorp/terraform-plugin-mux v0.12.0 diff --git a/go.sum b/go.sum index c7e1583e8..2e8f6a04e 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81Sp github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= -github.com/hashicorp/terraform-plugin-framework v1.4.0 h1:WKbtCRtNrjsh10eA7NZvC/Qyr7zp77j+D21aDO5th9c= -github.com/hashicorp/terraform-plugin-framework v1.4.0/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0= +github.com/hashicorp/terraform-plugin-framework v1.4.1 h1:ZC29MoB3Nbov6axHdgPbMz7799pT5H8kIrM8YAsaVrs= +github.com/hashicorp/terraform-plugin-framework v1.4.1/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= From b4b41327c3afde0f442860d65713cc5a267d010d Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 9 Oct 2023 15:14:06 -0600 Subject: [PATCH 052/420] Add client caching by config, extract client and logging packages' This reverts commit c5b0a2b0b8943e8fb024d671d1c484a8085a6169. --- internal/client/client.go | 263 +++++++++++ internal/client/config.go | 254 +++++++++++ internal/client/config_test.go | 158 +++++++ internal/{provider => client}/config_unix.go | 2 +- .../{provider => client}/config_windows.go | 2 +- internal/client/init.go | 19 + internal/{provider => logging}/logging.go | 2 +- internal/provider/plugin_provider.go | 3 +- internal/provider/provider.go | 412 +----------------- internal/provider/provider_next.go | 3 +- internal/provider/provider_test.go | 156 +------ 11 files changed, 707 insertions(+), 567 deletions(-) create mode 100644 internal/client/client.go create mode 100644 internal/client/config.go create mode 100644 internal/client/config_test.go rename internal/{provider => client}/config_unix.go (98%) rename internal/{provider => client}/config_windows.go (98%) create mode 100644 internal/client/init.go rename internal/{provider => logging}/logging.go (99%) diff --git a/internal/client/client.go b/internal/client/client.go new file mode 100644 index 000000000..c058b4902 --- /dev/null +++ b/internal/client/client.go @@ -0,0 +1,263 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package client + +import ( + "errors" + "fmt" + "log" + "net/url" + "os" + "sort" + "strings" + "sync" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/go-version" + providerVersion "github.com/hashicorp/terraform-provider-tfe/version" + svchost "github.com/hashicorp/terraform-svchost" + "github.com/hashicorp/terraform-svchost/disco" +) + +const ( + DefaultHostname = "app.terraform.io" +) + +var ( + ErrMissingAuthToken = errors.New("required token could not be found. Please set the token using an input variable in the provider configuration block or by using the TFE_TOKEN environment variable") + tfeServiceIDs = []string{"tfe.v2.2"} +) + +type ClientConfigMap struct { + mu sync.Mutex + values map[string]*tfe.Client +} + +func (c *ClientConfigMap) GetByConfig(config *ClientConfiguration) *tfe.Client { + if c.mu.TryLock() { + defer c.Unlock() + } + + return c.values[config.Key()] +} + +func (c *ClientConfigMap) Lock() { + c.mu.Lock() +} + +func (c *ClientConfigMap) Unlock() { + c.mu.Unlock() +} + +func (c *ClientConfigMap) Set(client *tfe.Client, config *ClientConfiguration) { + if c.mu.TryLock() { + defer c.Unlock() + } + c.values[config.Key()] = client +} + +func getTokenFromEnv() string { + log.Printf("[DEBUG] TFE_TOKEN used for token value") + return os.Getenv("TFE_TOKEN") +} + +func getTokenFromCreds(services *disco.Disco, hostname svchost.Hostname) string { + log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %s...", hostname) + creds, err := services.CredentialsForHost(hostname) + if err != nil { + log.Printf("[DEBUG] Failed to get credentials for %s: %s (ignoring)", hostname, err) + } + if creds != nil { + return creds.Token() + } + return "" +} + +// GetClient encapsulates the logic for configuring a go-tfe client instance for +// the provider, including fallback to values from environment variables. This +// is useful because we're muxing multiple provider servers together and each +// one needs an identically configured client. +// +// Internally, this function caches configured clients using the specified +// parameters +func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { + config, err := configure(tfeHost, token, insecure) + if err != nil { + return nil, err + } + + clientCache.Lock() + defer clientCache.Unlock() + + // Try to retrieve the client from cache + cached := clientCache.GetByConfig(config) + if cached != nil { + return cached, nil + } + + // Discover the Terraform Enterprise address. + host, err := config.Services.Discover(config.TFEHost) + if err != nil { + return nil, err + } + + // Get the full Terraform Enterprise service address. + var address *url.URL + var discoErr error + for _, tfeServiceID := range tfeServiceIDs { + service, err := host.ServiceURL(tfeServiceID) + if _, ok := err.(*disco.ErrVersionNotSupported); !ok && err != nil { + return nil, err + } + // If discoErr is nil we save the first error. When multiple services + // are checked and we found one that didn't give an error we need to + // reset the discoErr. So if err is nil, we assign it as well. + if discoErr == nil || err == nil { + discoErr = err + } + if service != nil { + address = service + break + } + } + + if providerVersion.ProviderVersion != "dev" { + // We purposefully ignore the error and return the previous error, as + // checking for version constraints is considered optional. + constraints, _ := host.VersionConstraints(tfeServiceIDs[0], "tfe-provider") + + // First check any constraints we might have received. + if constraints != nil { + if err := CheckConstraints(constraints); err != nil { + return nil, err + } + } + } + + // When we don't have any constraints errors, also check for discovery + // errors before we continue. + if discoErr != nil { + return nil, discoErr + } + + // Create a new TFE client. + client, err := tfe.NewClient(&tfe.Config{ + Address: address.String(), + Token: token, + HTTPClient: config.HTTPClient, + }) + if err != nil { + return nil, err + } + + client.RetryServerErrors(true) + clientCache.Set(client, config) + + return client, nil +} + +// CheckConstraints checks service version constrains against our own +// version and returns rich and informational diagnostics in case any +// incompatibilities are detected. +func CheckConstraints(c *disco.Constraints) error { + if c == nil || c.Minimum == "" || c.Maximum == "" { + return nil + } + + // Generate a parsable constraints string. + excluding := "" + if len(c.Excluding) > 0 { + excluding = fmt.Sprintf(", != %s", strings.Join(c.Excluding, ", != ")) + } + constStr := fmt.Sprintf(">= %s%s, <= %s", c.Minimum, excluding, c.Maximum) + + // Create the constraints to check against. + constraints, err := version.NewConstraint(constStr) + if err != nil { + return checkConstraintsWarning(err) + } + + // Create the version to check. + v, err := version.NewVersion(providerVersion.ProviderVersion) + if err != nil { + return checkConstraintsWarning(err) + } + + // Return if we satisfy all constraints. + if constraints.Check(v) { + return nil + } + + // Find out what action (upgrade/downgrade) we should advice. + minimum, err := version.NewVersion(c.Minimum) + if err != nil { + return checkConstraintsWarning(err) + } + + maximum, err := version.NewVersion(c.Maximum) + if err != nil { + return checkConstraintsWarning(err) + } + + var excludes []*version.Version + for _, exclude := range c.Excluding { + v, err := version.NewVersion(exclude) + if err != nil { + return checkConstraintsWarning(err) + } + excludes = append(excludes, v) + } + + // Sort all the excludes. + sort.Sort(version.Collection(excludes)) + + var action, toVersion string + switch { + case minimum.GreaterThan(v): + action = "upgrade" + toVersion = ">= " + minimum.String() + case maximum.LessThan(v): + action = "downgrade" + toVersion = "<= " + maximum.String() + case len(excludes) > 0: + // Get the latest excluded version. + action = "upgrade" + toVersion = "> " + excludes[len(excludes)-1].String() + } + + switch { + case len(excludes) == 1: + excluding = fmt.Sprintf(", excluding version %s", excludes[0].String()) + case len(excludes) > 1: + var vs []string + for _, v := range excludes { + vs = append(vs, v.String()) + } + excluding = fmt.Sprintf(", excluding versions %s", strings.Join(vs, ", ")) + default: + excluding = "" + } + + summary := fmt.Sprintf("Incompatible TFE provider version v%s", v.String()) + details := fmt.Sprintf( + "The configured Terraform Enterprise backend is compatible with TFE provider\n"+ + "versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding, + ) + + if action != "" && toVersion != "" { + summary = fmt.Sprintf("Please %s the TFE provider to %s", action, toVersion) + } + + // Return the customized and informational error message. + return fmt.Errorf("%s\n\n%s", summary, details) +} + +func checkConstraintsWarning(err error) error { + return fmt.Errorf( + "failed to check version constraints: %v\n\n"+ + "checking version constraints is considered optional, but this is an\n"+ + "unexpected error which should be reported", + err, + ) +} diff --git a/internal/client/config.go b/internal/client/config.go new file mode 100644 index 000000000..855c949f5 --- /dev/null +++ b/internal/client/config.go @@ -0,0 +1,254 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package client + +import ( + "crypto/sha256" + "crypto/tls" + "fmt" + "log" + "net/http" + "os" + "strconv" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/hcl" + "github.com/hashicorp/terraform-provider-tfe/internal/logging" + providerVersion "github.com/hashicorp/terraform-provider-tfe/version" + svchost "github.com/hashicorp/terraform-svchost" + "github.com/hashicorp/terraform-svchost/auth" + "github.com/hashicorp/terraform-svchost/disco" +) + +var ( + // TFEUserAgent is the user agent string sent with all requests made by the provider + TFEUserAgent = fmt.Sprintf("terraform-provider-tfe/%s", providerVersion.ProviderVersion) +) + +type CredentialsMap map[string]map[string]interface{} + +// CLIHostConfig is the structure of the configuration for the Terraform CLI. +type CLIHostConfig struct { + Hosts map[string]*ConfigHost `hcl:"host"` + Credentials CredentialsMap `hcl:"credentials"` +} + +// ConfigHost is the structure of the "host" nested block within the CLI +// configuration, which can be used to override the default service host +// discovery behavior for a particular hostname. +type ConfigHost struct { + Services map[string]interface{} `hcl:"services"` +} + +// ClientConfiguration is the refined information needed to configure a tfe.Client +type ClientConfiguration struct { + Services *disco.Disco + HTTPClient *http.Client + TFEHost svchost.Hostname + Token string + Insecure bool +} + +// Key returns a string that is comparable to other ClientConfiguration values +func (c ClientConfiguration) Key() string { + return fmt.Sprintf("%x %s/%v", sha256.New().Sum([]byte(c.Token)), c.TFEHost, c.Insecure) +} + +// cliConfig tries to find and parse the configuration of the Terraform CLI. +// This is an optional step, so any errors are ignored. +func cliConfig() CLIHostConfig { + mainConfig := CLIHostConfig{} + credentialsConfig := CLIHostConfig{} + combinedConfig := CLIHostConfig{} + + // Main CLI config file; might contain manually-entered credentials, and/or + // some host service discovery objects. Location is configurable via + // environment variables. + configFilePath := locateConfigFile() + if configFilePath != "" { + mainConfig = readCliConfigFile(configFilePath) + } + + // Credentials file; might contain credentials auto-configured by terraform + // login. Location isn't configurable. + credentialsFilePath, err := credentialsFile() + if err != nil { + log.Printf("[ERROR] Error detecting default credentials file path: %s", err) + } else { + credentialsConfig = readCliConfigFile(credentialsFilePath) + } + + // Use host service discovery configs from main config file. + combinedConfig.Hosts = mainConfig.Hosts + + // Combine both sets of credentials. Per Terraform's own behavior, the main + // config file overrides the credentials file if they have any overlapping + // hostnames. + combinedConfig.Credentials = credentialsConfig.Credentials + if combinedConfig.Credentials == nil { + combinedConfig.Credentials = make(map[string]map[string]interface{}) + } + for host, creds := range mainConfig.Credentials { + combinedConfig.Credentials[host] = creds + } + + return combinedConfig +} + +func locateConfigFile() string { + // To find the main CLI config file, follow Terraform's own logic: try + // TF_CLI_CONFIG_FILE, then try TERRAFORM_CONFIG, then try the default + // location. + + if os.Getenv("TF_CLI_CONFIG_FILE") != "" { + return os.Getenv("TF_CLI_CONFIG_FILE") + } + + if os.Getenv("TERRAFORM_CONFIG") != "" { + return os.Getenv("TERRAFORM_CONFIG") + } + filePath, err := configFile() + if err != nil { + log.Printf("[ERROR] Error detecting default CLI config file path: %s", err) + return "" + } + + return filePath +} + +// All the errors returned by the helper methods called in this function get ignored (down the road we throw an error when all auth methods have failed.) We only use these errors to log warnings to the user. +func readCliConfigFile(configFilePath string) CLIHostConfig { + config := CLIHostConfig{} + + // Read the CLI config file content. + content, err := os.ReadFile(configFilePath) + if err != nil { + log.Printf("[WARN] Unable to read CLI config or credentials file %s: %v", configFilePath, err) + return config + } + + // Parse the CLI config file content. + obj, err := hcl.Parse(string(content)) + if err != nil { + log.Printf("[WARN] Unable to parse CLI config or credentials file %s: %v", configFilePath, err) + return config + } + + // Decode the CLI config file content. + if err := hcl.DecodeObject(&config, obj); err != nil { + log.Printf("[WARN] Unable to decode CLI config or credentials file %s: %v", configFilePath, err) + } + + return config +} + +func credentialsSource(credentials CredentialsMap) auth.CredentialsSource { + creds := auth.NoCredentials + + // Add all configured credentials to the credentials source. + if len(credentials) > 0 { + staticTable := map[svchost.Hostname]map[string]interface{}{} + for userHost, creds := range credentials { + host, err := svchost.ForComparison(userHost) + if err != nil { + // We expect the config was already validated by the time we get + // here, so we'll just ignore invalid hostnames. + continue + } + staticTable[host] = creds + } + creds = auth.StaticCredentialsSource(staticTable) + } + + return creds +} + +// configure accepts the provider-level configuration values and creates a +// clientConfiguration using fallback values from the environment or CLI configuration. +func configure(tfeHost, token string, insecure bool) (*ClientConfiguration, error) { + if tfeHost == "" { + if os.Getenv("TFE_HOSTNAME") != "" { + tfeHost = os.Getenv("TFE_HOSTNAME") + } else { + tfeHost = DefaultHostname + } + } + log.Printf("[DEBUG] Configuring client for host %q", tfeHost) + + // If ssl_skip_verify is false, it is either set that way in configuration or unset. Check + // the environment to see if it was set to true there. Strictly speaking, this means that + // the env var can override an explicit 'false' in configuration (which is not true of the + // other settings), but that's how it goes with a boolean zero value. + var err error + if !insecure && os.Getenv("TFE_SSL_SKIP_VERIFY") != "" { + v := os.Getenv("TFE_SSL_SKIP_VERIFY") + insecure, err = strconv.ParseBool(v) + if err != nil { + return nil, err + } + } + + // Configure the certificate verification options. + if insecure { + log.Printf("[DEBUG] Warning: Client configured to skip certificate verifications") + } + + // Parse the hostname for comparison, + hostname, err := svchost.ForComparison(tfeHost) + if err != nil { + return nil, err + } + + httpClient := tfe.DefaultConfig().HTTPClient + + // Make sure the transport has a TLS config. + transport := httpClient.Transport.(*http.Transport) + if transport.TLSClientConfig == nil { + transport.TLSClientConfig = &tls.Config{MinVersion: tls.VersionTLS12} + } + + transport.TLSClientConfig.InsecureSkipVerify = insecure + + // Get the Terraform CLI configuration. + config := cliConfig() + + // Create a new credential source and service discovery object. + credsSrc := credentialsSource(config.Credentials) + services := disco.NewWithCredentialsSource(credsSrc) + services.SetUserAgent(TFEUserAgent) + services.Transport = logging.NewLoggingTransport("TFE", transport) + + // Add any static host configurations service discovery object. + for userHost, hostConfig := range config.Hosts { + host, err := svchost.ForComparison(userHost) + if err != nil { + // ignore invalid hostnames. + continue + } + services.ForceHostServices(host, hostConfig.Services) + } + + // If a token wasn't set in the provider configuration block, try and fetch it + // from the environment or from Terraform's CLI configuration or configured credential helper. + if token == "" { + if os.Getenv("TFE_TOKEN") != "" { + token = getTokenFromEnv() + } else { + token = getTokenFromCreds(services, hostname) + } + } + + // If we still don't have a token at this point, we return an error. + if token == "" { + return nil, ErrMissingAuthToken + } + + return &ClientConfiguration{ + Services: services, + HTTPClient: httpClient, + TFEHost: hostname, + Token: token, + Insecure: insecure, + }, nil +} diff --git a/internal/client/config_test.go b/internal/client/config_test.go new file mode 100644 index 000000000..e985bd2c7 --- /dev/null +++ b/internal/client/config_test.go @@ -0,0 +1,158 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package client + +import ( + "os" + "testing" +) + +func TestConfig_locateConfigFile(t *testing.T) { + originalHome := os.Getenv("HOME") + originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") + originalTerraformConfig := os.Getenv("TERRAFORM_CONFIG") + reset := func() { + os.Setenv("HOME", originalHome) + if originalTfCliConfigFile != "" { + os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) + } else { + os.Unsetenv("TF_CLI_CONFIG_FILE") + } + if originalTerraformConfig != "" { + os.Setenv("TERRAFORM_CONFIG", originalTerraformConfig) + } else { + os.Unsetenv("TERRAFORM_CONFIG") + } + } + defer reset() + + // Use a predictable value for $HOME + os.Setenv("HOME", "/Users/someone") + + setup := func(tfCliConfigFile, terraformConfig string) { + os.Setenv("TF_CLI_CONFIG_FILE", tfCliConfigFile) + os.Setenv("TERRAFORM_CONFIG", terraformConfig) + } + + cases := map[string]struct { + tfCliConfigFile string + terraformConfig string + result string + }{ + "has TF_CLI_CONFIG_FILE": { + tfCliConfigFile: "~/.terraform_alternate/terraformrc", + terraformConfig: "", + result: "~/.terraform_alternate/terraformrc", + }, + "has TERRAFORM_CONFIG": { + tfCliConfigFile: "", + terraformConfig: "~/.terraform_alternate_rc", + result: "~/.terraform_alternate_rc", + }, + "has both env vars": { + tfCliConfigFile: "~/.from_TF_CLI", + terraformConfig: "~/.from_TERRAFORM_CONFIG", + result: "~/.from_TF_CLI", + }, + "has neither env var": { + tfCliConfigFile: "", + terraformConfig: "", + result: "/Users/someone/.terraformrc", // expect tests run on unix + }, + } + + for name, tc := range cases { + setup(tc.tfCliConfigFile, tc.terraformConfig) + + fileResult := locateConfigFile() + if tc.result != fileResult { + t.Fatalf("%s: expected config file at %s, got %s", name, tc.result, fileResult) + } + } +} + +func TestConfig_cliConfig(t *testing.T) { + // This only tests the behavior of merging various combinations of + // (credentials file, .terraformrc file, absent). Locating the .terraformrc + // file is tested separately. + originalHome := os.Getenv("HOME") + originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") + reset := func() { + os.Setenv("HOME", originalHome) + if originalTfCliConfigFile != "" { + os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) + } else { + os.Unsetenv("TF_CLI_CONFIG_FILE") + } + } + defer reset() + + // Summary of fixtures: the credentials file and terraformrc file each have + // credentials for two hosts, they both have credentials for app.terraform.io, + // and the terraformrc also has one service discovery override. + hasCredentials := "test-fixtures/cli-config-files/home" + noCredentials := "test-fixtures/cli-config-files/no-credentials" + terraformrc := "test-fixtures/cli-config-files/terraformrc" + noTerraformrc := "test-fixtures/cli-config-files/no-terraformrc" + tokenFromTerraformrc := "something.atlasv1.prod_rc_file" + tokenFromCredentials := "something.atlasv1.prod_credentials_file" + + cases := map[string]struct { + home string + rcfile string + expectCount int + expectProdToken string + expectHostsCount int + }{ + "both main config and credentials JSON": { + home: hasCredentials, + rcfile: terraformrc, + expectCount: 3, + expectProdToken: tokenFromTerraformrc, + expectHostsCount: 1, + }, + "only main config": { + home: noCredentials, + rcfile: terraformrc, + expectCount: 2, + expectProdToken: tokenFromTerraformrc, + expectHostsCount: 1, + }, + "only credentials JSON": { + home: hasCredentials, + rcfile: noTerraformrc, + expectCount: 2, + expectProdToken: tokenFromCredentials, + expectHostsCount: 0, + }, + "neither file": { + home: noCredentials, + rcfile: noTerraformrc, + expectCount: 0, + expectProdToken: "", + expectHostsCount: 0, + }, + } + + for name, tc := range cases { + os.Setenv("HOME", tc.home) + os.Setenv("TF_CLI_CONFIG_FILE", tc.rcfile) + config := cliConfig() + credentialsCount := len(config.Credentials) + if credentialsCount != tc.expectCount { + t.Fatalf("%s: expected %d credentials, got %d", name, tc.expectCount, credentialsCount) + } + prodToken := "" + if config.Credentials["app.terraform.io"] != nil { + prodToken = config.Credentials["app.terraform.io"]["token"].(string) + } + if prodToken != tc.expectProdToken { + t.Fatalf("%s: expected %s as prod token, got %s", name, tc.expectProdToken, prodToken) + } + hostsCount := len(config.Hosts) + if hostsCount != tc.expectHostsCount { + t.Fatalf("%s: expected %d `host` blocks in the final config, got %d", name, tc.expectHostsCount, hostsCount) + } + } +} diff --git a/internal/provider/config_unix.go b/internal/client/config_unix.go similarity index 98% rename from internal/provider/config_unix.go rename to internal/client/config_unix.go index a2e7e55bb..9f8cef07f 100644 --- a/internal/provider/config_unix.go +++ b/internal/client/config_unix.go @@ -4,7 +4,7 @@ //go:build !windows // +build !windows -package provider +package client import ( "errors" diff --git a/internal/provider/config_windows.go b/internal/client/config_windows.go similarity index 98% rename from internal/provider/config_windows.go rename to internal/client/config_windows.go index 61f40d71f..6ba3e0815 100644 --- a/internal/provider/config_windows.go +++ b/internal/client/config_windows.go @@ -4,7 +4,7 @@ //go:build windows // +build windows -package provider +package client import ( "path/filepath" diff --git a/internal/client/init.go b/internal/client/init.go new file mode 100644 index 000000000..dfb1392d1 --- /dev/null +++ b/internal/client/init.go @@ -0,0 +1,19 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package client + +import ( + "sync" + + tfe "github.com/hashicorp/go-tfe" +) + +var clientCache *ClientConfigMap + +func init() { + clientCache = &ClientConfigMap{ + values: make(map[string]*tfe.Client), + mu: sync.Mutex{}, + } +} diff --git a/internal/provider/logging.go b/internal/logging/logging.go similarity index 99% rename from internal/provider/logging.go rename to internal/logging/logging.go index 44b404495..07c23ffa2 100644 --- a/internal/provider/logging.go +++ b/internal/logging/logging.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package provider +package logging import ( "bytes" diff --git a/internal/provider/plugin_provider.go b/internal/provider/plugin_provider.go index af9e4c148..306284b72 100644 --- a/internal/provider/plugin_provider.go +++ b/internal/provider/plugin_provider.go @@ -11,6 +11,7 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tftypes" + "github.com/hashicorp/terraform-provider-tfe/internal/client" ) type pluginProviderServer struct { @@ -84,7 +85,7 @@ func (p *pluginProviderServer) ConfigureProvider(ctx context.Context, req *tfpro return resp, nil } - client, err := getClient(meta.hostname, meta.token, meta.sslSkipVerify) + client, err := client.GetClient(meta.hostname, meta.token, meta.sslSkipVerify) if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 656155347..9e70955c8 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -5,50 +5,21 @@ package provider import ( "context" - "crypto/tls" "errors" - "fmt" - "log" - "net/http" - "net/url" "os" - "sort" - "strconv" - "strings" tfe "github.com/hashicorp/go-tfe" - version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - providerVersion "github.com/hashicorp/terraform-provider-tfe/version" - svchost "github.com/hashicorp/terraform-svchost" - "github.com/hashicorp/terraform-svchost/auth" - "github.com/hashicorp/terraform-svchost/disco" + "github.com/hashicorp/terraform-provider-tfe/internal/client" ) -const defaultHostname = "app.terraform.io" const defaultSSLSkipVerify = false var ( - tfeServiceIDs = []string{"tfe.v2.2"} - errMissingAuthToken = errors.New("required token could not be found. Please set the token using an input variable in the provider configuration block or by using the TFE_TOKEN environment variable") errMissingOrganization = errors.New("no organization was specified on the resource or provider") ) -// Config is the structure of the configuration for the Terraform CLI. -type Config struct { - Hosts map[string]*ConfigHost `hcl:"host"` - Credentials map[string]map[string]interface{} `hcl:"credentials"` -} - -// ConfigHost is the structure of the "host" nested block within the CLI -// configuration, which can be used to override the default service host -// discovery behavior for a particular hostname. -type ConfigHost struct { - Services map[string]interface{} `hcl:"services"` -} - // ConfiguredClient wraps the tfe.Client the provider uses, plus the default // organization name to be used by resources that need an organization but don't // specify one. @@ -202,386 +173,7 @@ func configureClient(d *schema.ResourceData) (*tfe.Client, error) { token := d.Get("token").(string) insecure := d.Get("ssl_skip_verify").(bool) - return getClient(hostname, token, insecure) -} - -func getTokenFromEnv() string { - log.Printf("[DEBUG] TFE_TOKEN used for token value") - return os.Getenv("TFE_TOKEN") -} - -func getTokenFromCreds(services *disco.Disco, hostname svchost.Hostname) string { - log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %s...", hostname) - creds, err := services.CredentialsForHost(hostname) - if err != nil { - log.Printf("[DEBUG] Failed to get credentials for %s: %s (ignoring)", hostname, err) - } - if creds != nil { - return creds.Token() - } - return "" -} - -// getClient encapsulates the logic for configuring a go-tfe client instance for -// the provider, including fallback to values from environment variables. This -// is useful because we're muxing multiple provider servers together and each -// one needs an identically configured client. -func getClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { - h := tfeHost - if tfeHost == "" { - if os.Getenv("TFE_HOSTNAME") != "" { - h = os.Getenv("TFE_HOSTNAME") - } else { - h = defaultHostname - } - } - - log.Printf("[DEBUG] Configuring client for host %q", h) - - // Parse the hostname for comparison, - hostname, err := svchost.ForComparison(h) - if err != nil { - return nil, err - } - - providerUaString := fmt.Sprintf("terraform-provider-tfe/%s", providerVersion.ProviderVersion) - - httpClient := tfe.DefaultConfig().HTTPClient - - // Make sure the transport has a TLS config. - transport := httpClient.Transport.(*http.Transport) - if transport.TLSClientConfig == nil { - transport.TLSClientConfig = &tls.Config{MinVersion: tls.VersionTLS12} - } - - // If ssl_skip_verify is false, it is either set that way in configuration or unset. Check - // the environment to see if it was set to true there. Strictly speaking, this means that - // the env var can override an explicit 'false' in configuration (which is not true of the - // other settings), but that's how it goes with a boolean zero value. - if !insecure && os.Getenv("TFE_SSL_SKIP_VERIFY") != "" { - v := os.Getenv("TFE_SSL_SKIP_VERIFY") - insecure, err = strconv.ParseBool(v) - if err != nil { - return nil, err - } - } - - // Configure the certificate verification options. - if insecure { - log.Printf("[DEBUG] Warning: Client configured to skip certificate verifications") - } - transport.TLSClientConfig.InsecureSkipVerify = insecure - - // Get the Terraform CLI configuration. - config := cliConfig() - - // Create a new credential source and service discovery object. - credsSrc := credentialsSource(config) - services := disco.NewWithCredentialsSource(credsSrc) - services.SetUserAgent(providerUaString) - services.Transport = NewLoggingTransport("TFE Discovery", transport) - - // Add any static host configurations service discovery object. - for userHost, hostConfig := range config.Hosts { - host, err := svchost.ForComparison(userHost) - if err != nil { - // ignore invalid hostnames. - continue - } - services.ForceHostServices(host, hostConfig.Services) - } - - // Discover the Terraform Enterprise address. - host, err := services.Discover(hostname) - if err != nil { - return nil, err - } - - // Get the full Terraform Enterprise service address. - var address *url.URL - var discoErr error - for _, tfeServiceID := range tfeServiceIDs { - service, err := host.ServiceURL(tfeServiceID) - if _, ok := err.(*disco.ErrVersionNotSupported); !ok && err != nil { - return nil, err - } - // If discoErr is nil we save the first error. When multiple services - // are checked and we found one that didn't give an error we need to - // reset the discoErr. So if err is nil, we assign it as well. - if discoErr == nil || err == nil { - discoErr = err - } - if service != nil { - address = service - break - } - } - - if providerVersion.ProviderVersion != "dev" { - // We purposefully ignore the error and return the previous error, as - // checking for version constraints is considered optional. - constraints, _ := host.VersionConstraints(tfeServiceIDs[0], "tfe-provider") - - // First check any constraints we might have received. - if constraints != nil { - if err := checkConstraints(constraints); err != nil { - return nil, err - } - } - } - - // When we don't have any constraints errors, also check for discovery - // errors before we continue. - if discoErr != nil { - return nil, discoErr - } - - // If a token wasn't set in the provider configuration block, try and fetch it - // from the environment or from Terraform's CLI configuration or configured credential helper. - if token == "" { - if os.Getenv("TFE_TOKEN") != "" { - token = getTokenFromEnv() - } else { - token = getTokenFromCreds(services, hostname) - } - } - - // If we still don't have a token at this point, we return an error. - if token == "" { - return nil, errMissingAuthToken - } - - // Wrap the configured transport to enable logging. - httpClient.Transport = NewLoggingTransport("TFE", transport) - - // Create a new TFE client config - cfg := &tfe.Config{ - Address: address.String(), - Token: token, - HTTPClient: httpClient, - } - - // Create a new TFE client. - client, err := tfe.NewClient(cfg) - if err != nil { - return nil, err - } - - client.RetryServerErrors(true) - return client, nil -} - -// cliConfig tries to find and parse the configuration of the Terraform CLI. -// This is an optional step, so any errors are ignored. -func cliConfig() Config { - mainConfig := Config{} - credentialsConfig := Config{} - combinedConfig := Config{} - - // Main CLI config file; might contain manually-entered credentials, and/or - // some host service discovery objects. Location is configurable via - // environment variables. - configFilePath := locateConfigFile() - if configFilePath != "" { - mainConfig = readCliConfigFile(configFilePath) - } - - // Credentials file; might contain credentials auto-configured by terraform - // login. Location isn't configurable. - credentialsFilePath, err := credentialsFile() - if err != nil { - log.Printf("[ERROR] Error detecting default credentials file path: %s", err) - } else { - credentialsConfig = readCliConfigFile(credentialsFilePath) - } - - // Use host service discovery configs from main config file. - combinedConfig.Hosts = mainConfig.Hosts - - // Combine both sets of credentials. Per Terraform's own behavior, the main - // config file overrides the credentials file if they have any overlapping - // hostnames. - combinedConfig.Credentials = credentialsConfig.Credentials - if combinedConfig.Credentials == nil { - combinedConfig.Credentials = make(map[string]map[string]interface{}) - } - for host, creds := range mainConfig.Credentials { - combinedConfig.Credentials[host] = creds - } - - return combinedConfig -} - -func locateConfigFile() string { - // To find the main CLI config file, follow Terraform's own logic: try - // TF_CLI_CONFIG_FILE, then try TERRAFORM_CONFIG, then try the default - // location. - - if os.Getenv("TF_CLI_CONFIG_FILE") != "" { - return os.Getenv("TF_CLI_CONFIG_FILE") - } - - if os.Getenv("TERRAFORM_CONFIG") != "" { - return os.Getenv("TERRAFORM_CONFIG") - } - filePath, err := configFile() - if err != nil { - log.Printf("[ERROR] Error detecting default CLI config file path: %s", err) - return "" - } - - return filePath -} - -func readCliConfigFile(configFilePath string) Config { - config := Config{} - - // Read the CLI config file content. - content, err := os.ReadFile(configFilePath) - if err != nil { - log.Printf("[ERROR] Error reading CLI config or credentials file %s: %v", configFilePath, err) - return config - } - - // Parse the CLI config file content. - obj, err := hcl.Parse(string(content)) - if err != nil { - log.Printf("[ERROR] Error parsing CLI config or credentials file %s: %v", configFilePath, err) - return config - } - - // Decode the CLI config file content. - if err := hcl.DecodeObject(&config, obj); err != nil { - log.Printf("[ERROR] Error decoding CLI config or credentials file %s: %v", configFilePath, err) - } - - return config -} - -func credentialsSource(config Config) auth.CredentialsSource { - creds := auth.NoCredentials - - // Add all configured credentials to the credentials source. - if len(config.Credentials) > 0 { - staticTable := map[svchost.Hostname]map[string]interface{}{} - for userHost, creds := range config.Credentials { - host, err := svchost.ForComparison(userHost) - if err != nil { - // We expect the config was already validated by the time we get - // here, so we'll just ignore invalid hostnames. - continue - } - staticTable[host] = creds - } - creds = auth.StaticCredentialsSource(staticTable) - } - - return creds -} - -// checkConstraints checks service version constrains against our own -// version and returns rich and informational diagnostics in case any -// incompatibilities are detected. -func checkConstraints(c *disco.Constraints) error { - if c == nil || c.Minimum == "" || c.Maximum == "" { - return nil - } - - // Generate a parsable constraints string. - excluding := "" - if len(c.Excluding) > 0 { - excluding = fmt.Sprintf(", != %s", strings.Join(c.Excluding, ", != ")) - } - constStr := fmt.Sprintf(">= %s%s, <= %s", c.Minimum, excluding, c.Maximum) - - // Create the constraints to check against. - constraints, err := version.NewConstraint(constStr) - if err != nil { - return checkConstraintsWarning(err) - } - - // Create the version to check. - v, err := version.NewVersion(providerVersion.ProviderVersion) - if err != nil { - return checkConstraintsWarning(err) - } - - // Return if we satisfy all constraints. - if constraints.Check(v) { - return nil - } - - // Find out what action (upgrade/downgrade) we should advice. - minimum, err := version.NewVersion(c.Minimum) - if err != nil { - return checkConstraintsWarning(err) - } - - maximum, err := version.NewVersion(c.Maximum) - if err != nil { - return checkConstraintsWarning(err) - } - - var excludes []*version.Version - for _, exclude := range c.Excluding { - v, err := version.NewVersion(exclude) - if err != nil { - return checkConstraintsWarning(err) - } - excludes = append(excludes, v) - } - - // Sort all the excludes. - sort.Sort(version.Collection(excludes)) - - var action, toVersion string - switch { - case minimum.GreaterThan(v): - action = "upgrade" - toVersion = ">= " + minimum.String() - case maximum.LessThan(v): - action = "downgrade" - toVersion = "<= " + maximum.String() - case len(excludes) > 0: - // Get the latest excluded version. - action = "upgrade" - toVersion = "> " + excludes[len(excludes)-1].String() - } - - switch { - case len(excludes) == 1: - excluding = fmt.Sprintf(", excluding version %s", excludes[0].String()) - case len(excludes) > 1: - var vs []string - for _, v := range excludes { - vs = append(vs, v.String()) - } - excluding = fmt.Sprintf(", excluding versions %s", strings.Join(vs, ", ")) - default: - excluding = "" - } - - summary := fmt.Sprintf("Incompatible TFE provider version v%s", v.String()) - details := fmt.Sprintf( - "The configured Terraform Enterprise backend is compatible with TFE provider\n"+ - "versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding, - ) - - if action != "" && toVersion != "" { - summary = fmt.Sprintf("Please %s the TFE provider to %s", action, toVersion) - } - - // Return the customized and informational error message. - return fmt.Errorf("%s\n\n%s", summary, details) -} - -func checkConstraintsWarning(err error) error { - return fmt.Errorf( - "failed to check version constraints: %v\n\n"+ - "checking version constraints is considered optional, but this is an\n"+ - "unexpected error which should be reported", - err, - ) + return client.GetClient(hostname, token, insecure) } var descriptions = map[string]string{ diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 4da56ff15..6e42e3b22 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-provider-tfe/internal/client" ) // frameworkProvider is a type that implements the terraform-plugin-framework @@ -94,7 +95,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur data.Organization = types.StringValue(os.Getenv("TFE_ORGANIZATION")) } - client, err := getClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) + client, err := client.GetClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) if err != nil { res.Diagnostics.AddError("Failed to initialize HTTP client", err.Error()) diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 93e0444de..f1e2af621 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-provider-tfe/internal/client" "github.com/hashicorp/terraform-provider-tfe/version" "github.com/hashicorp/terraform-svchost/disco" ) @@ -83,13 +84,13 @@ func setupDefaultOrganization(t *testing.T) (string, int) { } func getClientUsingEnv() (*tfe.Client, error) { - hostname := defaultHostname + hostname := client.DefaultHostname if os.Getenv("TFE_HOSTNAME") != "" { hostname = os.Getenv("TFE_HOSTNAME") } token := os.Getenv("TFE_TOKEN") - client, err := getClient(hostname, token, defaultSSLSkipVerify) + client, err := client.GetClient(hostname, token, defaultSSLSkipVerify) if err != nil { return nil, fmt.Errorf("Error getting client: %w", err) } @@ -153,7 +154,7 @@ func TestProvider_versionConstraints(t *testing.T) { // Set the version for this test. version.ProviderVersion = tc.version - err := checkConstraints(tc.constraints) + err := client.CheckConstraints(tc.constraints) if err == nil && tc.result != "" { t.Fatalf("%s: expected error to contain %q, but got no error", name, tc.result) } @@ -166,155 +167,6 @@ func TestProvider_versionConstraints(t *testing.T) { } } -func TestProvider_locateConfigFile(t *testing.T) { - originalHome := os.Getenv("HOME") - originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") - originalTerraformConfig := os.Getenv("TERRAFORM_CONFIG") - reset := func() { - os.Setenv("HOME", originalHome) - if originalTfCliConfigFile != "" { - os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) - } else { - os.Unsetenv("TF_CLI_CONFIG_FILE") - } - if originalTerraformConfig != "" { - os.Setenv("TERRAFORM_CONFIG", originalTerraformConfig) - } else { - os.Unsetenv("TERRAFORM_CONFIG") - } - } - defer reset() - - // Use a predictable value for $HOME - os.Setenv("HOME", "/Users/someone") - - setup := func(tfCliConfigFile, terraformConfig string) { - os.Setenv("TF_CLI_CONFIG_FILE", tfCliConfigFile) - os.Setenv("TERRAFORM_CONFIG", terraformConfig) - } - - cases := map[string]struct { - tfCliConfigFile string - terraformConfig string - result string - }{ - "has TF_CLI_CONFIG_FILE": { - tfCliConfigFile: "~/.terraform_alternate/terraformrc", - terraformConfig: "", - result: "~/.terraform_alternate/terraformrc", - }, - "has TERRAFORM_CONFIG": { - tfCliConfigFile: "", - terraformConfig: "~/.terraform_alternate_rc", - result: "~/.terraform_alternate_rc", - }, - "has both env vars": { - tfCliConfigFile: "~/.from_TF_CLI", - terraformConfig: "~/.from_TERRAFORM_CONFIG", - result: "~/.from_TF_CLI", - }, - "has neither env var": { - tfCliConfigFile: "", - terraformConfig: "", - result: "/Users/someone/.terraformrc", // expect tests run on unix - }, - } - - for name, tc := range cases { - setup(tc.tfCliConfigFile, tc.terraformConfig) - - fileResult := locateConfigFile() - if tc.result != fileResult { - t.Fatalf("%s: expected config file at %s, got %s", name, tc.result, fileResult) - } - } -} - -func TestProvider_cliConfig(t *testing.T) { - // This only tests the behavior of merging various combinations of - // (credentials file, .terraformrc file, absent). Locating the .terraformrc - // file is tested separately. - originalHome := os.Getenv("HOME") - originalTfCliConfigFile := os.Getenv("TF_CLI_CONFIG_FILE") - reset := func() { - os.Setenv("HOME", originalHome) - if originalTfCliConfigFile != "" { - os.Setenv("TF_CLI_CONFIG_FILE", originalTfCliConfigFile) - } else { - os.Unsetenv("TF_CLI_CONFIG_FILE") - } - } - defer reset() - - // Summary of fixtures: the credentials file and terraformrc file each have - // credentials for two hosts, they both have credentials for app.terraform.io, - // and the terraformrc also has one service discovery override. - hasCredentials := "test-fixtures/cli-config-files/home" - noCredentials := "test-fixtures/cli-config-files/no-credentials" - terraformrc := "test-fixtures/cli-config-files/terraformrc" - noTerraformrc := "test-fixtures/cli-config-files/no-terraformrc" - tokenFromTerraformrc := "something.atlasv1.prod_rc_file" - tokenFromCredentials := "something.atlasv1.prod_credentials_file" - - cases := map[string]struct { - home string - rcfile string - expectCount int - expectProdToken string - expectHostsCount int - }{ - "both main config and credentials JSON": { - home: hasCredentials, - rcfile: terraformrc, - expectCount: 3, - expectProdToken: tokenFromTerraformrc, - expectHostsCount: 1, - }, - "only main config": { - home: noCredentials, - rcfile: terraformrc, - expectCount: 2, - expectProdToken: tokenFromTerraformrc, - expectHostsCount: 1, - }, - "only credentials JSON": { - home: hasCredentials, - rcfile: noTerraformrc, - expectCount: 2, - expectProdToken: tokenFromCredentials, - expectHostsCount: 0, - }, - "neither file": { - home: noCredentials, - rcfile: noTerraformrc, - expectCount: 0, - expectProdToken: "", - expectHostsCount: 0, - }, - } - - for name, tc := range cases { - os.Setenv("HOME", tc.home) - os.Setenv("TF_CLI_CONFIG_FILE", tc.rcfile) - config := cliConfig() - credentialsCount := len(config.Credentials) - if credentialsCount != tc.expectCount { - t.Fatalf("%s: expected %d credentials, got %d", name, tc.expectCount, credentialsCount) - } - prodToken := "" - if config.Credentials["app.terraform.io"] != nil { - prodToken = config.Credentials["app.terraform.io"]["token"].(string) - } - if prodToken != tc.expectProdToken { - t.Fatalf("%s: expected %s as prod token, got %s", name, tc.expectProdToken, prodToken) - } - hostsCount := len(config.Hosts) - if hostsCount != tc.expectHostsCount { - t.Fatalf("%s: expected %d `host` blocks in the final config, got %d", name, tc.expectHostsCount, hostsCount) - } - } -} - func testAccPreCheck(t *testing.T) { // The credentials must be provided by the CLI config file for testing. if diags := Provider().Configure(context.Background(), &terraform.ResourceConfig{}); diags.HasError() { From a08d93905c21f7d8046f993d138916c2014e478e Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 9 Oct 2023 17:10:23 -0600 Subject: [PATCH 053/420] Fixes client token config when using ENV or CLI config --- internal/client/client.go | 4 +- internal/client/client_test.go | 160 +++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 2 deletions(-) create mode 100644 internal/client/client_test.go diff --git a/internal/client/client.go b/internal/client/client.go index c058b4902..083863623 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -63,7 +63,7 @@ func getTokenFromEnv() string { } func getTokenFromCreds(services *disco.Disco, hostname svchost.Hostname) string { - log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %s...", hostname) + log.Printf("[DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname %q...", hostname) creds, err := services.CredentialsForHost(hostname) if err != nil { log.Printf("[DEBUG] Failed to get credentials for %s: %s (ignoring)", hostname, err) @@ -144,7 +144,7 @@ func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { // Create a new TFE client. client, err := tfe.NewClient(&tfe.Config{ Address: address.String(), - Token: token, + Token: config.Token, HTTPClient: config.HTTPClient, }) if err != nil { diff --git a/internal/client/client_test.go b/internal/client/client_test.go new file mode 100644 index 000000000..2f4cd1d9d --- /dev/null +++ b/internal/client/client_test.go @@ -0,0 +1,160 @@ +package client + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "net/url" + "os" + "testing" + + "github.com/hashicorp/go-tfe" +) + +// testToken has to be used against the fake server when making an API call, otherwise +// a 404 error is returned. +var testToken = "test-token-1234567890" + +// testDefaultRequestHandlers is a map of request handlers intended to be used in a request +// multiplexer for a test server. A caller may use testServer to start a server with +// this base set of routes. +var testDefaultRequestHandlers = map[string]func(http.ResponseWriter, *http.Request){ + // Respond to service discovery calls. + "/.well-known/terraform.json": func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, `{ + "tfe.v2": "/api/v2/", + "tfe.v2.1": "/api/v2/", + "tfe.v2.2": "/api/v2/" +}`) + }, + + // Respond to pings to get the API version header. + "/api/v2/ping": func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Header().Set("TFP-API-Version", "2.5") + }, + + "/api/v2/organizations": func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Header().Set("TFP-API-Version", "2.5") + + if r.Header["Authorization"][0] != fmt.Sprintf("Bearer %s", testToken) { + w.WriteHeader(http.StatusNotFound) + return + } + + w.Write([]byte(`{"data": []}`)) + }, +} + +func testServer(t *testing.T) *httptest.Server { + t.Helper() + + mux := http.NewServeMux() + for route, handler := range testDefaultRequestHandlers { + mux.HandleFunc(route, handler) + } + + return httptest.NewTLSServer(mux) +} + +func Test_GetClient(t *testing.T) { + srv := testServer(t) + t.Cleanup(func() { + srv.Close() + }) + + url, err := url.Parse(srv.URL) + if err != nil { + t.Fatalf("Unexpected error when parsing testServer URL: %q", err) + } + + cliConfig, err := os.CreateTemp("", "cliconfig") + if err != nil { + t.Fatalf("Failed to create temp CLI config: %s", err) + } + t.Cleanup(func() { + os.Remove(cliConfig.Name()) + }) + + io.WriteString(cliConfig, fmt.Sprintf(` +credentials "%s" { + token = "%s" +} +`, url.Host, testToken)) + + cases := map[string]struct { + env map[string]string + hostname string + token string + expectMissingAuth bool + }{ + "everything from env": { + env: map[string]string{ + "TFE_HOSTNAME": url.Host, + "TFE_TOKEN": testToken, + }, + }, + "token from env": { + env: map[string]string{ + "TFE_HOSTNAME": url.Host, + "TFE_TOKEN": "", + }, + token: testToken, + }, + "everything from provider config": { + env: map[string]string{ + "TFE_HOSTNAME": "", + "TFE_TOKEN": "", + }, + hostname: url.Host, + token: testToken, + }, + "token missing": { + env: map[string]string{ + "TFE_HOSTNAME": "", + "TFE_TOKEN": "", + }, + hostname: url.Host, + expectMissingAuth: true, + }, + "token from CLI config": { + env: map[string]string{ + "TFE_TOKEN": "", + "TF_CLI_CONFIG_FILE": cliConfig.Name(), + }, + hostname: url.Host, + }, + } + + for _, c := range cases { + for k, v := range c.env { + t.Setenv(k, v) + } + // Must always skip SSL verification for this test server + client, err := GetClient(c.hostname, c.token, true) + if c.expectMissingAuth { + if !errors.Is(err, ErrMissingAuthToken) { + t.Errorf("Expected ErrMissingAuthToken, got %v", err) + } + continue + } + + if err != nil { + t.Errorf("Unexpected error when getting client: %q", err) + } + + if client == nil { + t.Fatal("Unexpected client was nil") + } + + _, err = client.Organizations.List(context.Background(), &tfe.OrganizationListOptions{}) + if err != nil { + t.Errorf("Unexpected error from using client: %q", err) + } + } +} From e7f51b74c7004e3863f07318da63bd633746ec9e Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:40:18 -0400 Subject: [PATCH 054/420] Update website/docs/r/variable_set.html.markdown Co-authored-by: rberecka --- website/docs/r/variable_set.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/variable_set.html.markdown b/website/docs/r/variable_set.html.markdown index 7b380e965..90a8cbdff 100644 --- a/website/docs/r/variable_set.html.markdown +++ b/website/docs/r/variable_set.html.markdown @@ -133,7 +133,7 @@ The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. * `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. -* `priority` - (Optional) Whether the variables in this set are able to be over-written. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set are able to be over-written by more specific scopes. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspace_ids` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource From 999751811cdee89b69705743266ed750f8b1c67c Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 10 Oct 2023 09:27:39 -0600 Subject: [PATCH 055/420] make lint always returned 0, even with errors present I took the opportunity to fix the existing errors --- .golangci.yml | 4 +- GNUmakefile | 2 +- internal/client/client.go | 11 ++- internal/client/client_test.go | 21 +++--- internal/client/config.go | 4 +- internal/provider/data_source_teams.go | 50 +++++++------ internal/provider/plugin_provider.go | 4 +- internal/provider/provider.go | 6 +- internal/provider/provider_next.go | 4 +- internal/provider/provider_test.go | 8 +- .../provider/resource_tfe_saml_settings.go | 4 +- .../resource_tfe_saml_settings_test.go | 19 ++--- .../resource_tfe_team_project_access.go | 33 ++++----- internal/provider/workspace_run_helpers.go | 73 +++++++++++-------- 14 files changed, 126 insertions(+), 117 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ec21823ba..c4db4933d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -99,11 +99,11 @@ issues: - staticcheck path: (data_source_outputs|resource_tfe_agent_pool|resource_tfe_notification_configuration|resource_tfe_organization|resource_tfe_registry_module| -|resource_tfe_run_trigger|resource_tfe_team_access|resource_tfe_organization_membership|resource_tfe_policy_set|resource_tfe_team_member| - -|resource_tfe_workspace|resource_tfe_team_organization_member|resource_tfe_variable_set)\.go + -|resource_tfe_workspace|resource_tfe_team_organization_member|resource_tfe_variable_set|resource_tfe_team_project_access)\.go text: "SA1019" - linters: - wrapcheck - path: (config_unix|data_source_slug|data_source_workspace|provider|resource_tfe_variable|provider_test)\.go + path: (config_unix|data_source_slug|data_source_workspace|provider|resource_tfe_variable|resource_tfe_workspace|provider_test)\.go text: "error returned from external package is unwrapped" - linters: - wrapcheck diff --git a/GNUmakefile b/GNUmakefile index c3d9b98e4..4e0f073bc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -42,7 +42,7 @@ vet: lint: @golangci-lint run ; if [ $$? -ne 0 ]; then \ echo ""; \ - echo "golangci-lint found some code style issues." \ + echo "golangci-lint found some code style issues."; \ exit 1; \ fi diff --git a/internal/client/client.go b/internal/client/client.go index 083863623..7d4a0373a 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -99,7 +99,7 @@ func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { // Discover the Terraform Enterprise address. host, err := config.Services.Discover(config.TFEHost) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create client: %w", err) } // Get the full Terraform Enterprise service address. @@ -107,15 +107,18 @@ func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { var discoErr error for _, tfeServiceID := range tfeServiceIDs { service, err := host.ServiceURL(tfeServiceID) - if _, ok := err.(*disco.ErrVersionNotSupported); !ok && err != nil { - return nil, err + target := &disco.ErrVersionNotSupported{} + if err != nil && !errors.As(err, &target) { + return nil, fmt.Errorf("failed to create client: %w", err) } + // If discoErr is nil we save the first error. When multiple services // are checked and we found one that didn't give an error we need to // reset the discoErr. So if err is nil, we assign it as well. if discoErr == nil || err == nil { discoErr = err } + if service != nil { address = service break @@ -148,7 +151,7 @@ func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error) { HTTPClient: config.HTTPClient, }) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create client: %w", err) } client.RetryServerErrors(true) diff --git a/internal/client/client_test.go b/internal/client/client_test.go index 2f4cd1d9d..df9f8f8c0 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -23,7 +23,7 @@ var testToken = "test-token-1234567890" // this base set of routes. var testDefaultRequestHandlers = map[string]func(http.ResponseWriter, *http.Request){ // Respond to service discovery calls. - "/.well-known/terraform.json": func(w http.ResponseWriter, r *http.Request) { + "/.well-known/terraform.json": func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") io.WriteString(w, `{ "tfe.v2": "/api/v2/", @@ -33,7 +33,7 @@ var testDefaultRequestHandlers = map[string]func(http.ResponseWriter, *http.Requ }, // Respond to pings to get the API version header. - "/api/v2/ping": func(w http.ResponseWriter, r *http.Request) { + "/api/v2/ping": func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") w.Header().Set("TFP-API-Version", "2.5") }, @@ -68,7 +68,7 @@ func Test_GetClient(t *testing.T) { srv.Close() }) - url, err := url.Parse(srv.URL) + serverURL, err := url.Parse(srv.URL) if err != nil { t.Fatalf("Unexpected error when parsing testServer URL: %q", err) } @@ -81,11 +81,10 @@ func Test_GetClient(t *testing.T) { os.Remove(cliConfig.Name()) }) - io.WriteString(cliConfig, fmt.Sprintf(` + fmt.Fprintf(cliConfig, ` credentials "%s" { token = "%s" -} -`, url.Host, testToken)) +}`, serverURL.Host, testToken) cases := map[string]struct { env map[string]string @@ -95,13 +94,13 @@ credentials "%s" { }{ "everything from env": { env: map[string]string{ - "TFE_HOSTNAME": url.Host, + "TFE_HOSTNAME": serverURL.Host, "TFE_TOKEN": testToken, }, }, "token from env": { env: map[string]string{ - "TFE_HOSTNAME": url.Host, + "TFE_HOSTNAME": serverURL.Host, "TFE_TOKEN": "", }, token: testToken, @@ -111,7 +110,7 @@ credentials "%s" { "TFE_HOSTNAME": "", "TFE_TOKEN": "", }, - hostname: url.Host, + hostname: serverURL.Host, token: testToken, }, "token missing": { @@ -119,7 +118,7 @@ credentials "%s" { "TFE_HOSTNAME": "", "TFE_TOKEN": "", }, - hostname: url.Host, + hostname: serverURL.Host, expectMissingAuth: true, }, "token from CLI config": { @@ -127,7 +126,7 @@ credentials "%s" { "TFE_TOKEN": "", "TF_CLI_CONFIG_FILE": cliConfig.Name(), }, - hostname: url.Host, + hostname: serverURL.Host, }, } diff --git a/internal/client/config.go b/internal/client/config.go index 855c949f5..4ff1a9696 100644 --- a/internal/client/config.go +++ b/internal/client/config.go @@ -185,7 +185,7 @@ func configure(tfeHost, token string, insecure bool) (*ClientConfiguration, erro v := os.Getenv("TFE_SSL_SKIP_VERIFY") insecure, err = strconv.ParseBool(v) if err != nil { - return nil, err + return nil, fmt.Errorf("TFE_SSL_SKIP_VERIFY has unrecognized value %q", v) } } @@ -197,7 +197,7 @@ func configure(tfeHost, token string, insecure bool) (*ClientConfiguration, erro // Parse the hostname for comparison, hostname, err := svchost.ForComparison(tfeHost) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid hostname %q: %w", tfeHost, err) } httpClient := tfe.DefaultConfig().HTTPClient diff --git a/internal/provider/data_source_teams.go b/internal/provider/data_source_teams.go index fe1ea5dd4..ab684b67a 100644 --- a/internal/provider/data_source_teams.go +++ b/internal/provider/data_source_teams.go @@ -47,31 +47,33 @@ func dataSourceTFETeamsRead(d *schema.ResourceData, meta interface{}) error { } if len(teams.Items) == 0 { - return fmt.Errorf("Could not find teams in %s", organization) - } else { - options := &tfe.TeamListOptions{} - names := []string{} - ids := map[string]string{} - for { - for _, team := range teams.Items { - names = append(names, team.Name) - ids[team.Name] = team.ID - } - - if teams.CurrentPage >= teams.TotalPages { - break - } - - options.PageNumber = teams.NextPage - - teams, err = config.Client.Teams.List(ctx, organization, options) - if err != nil { - return fmt.Errorf("Error retrieving teams: %w", err) - } + return fmt.Errorf("could not find teams in %q", organization) + } + + options := &tfe.TeamListOptions{} + names := []string{} + ids := map[string]string{} + for { + for _, team := range teams.Items { + names = append(names, team.Name) + ids[team.Name] = team.ID + } + + if teams.CurrentPage >= teams.TotalPages { + break + } + + options.PageNumber = teams.NextPage + + teams, err = config.Client.Teams.List(ctx, organization, options) + if err != nil { + return fmt.Errorf("Error retrieving teams: %w", err) } - d.SetId(organization) - d.Set("names", names) - d.Set("ids", ids) } + + d.SetId(organization) + d.Set("names", names) + d.Set("ids", ids) + return nil } diff --git a/internal/provider/plugin_provider.go b/internal/provider/plugin_provider.go index 306284b72..9224292cd 100644 --- a/internal/provider/plugin_provider.go +++ b/internal/provider/plugin_provider.go @@ -85,7 +85,7 @@ func (p *pluginProviderServer) ConfigureProvider(ctx context.Context, req *tfpro return resp, nil } - client, err := client.GetClient(meta.hostname, meta.token, meta.sslSkipVerify) + tfeClient, err := client.GetClient(meta.hostname, meta.token, meta.sslSkipVerify) if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, @@ -99,7 +99,7 @@ func (p *pluginProviderServer) ConfigureProvider(ctx context.Context, req *tfpro meta.organization = os.Getenv("TFE_ORGANIZATION") } - p.tfeClient = client + p.tfeClient = tfeClient p.organization = meta.organization return resp, nil } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 9e70955c8..0ae719028 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -156,13 +156,13 @@ func configure() schema.ConfigureContextFunc { providerOrganization = os.Getenv("TFE_ORGANIZATION") } - client, err := configureClient(rd) + tfeClient, err := configureClient(rd) if err != nil { - return nil, diag.Errorf("failed to create SDK client: %s", err) + return nil, diag.FromErr(err) } return ConfiguredClient{ - client, + tfeClient, providerOrganization, }, nil } diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 6e42e3b22..a8b964b4d 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -95,7 +95,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur data.Organization = types.StringValue(os.Getenv("TFE_ORGANIZATION")) } - client, err := client.GetClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) + tfeClient, err := client.GetClient(data.Hostname.ValueString(), data.Token.ValueString(), data.SSLSkipVerify.ValueBool()) if err != nil { res.Diagnostics.AddError("Failed to initialize HTTP client", err.Error()) @@ -103,7 +103,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur } configuredClient := ConfiguredClient{ - Client: client, + Client: tfeClient, Organization: data.Organization.ValueString(), } diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index f1e2af621..d758d37e2 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -69,12 +69,12 @@ func setupDefaultOrganization(t *testing.T) (string, int) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() defaultOrgName := fmt.Sprintf("tst-default-org-%d", rInt) - client, err := getClientUsingEnv() + testClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) } - _, cleanup := createOrganization(t, client, tfe.OrganizationCreateOptions{ + _, cleanup := createOrganization(t, testClient, tfe.OrganizationCreateOptions{ Name: &defaultOrgName, Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), }) @@ -90,11 +90,11 @@ func getClientUsingEnv() (*tfe.Client, error) { } token := os.Getenv("TFE_TOKEN") - client, err := client.GetClient(hostname, token, defaultSSLSkipVerify) + tfeClient, err := client.GetClient(hostname, token, defaultSSLSkipVerify) if err != nil { return nil, fmt.Errorf("Error getting client: %w", err) } - return client, nil + return tfeClient, nil } func TestProvider(t *testing.T) { diff --git a/internal/provider/resource_tfe_saml_settings.go b/internal/provider/resource_tfe_saml_settings.go index 2a279fa98..b07029061 100644 --- a/internal/provider/resource_tfe_saml_settings.go +++ b/internal/provider/resource_tfe_saml_settings.go @@ -359,7 +359,7 @@ func (r *resourceTFESAMLSettings) updateSAMLSettings(ctx context.Context, m mode SignatureDigestMethod: m.SignatureDigestMethod.ValueStringPointer(), }) if err != nil { - return s, fmt.Errorf("failed to update SAML Settings %v", err) + return s, fmt.Errorf("failed to update SAML Settings: %w", err) } - return s, err + return s, nil } diff --git a/internal/provider/resource_tfe_saml_settings_test.go b/internal/provider/resource_tfe_saml_settings_test.go index ca75d0fdb..7bf3410b9 100644 --- a/internal/provider/resource_tfe_saml_settings_test.go +++ b/internal/provider/resource_tfe_saml_settings_test.go @@ -4,6 +4,7 @@ package provider import ( + "errors" "fmt" "strconv" "testing" @@ -207,19 +208,15 @@ func TestAccTFESAMLSettings_import(t *testing.T) { rs := s[0] if rs.Attributes["private_key"] != "" { return fmt.Errorf("expected private_key attribute to not be set, received: %s", rs.Attributes["private_key"]) - } if rs.Attributes["idp_cert"] != idpCert { return fmt.Errorf("expected idp_cert attribute to be equal to %s, received: %s", idpCert, rs.Attributes["idp_cert"]) - } if rs.Attributes["slo_endpoint_url"] != slo { return fmt.Errorf("expected slo_endpoint_url attribute to be equal to %s, received: %s", slo, rs.Attributes["slo_endpoint_url"]) - } if rs.Attributes["sso_endpoint_url"] != sso { return fmt.Errorf("expected sso_endpoint_url attribute to be equal to %s, received: %s", sso, rs.Attributes["sso_endpoint_url"]) - } return nil }, @@ -231,22 +228,22 @@ func TestAccTFESAMLSettings_import(t *testing.T) { func testAccTFESAMLSettingsDestroy(_ *terraform.State) error { s, err := testAccProvider.Meta().(ConfiguredClient).Client.Admin.Settings.SAML.Read(ctx) if err != nil { - return fmt.Errorf("failed to read SAML Settings: %v", err) + return fmt.Errorf("failed to read SAML Settings: %w", err) } if s.Enabled { - return fmt.Errorf("SAML settings are still enabled") + return errors.New("SAML settings are still enabled") } if s.Debug { - return fmt.Errorf("SAML settings debug is set to true") + return errors.New("SAML settings debug is set to true") } if s.AuthnRequestsSigned { - return fmt.Errorf("SAML settings AuthnRequestsSigned is set to true") + return errors.New("SAML settings AuthnRequestsSigned is set to true") } if s.WantAssertionsSigned { - return fmt.Errorf("SAML settings WantAssertionsSigned is set to true") + return errors.New("SAML settings WantAssertionsSigned is set to true") } if s.TeamManagementEnabled { - return fmt.Errorf("SAML settings TeamManagementEnabled is set to true") + return errors.New("SAML settings TeamManagementEnabled is set to true") } if s.IDPCert != "" { return fmt.Errorf("SAML settings IDPCert is not empty: `%s`", s.IDPCert) @@ -261,7 +258,7 @@ func testAccTFESAMLSettingsDestroy(_ *terraform.State) error { return fmt.Errorf("SAML settings Certificate is not empty: `%s`", s.Certificate) } if s.PrivateKey != "" { - return fmt.Errorf("SAML settings PrivateKey is not empty") + return errors.New("SAML settings PrivateKey is not empty") } if s.AttrUsername != samlDefaultAttrUsername { return fmt.Errorf("SAML settings AttrUsername is not `%s`", samlDefaultAttrUsername) diff --git a/internal/provider/resource_tfe_team_project_access.go b/internal/provider/resource_tfe_team_project_access.go index 747cee528..c12c517b0 100644 --- a/internal/provider/resource_tfe_team_project_access.go +++ b/internal/provider/resource_tfe_team_project_access.go @@ -312,18 +312,18 @@ func resourceTFETeamProjectAccessRead(ctx context.Context, d *schema.ResourceDat // These two fields are only available in TFC and TFE v202308-1 and later if tmAccess.ProjectAccess != nil { - project_access := []map[string]interface{}{{ + projectAccess := []map[string]interface{}{{ "settings": tmAccess.ProjectAccess.ProjectSettingsPermission, "teams": tmAccess.ProjectAccess.ProjectTeamsPermission, }} - if err := d.Set("project_access", project_access); err != nil { + if err := d.Set("project_access", projectAccess); err != nil { return diag.Errorf("Error setting configuration of team project access %s: %v", d.Id(), err) } } if tmAccess.WorkspaceAccess != nil { - workspace_access := []map[string]interface{}{{ + workspaceAccess := []map[string]interface{}{{ "state_versions": tmAccess.WorkspaceAccess.WorkspaceStateVersionsPermission, "sentinel_mocks": tmAccess.WorkspaceAccess.WorkspaceSentinelMocksPermission, "runs": tmAccess.WorkspaceAccess.WorkspaceRunsPermission, @@ -335,7 +335,7 @@ func resourceTFETeamProjectAccessRead(ctx context.Context, d *schema.ResourceDat "run_tasks": tmAccess.WorkspaceAccess.WorkspaceRunTasksPermission, }} - if err := d.Set("workspace_access", workspace_access); err != nil { + if err := d.Set("workspace_access", workspaceAccess); err != nil { return diag.Errorf("Error setting configuration of team workspace access %s: %v", d.Id(), err) } } @@ -371,15 +371,15 @@ func resourceTFETeamProjectAccessUpdate(ctx context.Context, d *schema.ResourceD } if d.HasChange("workspace_access.0.state_versions") { - if state_versions, ok := d.GetOk("workspace_access.0.state_versions"); ok { - workspaceStateVersionsPermissionType := tfe.WorkspaceStateVersionsPermissionType(state_versions.(string)) + if stateVersions, ok := d.GetOk("workspace_access.0.state_versions"); ok { + workspaceStateVersionsPermissionType := tfe.WorkspaceStateVersionsPermissionType(stateVersions.(string)) options.WorkspaceAccess.StateVersions = &workspaceStateVersionsPermissionType } } if d.HasChange("workspace_access.0.sentinel_mocks") { - if sentinel_mocks, ok := d.GetOk("workspace_access.0.sentinel_mocks"); ok { - workspaceSentinelMocksPermissionType := tfe.WorkspaceSentinelMocksPermissionType(sentinel_mocks.(string)) + if sentinelMocks, ok := d.GetOk("workspace_access.0.sentinel_mocks"); ok { + workspaceSentinelMocksPermissionType := tfe.WorkspaceSentinelMocksPermissionType(sentinelMocks.(string)) options.WorkspaceAccess.SentinelMocks = &workspaceSentinelMocksPermissionType } } @@ -418,14 +418,14 @@ func resourceTFETeamProjectAccessUpdate(ctx context.Context, d *schema.ResourceD } if d.HasChange("workspace_access.0.delete") { - if delete, ok := d.GetOkExists("workspace_access.0.delete"); ok { - options.WorkspaceAccess.Delete = tfe.Bool(delete.(bool)) + if deleteAttr, ok := d.GetOkExists("workspace_access.0.delete"); ok { + options.WorkspaceAccess.Delete = tfe.Bool(deleteAttr.(bool)) } } if d.HasChange("workspace_access.0.run_tasks") { - if run_tasks, ok := d.GetOkExists("workspace_access.0.run_tasks"); ok { - options.WorkspaceAccess.RunTasks = tfe.Bool(run_tasks.(bool)) + if runTasks, ok := d.GetOkExists("workspace_access.0.run_tasks"); ok { + options.WorkspaceAccess.RunTasks = tfe.Bool(runTasks.(bool)) } } @@ -456,17 +456,16 @@ func resourceTFETeamProjectAccessDelete(ctx context.Context, d *schema.ResourceD // You cannot set custom permissions when access level is not "custom" func checkForCustomPermissions(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { - if access, ok := d.GetOk("access"); ok && access != "custom" { // is an empty [] if project_access is not in the config - project_access := d.GetRawConfig().GetAttr("project_access").AsValueSet().Values() - if len(project_access) != 0 { + projectAccess := d.GetRawConfig().GetAttr("project_access").AsValueSet().Values() + if len(projectAccess) != 0 { return fmt.Errorf("you can only set project_access permissions with access level custom") } // is an empty [] if project_access is not in the config - workspace_access := d.GetRawConfig().GetAttr("workspace_access").AsValueSet().Values() - if len(workspace_access) != 0 { + workspaceAccess := d.GetRawConfig().GetAttr("workspace_access").AsValueSet().Values() + if len(workspaceAccess) != 0 { return fmt.Errorf("you can only set workspace_access permissions with access level custom") } } diff --git a/internal/provider/workspace_run_helpers.go b/internal/provider/workspace_run_helpers.go index ea4a2fc05..0d0ec5c02 100644 --- a/internal/provider/workspace_run_helpers.go +++ b/internal/provider/workspace_run_helpers.go @@ -146,7 +146,7 @@ func getRunArgs(d *schema.ResourceData, isDestroyRun bool) map[string]interface{ return runArgs } -func createRun(client *tfe.Client, waitForRun bool, manualConfirm bool, isDestroyRun bool, ws *tfe.Workspace) (*tfe.Run, error) { +func createRun(tfeClient *tfe.Client, waitForRun bool, manualConfirm bool, isDestroyRun bool, ws *tfe.Workspace) (*tfe.Run, error) { // In fire-and-forget mode (waitForRun=false), autoapply is set to !manualConfirm // This should be intuitive, as "manual confirm" is the opposite of "auto apply" // @@ -166,7 +166,7 @@ func createRun(client *tfe.Client, waitForRun bool, manualConfirm bool, isDestro AutoApply: tfe.Bool(autoApply), } log.Printf("[DEBUG] Create run for workspace: %s", ws.ID) - run, err := client.Runs.Create(ctx, runConfig) + run, err := tfeClient.Runs.Create(ctx, runConfig) if err != nil { return nil, fmt.Errorf( "error creating run for workspace %s: %w", ws.ID, err) @@ -182,35 +182,44 @@ func createRun(client *tfe.Client, waitForRun bool, manualConfirm bool, isDestro return run, nil } -func confirmRun(client *tfe.Client, manualConfirm bool, isPlanOp bool, run *tfe.Run, ws *tfe.Workspace) error { +func confirmRun(tfeClient *tfe.Client, manualConfirm bool, isPlanOp bool, run *tfe.Run, ws *tfe.Workspace) error { // if human approval is required, an apply will auto kick off when run is manually approved if manualConfirm { confirmationPendingStatus := map[tfe.RunStatus]bool{} confirmationPendingStatus[run.Status] = true log.Printf("[INFO] Plan complete, waiting for manual confirm before proceeding run %q", run.ID) - _, err := awaitRun(client, run.ID, ws.Organization.Name, isPlanOp, confirmationPendingStatus, isConfirmed) + _, err := awaitRun(tfeClient, run.ID, ws.Organization.Name, isPlanOp, confirmationPendingStatus, isConfirmed) if err != nil { return err } } else { // if human approval is NOT required, go ahead and kick off an apply - log.Printf("[INFO] Plan complete, confirming an apply for run %q", run.ID) - err := client.Runs.Apply(ctx, run.ID, tfe.RunApplyOptions{ - Comment: tfe.String(fmt.Sprintf("Run confirmed by tfe_workspace_run resource via terraform-provider-tfe on %s", - time.Now().Format(time.UnixDate))), - }) + err := applyRun(tfeClient, run) if err != nil { - refreshed, fetchErr := client.Runs.Read(ctx, run.ID) - if fetchErr != nil { - err = fmt.Errorf("%w\n additionally, got an error while reading the run: %s", err, fetchErr.Error()) - } - return fmt.Errorf("run errored while applying run %s (waited til status %s, currently status %s): %w", run.ID, run.Status, refreshed.Status, err) + return err } } return nil } +func applyRun(tfeClient *tfe.Client, run *tfe.Run) error { + log.Printf("[INFO] Plan complete, confirming an apply for run %q", run.ID) + err := tfeClient.Runs.Apply(ctx, run.ID, tfe.RunApplyOptions{ + Comment: tfe.String(fmt.Sprintf("Run confirmed by tfe_workspace_run resource via terraform-provider-tfe on %s", + time.Now().Format(time.UnixDate))), + }) + if err != nil { + refreshed, fetchErr := tfeClient.Runs.Read(ctx, run.ID) + if fetchErr != nil { + err = fmt.Errorf("%w\n additionally, got an error while reading the run: %s", err, fetchErr.Error()) + } + return fmt.Errorf("run errored while applying run %s (waited til status %s, currently status %s): %w", run.ID, run.Status, refreshed.Status, err) + } + + return nil +} + func completeOrRetryRun(meta interface{}, run *tfe.Run, d *schema.ResourceData, retry bool, currentRetryAttempts int, retryMaxAttempts int, isDestroyRun bool) error { switch run.Status { case tfe.RunApplied: @@ -230,20 +239,20 @@ func completeOrRetryRun(meta interface{}, run *tfe.Run, d *schema.ResourceData, } } -func awaitRun(client *tfe.Client, runID string, organization string, isPlanOp bool, runPendingStatus map[tfe.RunStatus]bool, isDone func(*tfe.Run) bool) (*tfe.Run, error) { +func awaitRun(tfeClient *tfe.Client, runID string, organization string, isPlanOp bool, runPendingStatus map[tfe.RunStatus]bool, isDone func(*tfe.Run) bool) (*tfe.Run, error) { for i := 0; ; i++ { select { case <-ctx.Done(): return nil, fmt.Errorf("context canceled: %w", ctx.Err()) case <-time.After(backoff(backoffMin, backoffMax, i)): log.Printf("[DEBUG] Polling run %s", runID) - run, err := client.Runs.Read(ctx, runID) + run, err := tfeClient.Runs.Read(ctx, runID) if err != nil { log.Printf("[ERROR] Could not read run %s: %v", runID, err) continue } - run, err = hasFinalStatus(client, run, organization, isPlanOp, runPendingStatus, isDone) + run, err = hasFinalStatus(tfeClient, run, organization, isPlanOp, runPendingStatus, isDone) if run == nil && err == nil { // if both error and run is nil, then run is still in progress continue @@ -254,7 +263,7 @@ func awaitRun(client *tfe.Client, runID string, organization string, isPlanOp bo } } -func hasFinalStatus(client *tfe.Client, run *tfe.Run, organization string, isPlanOp bool, runPendingStatus map[tfe.RunStatus]bool, isDone func(*tfe.Run) bool) (*tfe.Run, error) { +func hasFinalStatus(tfeClient *tfe.Client, run *tfe.Run, organization string, isPlanOp bool, runPendingStatus map[tfe.RunStatus]bool, isDone func(*tfe.Run) bool) (*tfe.Run, error) { _, runIsInProgress := runPendingStatus[run.Status] switch { @@ -262,7 +271,7 @@ func hasFinalStatus(client *tfe.Client, run *tfe.Run, organization string, isPla log.Printf("[INFO] Run %s has reached a terminal state: %s", run.ID, run.Status) return run, nil case runIsInProgress: - logRunProgress(client, organization, isPlanOp, run) + logRunProgress(tfeClient, organization, isPlanOp, run) return nil, nil case run.Status == tfe.RunCanceled: log.Printf("[INFO] Run %s has been canceled, status is %s", run.ID, run.Status) @@ -273,9 +282,9 @@ func hasFinalStatus(client *tfe.Client, run *tfe.Run, organization string, isPla } } -func logRunProgress(client *tfe.Client, organization string, isPlanOp bool, run *tfe.Run) { +func logRunProgress(tfeClient *tfe.Client, organization string, isPlanOp bool, run *tfe.Run) { log.Printf("[DEBUG] Reading workspace %s", run.Workspace.ID) - ws, err := client.Workspaces.ReadByID(ctx, run.Workspace.ID) + ws, err := tfeClient.Workspaces.ReadByID(ctx, run.Workspace.ID) if err != nil { log.Printf("[ERROR] Unable to read workspace %s: %v", run.Workspace.ID, err) return @@ -284,7 +293,7 @@ func logRunProgress(client *tfe.Client, organization string, isPlanOp bool, run // if the workspace is locked and the current run has not started, assume that workspace was locked for other purposes. // display a message to indicate that the workspace is waiting to be manually unlocked before the run can proceed if ws.Locked && ws.CurrentRun != nil { - currentRun, err := client.Runs.Read(ctx, ws.CurrentRun.ID) + currentRun, err := tfeClient.Runs.Read(ctx, ws.CurrentRun.ID) if err != nil { log.Printf("[ERROR] Unable to read current run %s: %v", ws.CurrentRun.ID, err) return @@ -298,13 +307,13 @@ func logRunProgress(client *tfe.Client, organization string, isPlanOp bool, run // if this run is the current run in it's workspace, display it's position in the organization queue if ws.CurrentRun != nil && ws.CurrentRun.ID == run.ID { - runPositionInOrg, err := readRunPositionInOrgQueue(client, run.ID, organization) + runPositionInOrg, err := readRunPositionInOrgQueue(tfeClient, run.ID, organization) if err != nil { log.Printf("[ERROR] Unable to read run position in organization queue %v", err) return } - orgCapacity, err := client.Organizations.ReadCapacity(ctx, organization) + orgCapacity, err := tfeClient.Organizations.ReadCapacity(ctx, organization) if err != nil { log.Printf("[ERROR] Unable to read capacity for organization %s: %v", organization, err) return @@ -316,7 +325,7 @@ func logRunProgress(client *tfe.Client, organization string, isPlanOp bool, run } // if this run is not the current run in it's workspace, display it's position in the workspace queue - runPositionInWorkspace, err := readRunPositionInWorkspaceQueue(client, run.ID, ws.ID, isPlanOp, ws.CurrentRun) + runPositionInWorkspace, err := readRunPositionInWorkspaceQueue(tfeClient, run.ID, ws.ID, isPlanOp, ws.CurrentRun) if err != nil { log.Printf("[ERROR] Unable to read run position in workspace queue %v", err) return @@ -334,12 +343,12 @@ func logRunProgress(client *tfe.Client, organization string, isPlanOp bool, run log.Printf("[INFO] Waiting for run %s, status is %s", run.ID, run.Status) } -func readRunPositionInOrgQueue(client *tfe.Client, runID string, organization string) (int, error) { +func readRunPositionInOrgQueue(tfeClient *tfe.Client, runID string, organization string) (int, error) { position := 0 options := tfe.ReadRunQueueOptions{} for { - runQueue, err := client.Organizations.ReadRunQueue(ctx, organization, options) + runQueue, err := tfeClient.Organizations.ReadRunQueue(ctx, organization, options) if err != nil { return position, fmt.Errorf("unable to read run queue for organization %s: %w", organization, err) } @@ -361,13 +370,13 @@ func readRunPositionInOrgQueue(client *tfe.Client, runID string, organization st return position, nil } -func readRunPositionInWorkspaceQueue(client *tfe.Client, runID string, wsID string, isPlanOp bool, currentRun *tfe.Run) (int, error) { +func readRunPositionInWorkspaceQueue(tfeClient *tfe.Client, runID string, wsID string, isPlanOp bool, currentRun *tfe.Run) (int, error) { position := 0 options := tfe.RunListOptions{} found := false for { - runList, err := client.Runs.List(ctx, wsID, &options) + runList, err := tfeClient.Runs.List(ctx, wsID, &options) if err != nil { return position, fmt.Errorf("unable to read run list for workspace %s: %w", wsID, err) } @@ -419,14 +428,14 @@ func backoff(min, max float64, iter int) time.Duration { return time.Duration(backoff) * time.Millisecond } -func readPostPlanTaskStageInRun(client *tfe.Client, runID string) (bool, error) { +func readPostPlanTaskStageInRun(tfeClient *tfe.Client, runID string) (bool, error) { hasPostPlanTaskStage := false options := tfe.TaskStageListOptions{} for { - taskStages, err := client.TaskStages.List(ctx, runID, &options) + taskStages, err := tfeClient.TaskStages.List(ctx, runID, &options) if err != nil { - return hasPostPlanTaskStage, fmt.Errorf("[ERROR] Could not read task stages for run %s: %v", runID, err) + return hasPostPlanTaskStage, fmt.Errorf("[ERROR] Could not read task stages for run %s: %w", runID, err) } for _, item := range taskStages.Items { if item.Stage == tfe.PostPlan { From 140f199420f35674b80fdcf5a0e3f13a87f3b5e6 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 10 Oct 2023 10:59:04 -0600 Subject: [PATCH 056/420] Fixes flaky allowed_workspace_ids test --- internal/logging/logging_test.go | 11 +++++++++++ internal/provider/data_source_agent_pool_test.go | 1 + 2 files changed, 12 insertions(+) create mode 100644 internal/logging/logging_test.go diff --git a/internal/logging/logging_test.go b/internal/logging/logging_test.go new file mode 100644 index 000000000..dbcded7ac --- /dev/null +++ b/internal/logging/logging_test.go @@ -0,0 +1,11 @@ +package logging + +import ( + "net/http" + "testing" +) + +func TestLoggingNewLoggingTransport_IsRoundTripper(t *testing.T) { + transport := NewLoggingTransport("example", &http.Transport{}) + var _ http.RoundTripper = transport +} diff --git a/internal/provider/data_source_agent_pool_test.go b/internal/provider/data_source_agent_pool_test.go index 85a223d37..a1fb8e273 100644 --- a/internal/provider/data_source_agent_pool_test.go +++ b/internal/provider/data_source_agent_pool_test.go @@ -118,5 +118,6 @@ resource "tfe_agent_pool_allowed_workspaces" "foobar" { data "tfe_agent_pool" "foobar" { name = tfe_agent_pool.foobar.name organization = "%s" + depends_on = [ tfe_agent_pool_allowed_workspaces.foobar ] }`, rInt, organization, workspaceID, organization) } From 379fe1bcf32acfaa97f5853b2aff83c0df641ad7 Mon Sep 17 00:00:00 2001 From: Lauren Date: Tue, 10 Oct 2023 14:30:36 -0500 Subject: [PATCH 057/420] fix agent pool ID def (#1100) --- website/docs/r/agent_pool_allowed_workspaces.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/r/agent_pool_allowed_workspaces.html.markdown index eed9f2209..e452fa59a 100644 --- a/website/docs/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/r/agent_pool_allowed_workspaces.html.markdown @@ -44,7 +44,7 @@ resource "tfe_agent_pool_allowed_workspaces" "foobar" { The following arguments are supported: -* `agent_pool_id` - (Required) ID of the team. +* `agent_pool_id` - (Required) The ID of the agent pool. * `allowed_workspace_ids` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. From 922fc90adb45e8857800c32343f0f01b582186c5 Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:36:13 -0400 Subject: [PATCH 058/420] Update resource_tfe_variable_set.go --- internal/provider/resource_tfe_variable_set.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_variable_set.go b/internal/provider/resource_tfe_variable_set.go index a3d8ea76b..34081ec1c 100644 --- a/internal/provider/resource_tfe_variable_set.go +++ b/internal/provider/resource_tfe_variable_set.go @@ -150,7 +150,7 @@ func resourceTFEVariableSetRead(d *schema.ResourceData, meta interface{}) error func resourceTFEVariableSetUpdate(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) - if d.HasChange("name") || d.HasChange("description") || d.HasChange("global") { + if d.HasChange("name") || d.HasChange("description") || d.HasChange("global") || d.HasChange("priority") { options := tfe.VariableSetUpdateOptions{ Name: tfe.String(d.Get("name").(string)), Description: tfe.String(d.Get("description").(string)), From b638d19476c908bf279c5541393a6c32f9c65142 Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:36:13 -0400 Subject: [PATCH 059/420] Update website/docs/r/variable_set.html.markdown Co-authored-by: UKEME BASSEY --- website/docs/r/variable_set.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/variable_set.html.markdown b/website/docs/r/variable_set.html.markdown index 90a8cbdff..9435f6d7f 100644 --- a/website/docs/r/variable_set.html.markdown +++ b/website/docs/r/variable_set.html.markdown @@ -133,7 +133,7 @@ The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. * `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. -* `priority` - (Optional) Whether the variables in this set are able to be over-written by more specific scopes. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspace_ids` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource From d0180fe2523308fffe535b3ec7ff37ed9deade38 Mon Sep 17 00:00:00 2001 From: Isaac Collins <122894610+isaacmcollins@users.noreply.github.com> Date: Sun, 15 Oct 2023 12:45:14 -0600 Subject: [PATCH 060/420] Adjust regexp Co-authored-by: Nick Fagerlund --- internal/provider/resource_tfe_project.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index c4f1f5dc5..5bbf64573 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -34,7 +34,7 @@ func resourceTFEProject() *schema.Resource { Required: true, ValidateFunc: validation.All( validation.StringLenBetween(3, 36), - validation.StringMatch(regexp.MustCompile(`\A[\w\_\- ]+\z`), + validation.StringMatch(regexp.MustCompile(`\A[\w\-][\w\- ]+[\w\-]\z`), "can only include letters, numbers, spaces, -, and _."), ), }, From 8492c8b14f86ee1dc3ed49d86b3ebfea24f96d4b Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:14:53 +0000 Subject: [PATCH 061/420] cdktf: update d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown --- .../d/organization_membership.html.markdown | 47 ++++++---- .../d/organization_run_task.html.markdown | 17 ++-- .../python/d/organization_tags.html.markdown | 17 ++-- .../python/d/organizations.html.markdown | 17 ++-- .../docs/cdktf/python/d/outputs.html.markdown | 23 ++--- .../cdktf/python/d/policy_set.html.markdown | 17 ++-- .../docs/cdktf/python/d/project.html.markdown | 17 ++-- .../python/d/saml_settings.html.markdown | 42 +++++---- .../docs/cdktf/python/d/slug.html.markdown | 22 +++-- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 ++-- .../d/organization_membership.html.markdown | 89 +++++++++---------- .../d/organization_run_task.html.markdown | 31 ++++--- .../d/organization_tags.html.markdown | 21 +++-- .../typescript/d/organizations.html.markdown | 21 +++-- .../cdktf/typescript/d/outputs.html.markdown | 37 ++++---- .../typescript/d/policy_set.html.markdown | 21 +++-- .../cdktf/typescript/d/project.html.markdown | 21 +++-- .../typescript/d/saml_settings.html.markdown | 41 ++++++--- .../cdktf/typescript/d/slug.html.markdown | 26 +++--- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +++-- 20 files changed, 318 insertions(+), 247 deletions(-) diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index cc1def6d2..ffff8bf2a 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,15 +22,18 @@ be updated manually. ### Fetch by email ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -39,15 +42,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by username ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -56,15 +62,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by organization membership ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -89,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index 8429aa128..c7ed30ddb 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", + DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -47,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 4fffc37f9..6f11a23fa 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", + DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -44,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index 292e9c76f..b3cf933e5 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organizations import DataTfeOrganizations +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") + DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -41,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 8f6ed2dc5..2e4e48760 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -21,25 +21,28 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.random as random -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.random.id import Id +from imports.tfe.data_tfe_outputs import DataTfeOutputs +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. # For a more precise conversion please use the --provider flag in convert. - data_tfe_outputs_foo = tfe.data_tfe_outputs.DataTfeOutputs(self, "foo", + foo = DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) - random.id.Id(self, "vpc_id", + Id(self, "vpc_id", byte_length=8, keepers=[{ - "bar": data_tfe_outputs_foo.values.bar + "bar": foo.values.bar } ] ) @@ -59,4 +62,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 9b8aca2a9..1650cb017 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_policy_set import DataTfePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", + DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -64,4 +67,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 4a596f35f..f40145ff2 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_project import DataTfeProject +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_project.DataTfeProject(self, "foo", + DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index 338f92bfc..376cdd483 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,21 +16,31 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + DataTfeSamlSettings(self, "foo", + provider=admin + ) ``` ## Argument Reference @@ -64,4 +74,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 6537c5f55..89ee070e4 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", + test = DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=cdktf.Token.as_string_map(data_tfe_slug_test) + slug=Token.as_string_map(test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -47,4 +51,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index e95a873b6..17ae4aad2 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ssh_key import DataTfeSshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", + DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index a5a620a28..f9f65f023 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,22 +22,21 @@ be updated manually. ### Fetch by email ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - email: "user@company.com", - organization: "my-org-name", - } - ); + new DataTfeOrganizationMembership(this, "test", { + email: "user@company.com", + organization: "my-org-name", + }); } } @@ -46,22 +45,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by username ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - username: "my-username", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + username: "my-username", + }); } } @@ -70,22 +68,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by organization membership ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + }); } } @@ -110,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index 1ee342ef1..c1f65f0b8 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,22 +16,21 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( - this, - "example", - { - name: "task-name", - organization: "my-org-name", - } - ); + new DataTfeOrganizationRunTask(this, "example", { + name: "task-name", + organization: "my-org-name", + }); } } @@ -54,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index d608cc1e3..75763fa62 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { + new DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -47,4 +50,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 31989059d..f612f9fcb 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); + new DataTfeOrganizations(this, "foo", {}); } } @@ -44,4 +47,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 9b23d1a90..e1230ab01 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -21,30 +21,29 @@ Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as s In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as random from "./.gen/providers/random"; -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Id } from "./.gen/providers/random/id"; +import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. For a more precise conversion please use the --provider flag in convert.*/ - const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( - this, - "foo", - { - organization: "my-org", - workspace: "my-workspace", - } - ); - new random.id.Id(this, "vpc_id", { + const foo = new DataTfeOutputs(this, "foo", { + organization: "my-org", + workspace: "my-workspace", + }); + new Id(this, "vpc_id", { byte_length: 8, keepers: [ { - bar: dataTfeOutputsFoo.values.bar, + bar: foo.values.bar, }, ], }); @@ -67,4 +66,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 2a104a3c0..4ed6c1d99 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { + new DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -67,4 +70,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index 5f30b68c5..875b65281 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeProject.DataTfeProject(this, "foo", { + new DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index eac1110a0..4045d9037 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,21 +16,34 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new DataTfeSamlSettings(this, "foo", { + provider: admin, + }); + } } -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} ``` ## Argument Reference @@ -64,4 +77,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index af7210b06..8fe21a539 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { + const test = new DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: cdktf.Token.asStringMap(dataTfeSlugTest), + slug: Token.asStringMap(test), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -50,4 +54,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 0d701abdd..3ba919e18 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { + new DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file From b99a2be8f7825dbf0850df8abbe0aa9d57c2403a Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:15:13 +0000 Subject: [PATCH 062/420] cdktf: update r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown,r/sentinel_policy.html.markdown --- .../python/r/sentinel_policy.html.markdown | 17 +-- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +-- .../docs/cdktf/python/r/team.html.markdown | 32 +++-- .../cdktf/python/r/team_access.html.markdown | 27 ++-- .../cdktf/python/r/team_member.html.markdown | 22 ++-- .../cdktf/python/r/team_members.html.markdown | 46 ++++--- .../r/team_organization_member.html.markdown | 29 +++-- .../r/team_organization_members.html.markdown | 72 +++++------ .../r/team_project_access.html.markdown | 53 ++++---- .../cdktf/python/r/team_token.html.markdown | 48 +++++--- .../r/sentinel_policy.html.markdown | 21 ++-- .../cdktf/typescript/r/ssh_key.html.markdown | 21 ++-- .../cdktf/typescript/r/team.html.markdown | 40 +++--- .../typescript/r/team_access.html.markdown | 31 +++-- .../typescript/r/team_member.html.markdown | 26 ++-- .../typescript/r/team_members.html.markdown | 54 ++++---- .../r/team_organization_member.html.markdown | 47 +++---- .../r/team_organization_members.html.markdown | 115 +++++++++--------- .../r/team_project_access.html.markdown | 65 +++++----- .../typescript/r/team_token.html.markdown | 56 +++++---- 20 files changed, 472 insertions(+), 367 deletions(-) diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index 73d0ed16c..c9f5d2db2 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.sentinel_policy import SentinelPolicy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.sentinel_policy.SentinelPolicy(self, "test", + SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 177974c7f..5a43faf22 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.ssh_key import SshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.ssh_key.SshKey(self, "test", + SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -49,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index bec6f6a88..5232b4f29 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -33,15 +36,18 @@ class MyConvertedCode(cdktf.TerraformStack): Organization Permission usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -91,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index ab50b1a2d..0cf68d501 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_access import TeamAccess +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", + tfe_team_access_test = TeamAccess(self, "test_2", access="read", - team_id=cdktf.Token.as_string(tfe_team_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + team_id=test.id, + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -77,4 +82,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index e146c6558..cbb0466be 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_member import TeamMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_member_test = TeamMember(self, "test_1", + team_id=test.id, username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -61,4 +65,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 697cfe48b..f04aedc6e 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -48,22 +52,26 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of usernames: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_usernames = cdktf.Fn.toset(["user1", "user2"]) - tfe_team_test = tfe.team.Team(self, "test", + all_usernames = Fn.toset(["user1", "user2"]) + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), - usernames=cdktf.Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, + usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_members_test.override_logical_id("test") @@ -88,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 5353364f6..b74af25bb 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,29 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_member import TeamOrganizationMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_1", + tfe_team_test = Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = - tfe.team_organization_member.TeamOrganizationMember(self, "test_2", - organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", + organization_membership_id=test.id, + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -72,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 04ced9cca..44a247b02 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,37 +24,36 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_sample = - tfe.organization_membership.OrganizationMembership(self, "sample", + sample = OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_2", + tfe_team_test = Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.id), - cdktf.Token.as_string(tfe_organization_membership_sample.id) - ], - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[test.id, sample.id], + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -63,35 +62,38 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of organization members: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" - ]) + all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - tfe_organization_membership_all_membership_for_each_iterator = - cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) - tfe.organization_membership.OrganizationMembership(self, "all_membership", - email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), + all_membership_for_each_iterator = TerraformIterator.from_list( + Token.as_any(all_users)) + OrganizationMembership(self, "all_membership", + email=Token.as_string(all_membership_for_each_iterator.key), organization="my-org-name", - for_each=tfe_organization_membership_all_membership_for_each_iterator + for_each=all_membership_for_each_iterator ) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", - organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", + organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -113,4 +115,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index c731f4db5..ff15b44e0 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,27 +16,31 @@ Associate a team to permissions on a project. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_admin = tfe.team.Team(self, "admin", + admin = Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = - tfe.team_project_access.TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", access="admin", - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_admin.id) + project_id=test.id, + team_id=admin.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -84,31 +88,36 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_dev = tfe.team.Team(self, "dev", + dev = Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - tfe.team_project_access.TeamProjectAccess(self, "custom", + TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_dev.id), + project_id=test.id, + team_id=dev.id, workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -137,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index 4c90cfbb8..7e1f2ec67 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_token_test = TeamToken(self, "test_1", + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -52,27 +56,31 @@ never expire. When a token has an expiry: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -import ...gen.providers.time as time -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. # For a more precise conversion please use the --provider flag in convert. - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - time_rotating_example = time.rotating.Rotating(self, "example", + example = Rotating(self, "example", rotation_days=30 ) - tfe_team_token_test = tfe.team_token.TeamToken(self, "test_2", - expired_at=cdktf.Token.as_string(time_rotating_example.rotation_rfc3339), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_token_test = TeamToken(self, "test_2", + expired_at=Token.as_string(example.rotation_rfc3339), + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -91,4 +99,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 206276ff4..8b6cdfcf7 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sentinelPolicy.SentinelPolicy(this, "test", { + new SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -66,4 +69,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 90680d24c..8124e2b2f 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SshKey } from "./.gen/providers/tfe/ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sshKey.SshKey(this, "test", { + new SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -52,4 +55,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index b793d408b..f9fd2da7d 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -36,15 +39,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Organization Permission usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -97,4 +103,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 8af746faa..97c4e80f1 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamAccess } from "./.gen/providers/tfe/team-access"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new TeamAccess(this, "test_2", { access: "read", - teamId: cdktf.Token.asString(tfeTeamTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + teamId: test.id, + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -80,4 +85,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index eb7cf719c..045b3bec9 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMember } from "./.gen/providers/tfe/team-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMemberTest = new TeamMember(this, "test_1", { + teamId: test.id, username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -64,4 +68,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 5ca27b059..c1940fcc2 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -51,22 +55,26 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of usernames: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const allUsernames = cdktf.Fn.toset(["user1", "user2"]); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const allUsernames = Fn.toset(["user1", "user2"]); + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), - usernames: cdktf.Token.asList( + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, + usernames: Token.asList( "${[ for user in ${" + allUsernames + "} : user]}" ), }); @@ -96,4 +104,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 1eec91879..cb37b34f4 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,32 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_1", { + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = - new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { - organizationMembershipId: cdktf.Token.asString( - tfeOrganizationMembershipTest.id - ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( + this, + "test_2", + { + organizationMembershipId: test.id, + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -77,4 +82,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index ba1476eec..8480e22d9 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,38 +24,41 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipSample = - new tfe.organizationMembership.OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_2", { + const sample = new OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { - organizationMembershipIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.id), - cdktf.Token.asString(tfeOrganizationMembershipSample.id), - ], - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_3", + { + organizationMembershipIds: [test.id, sample.id], + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -66,48 +69,48 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of organization members: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const allUsers = cdktf.Fn.toset([ - "user1@hashicorp.com", - "user2@hashicorp.com", - ]); + const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const tfeOrganizationMembershipAllMembershipForEachIterator = - cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); - new tfe.organizationMembership.OrganizationMembership( - this, - "all_membership", - { - email: cdktf.Token.asString( - tfeOrganizationMembershipAllMembershipForEachIterator.key - ), - organization: "my-org-name", - forEach: tfeOrganizationMembershipAllMembershipForEachIterator, - } + const allMembershipForEachIterator = TerraformIterator.fromList( + Token.asAny(allUsers) ); - const tfeTeamTest = new tfe.team.Team(this, "test", { + new OrganizationMembership(this, "all_membership", { + email: Token.asString(allMembershipForEachIterator.key), + organization: "my-org-name", + forEach: allMembershipForEachIterator, + }); + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { - organizationMembershipIds: cdktf.Token.asList( + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_2", + { + organizationMembershipIds: Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + teamId: test.id, + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -131,4 +134,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index db12e574d..4c9e1f8f8 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,28 +16,32 @@ Associate a team to permissions on a project. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamAdmin = new tfe.team.Team(this, "admin", { + const admin = new Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = - new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamAdmin.id), - }); + const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: test.id, + teamId: admin.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -87,23 +91,28 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamDev = new tfe.team.Team(this, "dev", { + const dev = new Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { + new TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -111,8 +120,8 @@ class MyConvertedCode extends cdktf.TerraformStack { teams: "none", }, ], - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamDev.id), + projectId: test.id, + teamId: dev.id, workspaceAccess: [ { create: true, @@ -145,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index f450192af..1b0eeb542 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_1", { + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -55,27 +59,31 @@ never expire. When a token has an expiry: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -import * as time from "./.gen/providers/time"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const timeRotatingExample = new time.rotating.Rotating(this, "example", { + const example = new Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { - expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_2", { + expiredAt: Token.asString(example.rotationRfc3339), + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -97,4 +105,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file From 9c697b4a3107c8a1092687986d632fd56c5c7327 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:15:15 +0000 Subject: [PATCH 063/420] cdktf: update r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown,d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown --- .../docs/cdktf/python/d/team.html.markdown | 17 ++-- .../cdktf/python/d/team_access.html.markdown | 17 ++-- .../d/team_project_access.html.markdown | 17 ++-- .../docs/cdktf/python/d/teams.html.markdown | 17 ++-- .../cdktf/python/d/variable_set.html.markdown | 17 ++-- .../cdktf/python/d/variables.html.markdown | 43 +++++----- .../cdktf/python/d/workspace.html.markdown | 17 ++-- .../python/d/workspace_ids.html.markdown | 23 +++--- .../python/d/workspace_run_task.html.markdown | 17 ++-- .../r/admin_organization_settings.markdown | 74 +++++++++-------- .../cdktf/typescript/d/team.html.markdown | 21 ++--- .../typescript/d/team_access.html.markdown | 21 ++--- .../d/team_project_access.html.markdown | 21 ++--- .../cdktf/typescript/d/teams.html.markdown | 21 ++--- .../typescript/d/variable_set.html.markdown | 21 ++--- .../typescript/d/variables.html.markdown | 79 +++++++++---------- .../typescript/d/workspace.html.markdown | 21 ++--- .../typescript/d/workspace_ids.html.markdown | 27 ++++--- .../d/workspace_run_task.html.markdown | 21 ++--- .../r/admin_organization_settings.markdown | 73 +++++++++-------- 20 files changed, 325 insertions(+), 260 deletions(-) diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 3e4f2c5e4..8dcf44b9b 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team import DataTfeTeam +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team.DataTfeTeam(self, "test", + DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index 9755cf929..6ce1b674f 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_access import DataTfeTeamAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", + DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -52,4 +55,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index 503c9eb11..0d0da5115 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", + DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index d812caa3c..4c55522ec 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_teams import DataTfeTeams +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_teams.DataTfeTeams(self, "foo", + DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -39,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 93b0a22c8..4922935a4 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -48,4 +51,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 86ecde0ac..77353b5c0 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,20 +16,24 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variables import DataTfeVariables +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + test = DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + workspace_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -38,21 +42,24 @@ class MyConvertedCode(cdktf.TerraformStack): For variable set variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +from imports.tfe.data_tfe_variables import DataTfeVariables +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_variable_set_test = - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + test = DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + variable_set_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -80,4 +87,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 62fd9e8da..875803789 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -84,4 +87,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index 31ac562e9..58a1fb01e 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", + DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", + DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", + DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", + DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -61,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index a278338f7..1cb0789a7 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", + DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 09c1f631e..a73146090 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,39 +17,45 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" -} - -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.admin_organization_settings import AdminOrganizationSettings +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + a_module_consumer = Organization(self, "a-module-consumer", + email="admin@company.com", + name="my-other-org" + ) + a_module_producer = Organization(self, "a-module-producer", + email="admin@company.com", + name="my-org" + ) + AdminOrganizationSettings(self, "test-settings", + access_beta_tools=False, + global_module_sharing=False, + module_sharing_consumer_organizations=[a_module_consumer.name], + organization=a_module_producer.name, + provider="${tfe.admin}", + workspace_limit=15 + ) ``` ## Argument Reference @@ -70,4 +76,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 51606205e..97471ee15 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeam.DataTfeTeam(this, "test", { + new DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index 8cd9aea95..f09d31bf6 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { + new DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -55,4 +58,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 65ed3def9..0288eca84 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { + new DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index d19832163..e2de9c343 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { + new DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index ae9a70417..e63ff625a 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + new DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -51,4 +54,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 93b932f9d..ec9627457 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,29 +16,25 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( - this, - "test", - { - name: "my-workspace-name", - organization: "my-org-name", - } - ); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), - } - ); + const test = new DataTfeWorkspace(this, "test", { + name: "my-workspace-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + workspaceId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -49,26 +45,25 @@ class MyConvertedCode extends cdktf.TerraformStack { For variable set variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeVariableSetTest = - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), - } - ); + const test = new DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + variableSetId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -98,4 +93,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 26054c3ab..c68212b0e 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { + new DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -87,4 +90,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 3f83d01b9..2b9cd5008 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { + new DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { + new DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { + new DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { + new DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -64,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 7aa26820c..96d78871e 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { + new DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -48,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 93f71e023..a6ed9a465 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,39 +17,48 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + const aModuleConsumer = new Organization(this, "a-module-consumer", { + email: "admin@company.com", + name: "my-other-org", + }); + const aModuleProducer = new Organization(this, "a-module-producer", { + email: "admin@company.com", + name: "my-org", + }); + new AdminOrganizationSettings(this, "test-settings", { + accessBetaTools: false, + globalModuleSharing: false, + moduleSharingConsumerOrganizations: [aModuleConsumer.name], + organization: aModuleProducer.name, + provider: "${tfe.admin}", + workspaceLimit: 15, + }); + } } -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} ``` ## Argument Reference @@ -70,4 +79,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file From 4327a3b3fb1c517af57fed4bd496169ae3d46640 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:15:17 +0000 Subject: [PATCH 064/420] cdktf: update d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- .../cdktf/python/d/agent_pool.html.markdown | 17 +++--- .../d/github_installation.html.markdown | 32 ++++++---- .../cdktf/python/d/ip_ranges.html.markdown | 21 ++++--- .../cdktf/python/d/oauth_client.html.markdown | 47 +++++++++------ .../cdktf/python/d/organization.html.markdown | 17 +++--- .../d/organization_members.html.markdown | 22 ++++--- .../typescript/d/agent_pool.html.markdown | 21 ++++--- .../d/github_installation.html.markdown | 56 +++++++++--------- .../typescript/d/ip_ranges.html.markdown | 29 +++++---- .../typescript/d/oauth_client.html.markdown | 59 +++++++++++-------- .../typescript/d/organization.html.markdown | 21 ++++--- .../d/organization_members.html.markdown | 26 ++++---- 12 files changed, 206 insertions(+), 162 deletions(-) diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 7293e009c..5ef505403 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", + DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 8a6457b5a..4307e1f6a 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345 ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding a Github App Installation by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", name="installation_name" ) ``` @@ -59,4 +65,4 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index d51c305d5..e4846574b 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,17 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") - cdktf.TerraformOutput(self, "notifications_ips", - value=data_tfe_ip_ranges_addresses.notifications + addresses = DataTfeIpRanges(self, "addresses") + TerraformOutput(self, "notifications_ips", + value=addresses.notifications ) ``` @@ -42,4 +45,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 4aec1ba13..d597ecc3c 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -49,15 +55,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its service provider ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -93,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 5045a6657..138cd2228 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization import DataTfeOrganization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization.DataTfeOrganization(self, "foo", + DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index 73670ef47..ccd7dcf24 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_bar = tfe.organization.Organization(self, "bar", + bar = Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", - organization=cdktf.Token.as_string(tfe_organization_bar.name) + DataTfeOrganizationMembers(self, "foo", + organization=bar.name ) ``` @@ -48,4 +52,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index ffbc8593d..44f318eca 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { + new DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 54c0ea219..304f6a929 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,21 +16,20 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - installationId: 12345, - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + installationId: 12345, + }); } } @@ -39,21 +38,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding a Github App Installation by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "installation_name", - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + name: "installation_name", + }); } } @@ -73,4 +71,4 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 3aef65fe1..a4c0927da 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,21 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( - this, - "addresses", - {} - ); - new cdktf.TerraformOutput(this, "notifications_ips", { - value: dataTfeIpRangesAddresses.notifications, + const addresses = new DataTfeIpRanges(this, "addresses", {}); + new TerraformOutput(this, "notifications_ips", { + value: addresses.notifications, }); } } @@ -49,4 +48,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index fd3cee123..e093c1f42 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -35,15 +38,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -55,15 +61,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its service provider ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -102,4 +111,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 97f356774..80eeb599a 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { + new DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -48,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 290c8836c..95b1990cb 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { + const bar = new Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { - organization: cdktf.Token.asString(tfeOrganizationBar.name), + new DataTfeOrganizationMembers(this, "foo", { + organization: bar.name, }); } } @@ -51,4 +55,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file From 043e6b6be84289e9f1c54bc9a31a3c91907a9f16 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:15:26 +0000 Subject: [PATCH 065/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown --- website/docs/cdktf/python/index.html.markdown | 49 +++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 +++++++----- .../cdktf/python/r/variable_set.html.markdown | 86 +++++---- .../cdktf/python/r/workspace.html.markdown | 49 +++-- .../r/workspace_policy_set.html.markdown | 35 ++-- ...rkspace_policy_set_exclusion.html.markdown | 35 ++-- .../python/r/workspace_run.html.markdown | 110 ++++++----- .../python/r/workspace_run_task.html.markdown | 25 ++- .../r/workspace_variable_set.html.markdown | 35 ++-- .../docs/cdktf/typescript/index.html.markdown | 53 +++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 +++++++------- .../typescript/r/variable_set.html.markdown | 122 ++++++------ .../typescript/r/workspace.html.markdown | 87 ++++----- .../r/workspace_policy_set.html.markdown | 51 ++--- ...rkspace_policy_set_exclusion.html.markdown | 59 +++--- .../typescript/r/workspace_run.html.markdown | 182 +++++++++--------- .../r/workspace_run_task.html.markdown | 26 ++- .../r/workspace_variable_set.html.markdown | 55 +++--- 20 files changed, 758 insertions(+), 602 deletions(-) diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 352a8263c..488a1e9d5 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,14 +73,13 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.49.2" - } - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) ``` As this provider is still at version zero, you should constrain the acceptable @@ -99,17 +98,27 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` - token = var.token - version = "~> 0.49.2" -} - -# Create an organization -resource "tfe_organization" "org" { - # ... -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, email, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + Organization(self, "org", + email=email, + name=name + ) ``` ## Argument Reference @@ -129,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 5d19d8f3e..4945a4a2d 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.terraform_version import TerraformVersion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.terraform_version.TerraformVersion(self, "test", + TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -62,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index a32fa5e33..364a6b27d 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,30 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = tfe.variable.Variable(self, "test_2", + tfe_variable_test = Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -48,39 +53,44 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for variable sets: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -119,33 +129,41 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" -} - +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + sensitive_var = Variable(self, "sensitive_var", + category="terraform", + key="sensitive_key", + sensitive=True, + value="sensitive_value", + workspace_id=workspace.id + ) + visible_var = Variable(self, "visible_var", + category="terraform", + key="visible_key", + sensitive=False, + value="visible_value", + workspace_id=workspace.id + ) + Workspace(self, "sensitive_workspace", + name="workspace-${" + sensitive_var.value + "}", + organization="organization name" + ) + Workspace(self, "visible_workspace", + name="workspace-${" + visible_var.readable_value + "}", + organization="organization name" + ) ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -171,4 +189,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index 40dfc740b..e48e36c71 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,103 +16,115 @@ Creates, updates and destroys variable sets. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", + tfe_workspace_test = Workspace(self, "test_3", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_5", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -141,4 +153,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index d056c9ddd..97f02223c 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -18,21 +18,25 @@ Provides a workspace resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.workspace.Workspace(self, "test", + Workspace(self, "test", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, tag_names=["test", "app"] ) ``` @@ -40,27 +44,32 @@ class MyConvertedCode(cdktf.TerraformStack): With `execution_mode` of `agent`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe.workspace.Workspace(self, "test", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + Workspace(self, "test", + agent_pool_id=test_agent_pool.id, execution_mode="agent", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) ``` @@ -174,4 +183,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 733784218..c628fedb3 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set import WorkspacePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = - tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 5f052b546..14839cae4 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = - tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -71,4 +76,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index e79741bc7..d32e5c6e7 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,46 +24,52 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_child = tfe.workspace.Workspace(self, "child", + child = Workspace(self, "child", name="child-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + ws_run_parent = WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -76,58 +82,64 @@ class MyConvertedCode(cdktf.TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_child", + WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[tfe_workspace_run_ws_run_parent], + depends_on=[ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) + workspace_id=child.id ) ``` With manual confirmation: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -135,43 +147,49 @@ class MyConvertedCode(cdktf.TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` With no retries: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -181,7 +199,7 @@ class MyConvertedCode(cdktf.TerraformStack): retry=False, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` @@ -210,4 +228,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 450d01813..9f1525ed7 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,12 +17,23 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.workspace_run_task import WorkspaceRunTask +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + WorkspaceRunTask(self, "example", + enforcement_level="advisory", + task_id=tfe_organization_run_task.example.id, + workspace_id=tfe_workspace.example.id + ) ``` ## Argument Reference @@ -47,4 +58,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index de6cad570..29f11de9f 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 0af537aa4..4a01c70f6 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -73,14 +73,16 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.49.2" - } +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); } } + ``` As this provider is still at version zero, you should constrain the acceptable @@ -99,17 +101,34 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` - token = var.token - version = "~> 0.49.2" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +interface MyConfig { + email: any; + name: any; } - -# Create an organization -resource "tfe_organization" "org" { - # ... +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + new Organization(this, "org", { + email: config.email, + name: config.name, + }); + } } + ``` ## Argument Reference @@ -117,7 +136,7 @@ resource "tfe_organization" "org" { The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. - Defaults to `app.terraform.io`. Can be overridden by setting the + Defaults to `appTerraformIo`. Can be overridden by setting the `tfeHostname` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. @@ -129,4 +148,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index f122ae910..18d301451 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.terraformVersion.TerraformVersion(this, "test", { + new TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -65,4 +68,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 1d442d61a..015d5d326 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,34 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { + const tfeVariableTest = new Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -55,43 +56,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for variable sets: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -133,31 +135,42 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const sensitiveVar = new Variable(this, "sensitive_var", { + category: "terraform", + key: "sensitive_key", + sensitive: true, + value: "sensitive_value", + workspaceId: workspace.id, + }); + const visibleVar = new Variable(this, "visible_var", { + category: "terraform", + key: "visible_key", + sensitive: false, + value: "visible_value", + workspaceId: workspace.id, + }); + new Workspace(this, "sensitive_workspace", { + name: "workspace-${" + sensitiveVar.value + "}", + organization: "organization name", + }); + new Workspace(this, "visible_workspace", { + name: "workspace-${" + visibleVar.readableValue + "}", + organization: "organization name", + }); + } } ``` @@ -185,4 +198,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index fdb8480e8..106d723e6 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,68 +16,75 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeProjectTest = new tfe.project.Project(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { + const tfeVariableSetTest = new VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { + const tfeWorkspaceTest = new Workspace(this, "test_3", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_4", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = - new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { - projectId: cdktf.Token.asString(tfeProjectTest.id), - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -87,43 +94,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a global variable set: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -155,4 +163,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 17da01aec..0e9cecb61 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -18,25 +18,25 @@ Provides a workspace resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.workspace.Workspace(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Workspace(this, "test", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, tagNames: ["test", "app"], }); } @@ -47,37 +47,32 @@ class MyConvertedCode extends cdktf.TerraformStack { With `executionMode` of `agent`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - } - ); - new tfe.workspace.Workspace(this, "test", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + }); + new Workspace(this, "test", { + agentPoolId: testAgentPool.id, executionMode: "agent", name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); } } @@ -194,4 +189,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index 08afbc792..f1f0420c9 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -18,40 +18,41 @@ Adds and removes policy sets from a workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = - new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -78,4 +79,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 2bca759b3..635fdf53c 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -18,44 +18,45 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = - new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -82,4 +83,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index f1875dbe2..466abe78e 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -24,82 +24,80 @@ The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or Basic usage with multiple workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { + const child = new Workspace(this, "child", { name: "child-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, + }, + }); + const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: parent.id, }); - const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( - this, - "ws_run_parent", - { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, - }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), - } - ); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { + new WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [tfeWorkspaceRunWsRunParent], + dependsOn: [wsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), + workspaceId: child.id, }); } } @@ -109,40 +107,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With manual confirmation: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends cdktf.TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -160,40 +160,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With no retries: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -203,7 +205,7 @@ class MyConvertedCode extends cdktf.TerraformStack { retry: false, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -235,4 +237,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 2af33a4b9..4a9ed1f46 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,12 +17,26 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new WorkspaceRunTask(this, "example", { + enforcementLevel: "advisory", + taskId: tfeOrganizationRunTask.example.id, + workspaceId: tfeWorkspace.example.id, + }); + } } + ``` ## Argument Reference @@ -47,4 +61,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 946d0f324..aa89dcd59 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -18,40 +18,45 @@ Adds and removes variable sets from a workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_3", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -78,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 21d9fc60be25cd0d51253427a25d74a2aefde5fa Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:15:35 +0000 Subject: [PATCH 066/420] cdktf: update r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_module.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown --- .../python/r/organization_token.html.markdown | 48 ++-- .../docs/cdktf/python/r/policy.html.markdown | 32 ++- .../cdktf/python/r/policy_set.html.markdown | 113 +++++--- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 34 ++- .../r/project_variable_set.html.markdown | 35 +-- .../python/r/registry_module.html.markdown | 121 +++++---- .../cdktf/python/r/run_trigger.html.markdown | 33 ++- .../python/r/saml_settings.html.markdown | 35 ++- .../r/organization_token.html.markdown | 51 ++-- .../cdktf/typescript/r/policy.html.markdown | 40 +-- .../typescript/r/policy_set.html.markdown | 112 +++++--- .../r/policy_set_parameter.html.markdown | 48 ++-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 54 ++-- .../r/project_variable_set.html.markdown | 51 ++-- .../r/registry_module.html.markdown | 243 ++++++++---------- .../typescript/r/run_trigger.html.markdown | 63 ++--- .../typescript/r/saml_settings.html.markdown | 34 ++- 20 files changed, 697 insertions(+), 536 deletions(-) diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 66f833f7b..bed2c0235 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_token import OrganizationToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_token.OrganizationToken(self, "test", + OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -46,15 +49,28 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 -} - -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization_token import OrganizationToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + # For a more precise conversion please use the --provider flag in convert. + example = Rotating(self, "example", + rotation_days=30 + ) + OrganizationToken(self, "test", + expired_at=Token.as_string(example.rotation_rfc3339), + organization=Token.as_string(org.name) + ) ``` ## Attributes Reference @@ -71,4 +87,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 5da71d87c..793b3429b 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -42,15 +45,18 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -91,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 421c6b526..afa0bedd6 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,54 +21,85 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policies_path="policies/my-policy-set", + vcs_repo=PolicySetVcsRepo( + branch="main", + identifier="my-org-name/my-policy-set-repository", + ingress_submodules=False, + oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) + ), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" -} - -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataTfeSlug(self, "test", + source_path="policies/my-policy-set" + ) + tfe_policy_set_test = PolicySet(self, "test_1", + description="A brand new policy set", + name="my-policy-set", + organization="my-org-name", + slug=Token.as_string_map(test), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_policy_set_test.override_logical_id("test") ``` ## Argument Reference @@ -128,4 +159,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 9758004e6..002101944 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,28 +16,32 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.policy_set_parameter import PolicySetParameter +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = - tfe.policy_set_parameter.PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + policy_set_id=Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -69,4 +73,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 0763e2626..abdf640b8 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,21 +16,25 @@ Provides a project resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.project.Project(self, "test", + Project(self, "test", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) ``` @@ -55,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index f3a5cd235..a2687c8f0 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -16,34 +16,40 @@ Adds and removes policy sets from a project Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.project import Project +from imports.tfe.project_policy_set import ProjectPolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_project_test = tfe.project.Project(self, "test_2", + tfe_project_test = Project(self, "test_2", name="my-project-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = tfe.project_policy_set.ProjectPolicySet(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - project_id=cdktf.Token.as_string(tfe_project_test.id) + tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + project_id=Token.as_string(tfe_project_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_policy_set_test.override_logical_id("test") @@ -68,4 +74,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index da5561bc7..066c7d5e0 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,35 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="my-project-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_3", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -69,4 +74,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index d73e2216d..11c5bef3b 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,30 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", + test_oauth_client = OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, service_provider="github" ) - tfe.registry_module.RegistryModule(self, "test-registry-module", + RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) + oauth_token_id=test_oauth_client.oauth_token_id ) ) ``` @@ -47,27 +52,31 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module with GitHub App: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - data_tfe_github_app_installation_gha_installation = - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - tfe.registry_module.RegistryModule(self, "petstore", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + RegistryModule(self, "petstore", + organization=test_organization.name, vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), + github_app_installation_id=Token.as_string(gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -76,22 +85,26 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module without VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-private-registry-module", + RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="private" ) ``` @@ -99,23 +112,27 @@ class MyConvertedCode(cdktf.TerraformStack): Create public registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-public-registry-module", + RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) ``` @@ -123,29 +140,33 @@ class MyConvertedCode(cdktf.TerraformStack): Create no-code provisioning registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_test_no_code_provisioning_registry_module = - tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", + test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) - tfe.no_code_module.NoCodeModule(self, "foobar", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) + NoCodeModule(self, "foobar", + organization=test_organization.id, + registry_module=test_no_code_provisioning_registry_module.id ) ``` @@ -197,4 +218,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index f4dd3b56c..e49570aed 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,29 +19,34 @@ to up to 20 source workspaces. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.run_trigger import RunTrigger +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", + test_sourceable = Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", + test_workspace = Workspace(self, "test-workspace", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.run_trigger.RunTrigger(self, "test", - sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) + RunTrigger(self, "test", + sourceable_id=test_sourceable.id, + workspace_id=test_workspace.id ) ``` @@ -65,4 +70,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index 0fa49386c..e955b370a 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,17 +15,28 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.provider import TfeProvider +from imports.tfe.saml_settings import SamlSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=admin_token.string_value + ) + SamlSettings(self, "this", + idp_cert="foobarCertificate", + slo_endpoint_url="https://example.com/slo_endpoint_url", + sso_endpoint_url="https://example.com/sso_endpoint_url" + ) ``` ## Argument Reference @@ -64,4 +75,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 13d4d4730..d37a973cf 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationToken.OrganizationToken(this, "test", { + new OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -49,15 +52,31 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new Rotating(this, "example", { + rotation_days: 30, + }); + new OrganizationToken(this, "test", { + expiredAt: Token.asString(example.rotationRfc3339), + organization: Token.asString(org.name), + }); + } } -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} ``` ## Attributes Reference @@ -74,4 +93,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index d99b59da7..e5f2e8540 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -45,15 +48,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -97,4 +103,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 8d382fa79..0d970bf07 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,54 +21,94 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policiesPath: "policies/my-policy-set", + vcsRepo: { + branch: "main", + identifier: "my-org-name/my-policy-set-repository", + ingressSubmodules: false, + oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), + }, + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); } } + ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policyIds: [Token.asString(tfeSentinelPolicyTest.id)], + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + } } + ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataTfeSlug(this, "test", { + sourcePath: "policies/my-policy-set", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { + description: "A brand new policy set", + name: "my-policy-set", + organization: "my-org-name", + slug: Token.asStringMap(test), + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + } } -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} ``` ## Argument Reference @@ -128,4 +168,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index f7d672c9d..c1cd54e3d 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = - new tfe.policySetParameter.PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 06087bc21..eaee9c086 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.project.Project(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Project(this, "test", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 86709c22d..90a574997 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -16,43 +16,41 @@ Adds and removes policy sets from a project Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new tfe.project.Project(this, "test_2", { + const tfeProjectTest = new Project(this, "test_2", { name: "my-project-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new tfe.projectPolicySet.ProjectPolicySet( - this, - "test_3", - { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - projectId: cdktf.Token.asString(tfeProjectTest.id), - } - ); + const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + projectId: Token.asString(tfeProjectTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectPolicySetTest.overrideLogicalId("test"); } @@ -79,4 +77,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index 62fa66b9d..a973a2f2d 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -16,40 +16,41 @@ Adds and removes variable sets from a project Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeProjectTest = new tfe.project.Project(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { name: "my-project-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { + const tfeVariableSetTest = new VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = - new tfe.projectVariableSet.ProjectVariableSet(this, "test_3", { - projectId: cdktf.Token.asString(tfeProjectTest.id), - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); } @@ -76,4 +77,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 4e29b136c..d318812d2 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,42 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( - this, - "test-oauth-client", - { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - serviceProvider: "github", - } - ); - new tfe.registryModule.RegistryModule(this, "test-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testOauthClient = new OauthClient(this, "test-oauth-client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: testOrganization.name, + serviceProvider: "github", + }); + new RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: cdktf.Token.asString( - tfeOauthClientTestOauthClient.oauthTokenId - ), + oauthTokenId: testOauthClient.oauthTokenId, }, }); } @@ -62,37 +55,35 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module with GitHub App: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const ghaInstallation = new DataTfeGithubAppInstallation( this, - "test-organization", + "gha_installation", { - email: "admin@company.com", - name: "my-org-name", + name: "YOUR_GH_NAME", } ); - const dataTfeGithubAppInstallationGhaInstallation = - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "YOUR_GH_NAME", - } - ); - new tfe.registryModule.RegistryModule(this, "petstore", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + new RegistryModule(this, "petstore", { + organization: testOrganization.name, vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: cdktf.Token.asString( - dataTfeGithubAppInstallationGhaInstallation.id - ), + githubAppInstallationId: Token.asString(ghaInstallation.id), identifier: "GH_NAME/REPO_NAME", }, }); @@ -104,34 +95,28 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module without VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule( - this, - "test-private-registry-module", - { - moduleProvider: "my_provider", - name: "another_test_module", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "private", - } - ); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-private-registry-module", { + moduleProvider: "my_provider", + name: "another_test_module", + organization: testOrganization.name, + registryName: "private", + }); } } @@ -140,27 +125,27 @@ class MyConvertedCode extends cdktf.TerraformStack { Create public registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, registryName: "public", }); } @@ -171,41 +156,37 @@ class MyConvertedCode extends cdktf.TerraformStack { Create no-code provisioning registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testNoCodeProvisioningRegistryModule = new RegistryModule( this, - "test-organization", + "test-no-code-provisioning-registry-module", { - email: "admin@company.com", - name: "my-org-name", + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: testOrganization.name, + registryName: "public", } ); - const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = - new tfe.registryModule.RegistryModule( - this, - "test-no-code-provisioning-registry-module", - { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "public", - } - ); - new tfe.noCodeModule.NoCodeModule(this, "foobar", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - registryModule: cdktf.Token.asString( - tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id - ), + new NoCodeModule(this, "foobar", { + organization: testOrganization.id, + registryModule: testNoCodeProvisioningRegistryModule.id, }); } } @@ -260,4 +241,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index dcfe00943..89588e323 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,41 +19,34 @@ to up to 20 source workspaces. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( - this, - "test-sourceable", - { - name: "my-sourceable-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( - this, - "test-workspace", - { - name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.runTrigger.RunTrigger(this, "test", { - sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testSourceable = new Workspace(this, "test-sourceable", { + name: "my-sourceable-workspace-name", + organization: testOrganization.id, + }); + const testWorkspace = new Workspace(this, "test-workspace", { + name: "my-workspace-name", + organization: testOrganization.id, + }); + new RunTrigger(this, "test", { + sourceableId: testSourceable.id, + workspaceId: testWorkspace.id, }); } } @@ -80,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 430a810e7..d73db9393 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,17 +15,31 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TfeProvider } from "./.gen/providers/tfe/provider"; +import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new SamlSettings(this, "this", { + idpCert: "foobarCertificate", + sloEndpointUrl: "https://example.com/slo_endpoint_url", + ssoEndpointUrl: "https://example.com/sso_endpoint_url", + }); + } } -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } ``` ## Argument Reference @@ -64,4 +78,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file From 1788df1948e74bd97f8b0ed64acfa3dbe92c0335 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 00:16:09 +0000 Subject: [PATCH 067/420] cdktf: update r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown,r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown --- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 57 +++-- .../cdktf/python/r/agent_token.html.markdown | 27 ++- .../python/r/no_code_module.html.markdown | 56 +++-- .../notification_configuration.html.markdown | 96 ++++---- .../cdktf/python/r/oauth_client.html.markdown | 47 ++-- .../cdktf/python/r/organization.html.markdown | 17 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 56 +++-- .../typescript/r/agent_token.html.markdown | 49 ++--- .../typescript/r/no_code_module.html.markdown | 140 ++++++------ .../notification_configuration.html.markdown | 208 +++++++++--------- .../typescript/r/oauth_client.html.markdown | 59 ++--- .../typescript/r/organization.html.markdown | 21 +- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 21 +- .../r/organization_run_task.html.markdown | 21 +- 20 files changed, 543 insertions(+), 462 deletions(-) diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index ced066093..f7947edeb 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,21 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.agent_pool.AgentPool(self, "test-agent-pool", + AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, organization_scoped=True ) ``` @@ -63,4 +67,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index 938bc6991..9e24ffa93 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -19,34 +19,45 @@ for Business account. Basic usage: -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true -} - -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test_organization = Organization(self, "test-organization", + email="admin@company.com", + name="my-org-name" + ) + test = Workspace(self, "test", + name="my-workspace-name", + organization=Token.as_string(tfe_organization_test.name) + ) + AgentPool(self, "test-agent-pool", + name="my-agent-pool-name", + organization=test_organization.name, + organization_scoped=True + ) + AgentPoolAllowedWorkspaces(self, "foobar", + agent_pool_id=Token.as_string(tfe_agent_pool_foobar.id), + allowed_workspace_ids=[test.id] + ) ``` ## Argument Reference The following arguments are supported: -* `agent_pool_id` - (Required) ID of the team. +* `agent_pool_id` - (Required) The ID of the agent pool. * `allowed_workspace_ids` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. @@ -59,4 +70,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 7cc7972c4..357e859cc 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,24 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_token import AgentToken +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.agent_token.AgentToken(self, "test-agent-token", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + AgentToken(self, "test-agent-token", + agent_pool_id=test_agent_pool.id, description="my-agent-token-name" ) ``` @@ -52,4 +57,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 797abcd7c..678ab8cd0 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,28 +16,33 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -46,28 +51,33 @@ class MyConvertedCode(cdktf.TerraformStack): Creating a no-code module with variable options: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -109,4 +119,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index d84e282c3..39c9d68ef 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,32 +19,36 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -53,41 +57,43 @@ class MyConvertedCode(cdktf.TerraformStack): With `destination_type` of `email`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -96,43 +102,45 @@ class MyConvertedCode(cdktf.TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -180,4 +188,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index f739902ae..7b06126a3 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -44,15 +47,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -71,15 +77,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -121,4 +130,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index f32912a93..bdcc33f7b 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization.Organization(self, "test", + Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -61,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 1582dadb2..390a2e73c 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_membership.OrganizationMembership(self, "test", + OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -66,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 492a62139..165fb1666 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,15 +19,18 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_module_sharing import OrganizationModuleSharing +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", + OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -40,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 535677464..076f8a0b6 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_run_task import OrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_run_task.OrganizationRunTask(self, "example", + OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -60,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 5b7085fc6..1b3d9b210 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.agentPool.AgentPool(this, "test-agent-pool", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index 9458015d2..035622708 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -19,34 +19,48 @@ for Business account. Basic usage: -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new Workspace(this, "test", { + name: "my-workspace-name", + organization: Token.asString(tfeOrganizationTest.name), + }); + new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + organizationScoped: true, + }); + new AgentPoolAllowedWorkspaces(this, "foobar", { + agentPoolId: Token.asString(tfeAgentPoolFoobar.id), + allowedWorkspaceIds: [test.id], + }); + } } -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true -} - -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] -} ``` ## Argument Reference The following arguments are supported: -* `agentPoolId` - (Required) ID of the team. +* `agentPoolId` - (Required) The ID of the agent pool. * `allowedWorkspaceIds` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. @@ -59,4 +73,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index e37e6da4d..530a19d6a 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,32 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentToken } from "./.gen/providers/tfe/agent-token"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.agentToken.AgentToken(this, "test-agent-token", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.id, + }); + new AgentToken(this, "test-agent-token", { + agentPoolId: testAgentPool.id, description: "my-agent-token-name", }); } @@ -63,4 +60,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index f740a6434..bd4c0def0 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,41 +16,34 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -61,53 +54,46 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a no-code module with variable options: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -141,4 +127,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 81ee6208b..f772d9699 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_2", - { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,50 +64,52 @@ class MyConvertedCode extends cdktf.TerraformStack { With `destinationType` of `email`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -118,55 +120,57 @@ class MyConvertedCode extends cdktf.TerraformStack { (**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -216,4 +220,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index da2e6cca5..5fe9abf31 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -47,15 +50,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -78,15 +84,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -133,4 +142,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index cbaab56b4..94f77e3c1 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organization.Organization(this, "test", { + new Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -64,4 +67,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 1ba96fccd..af3a1efb7 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationMembership.OrganizationMembership(this, "test", { + new OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -69,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 7a8d6f4bc..6b1954c0d 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -19,15 +19,18 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { + new OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -43,4 +46,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index af88749b5..c7b69cabc 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationRunTask.OrganizationRunTask(this, "example", { + new OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file From 6a8c28f75db6240be9a5809dabbe30765116c576 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:14:17 +0000 Subject: [PATCH 068/420] [COMPLIANCE] Add Copyright and License Headers --- internal/client/client_test.go | 3 +++ internal/logging/logging_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/client/client_test.go b/internal/client/client_test.go index df9f8f8c0..3cc4afcd1 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package client import ( diff --git a/internal/logging/logging_test.go b/internal/logging/logging_test.go index dbcded7ac..f92c96999 100644 --- a/internal/logging/logging_test.go +++ b/internal/logging/logging_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package logging import ( From d992cd3dc42e6c684173c2ad3205427e17302467 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Wed, 25 Oct 2023 14:25:31 -0700 Subject: [PATCH 069/420] Fix flaky TFESAMLSettings resource tests, add comments These tests flake violently, because they're competing for control of global singleton state. The flakes show a distinctive pattern: they only flake when at least two of the resource test funcs end up on separate test runner partitions in CI, and re-running a single one failed partition alone always succeeds (because there's no concurrent competition anymore). The fix is to make sure all of these tests ALWAYS run in serial on a single test runner partition. Smooshing into a single outer func and calling t.Run without t.Parallel seems like it should fit the bill. --- .../data_source_saml_settings_test.go | 6 + .../resource_tfe_saml_settings_test.go | 401 +++++++++--------- 2 files changed, 213 insertions(+), 194 deletions(-) diff --git a/internal/provider/data_source_saml_settings_test.go b/internal/provider/data_source_saml_settings_test.go index e2a9abef1..a4c9ba9c7 100644 --- a/internal/provider/data_source_saml_settings_test.go +++ b/internal/provider/data_source_saml_settings_test.go @@ -9,6 +9,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +// FLAKE ALERT: SAML settings are a singleton resource shared by the entire TFE +// instance, and any test touching them is at high risk to flake. +// This test is fine, because it only checks that the attributes have SOME +// value. Testing for any _particular_ value would not be viable, because +// `resource_tfe_saml_settings_test.go` exists. See that file for more color on +// this. func TestAccTFESAMLSettingsDataSource_basic(t *testing.T) { resourceAddress := "data.tfe_saml_settings.foobar" resource.Test(t, resource.TestCase{ diff --git a/internal/provider/resource_tfe_saml_settings_test.go b/internal/provider/resource_tfe_saml_settings_test.go index 7bf3410b9..d057a17a6 100644 --- a/internal/provider/resource_tfe_saml_settings_test.go +++ b/internal/provider/resource_tfe_saml_settings_test.go @@ -16,212 +16,225 @@ import ( const testResourceName = "tfe_saml_settings.foobar" -func TestAccTFESAMLSettings_basic(t *testing.T) { - s := tfe.AdminSAMLSetting{ - IDPCert: "testIDPCertBasic", - SLOEndpointURL: "https://foobar.com/slo_endpoint_url", - SSOEndpointURL: "https://foobar.com/sso_endpoint_url", - } - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: testAccMuxedProviders, - CheckDestroy: testAccTFESAMLSettingsDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFESAMLSettings_basic(s), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), - resource.TestCheckResourceAttr(testResourceName, "debug", "false"), - resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", "false"), - resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", "false"), - resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", "false"), - resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), - resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "attr_username", samlDefaultAttrUsername), - resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", samlDefaultAttrSiteAdmin), - resource.TestCheckResourceAttr(testResourceName, "attr_groups", samlDefaultAttrGroups), - resource.TestCheckResourceAttr(testResourceName, "site_admin_role", samlDefaultSiteAdminRole), - resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(int(samlDefaultSSOAPITokenSessionTimeoutSeconds))), - resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), - resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), - resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", samlSignatureMethodSHA256), - resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", samlSignatureMethodSHA256), - ), +// FLAKE ALERT: SAML settings are a singleton resource shared by the entire TFE +// instance, and any test touching them is at high risk to flake. +// In order for these tests to be safe, the following requirements MUST be met: +// 1. All test cases for this resource must run within a SINGLE test func, using +// t.Run to separate the individual test cases. +// 2. The inner sub-tests must not call t.Parallel. +// +// If these tests are split into multiple test funcs and they get allocated to +// different test runner partitions in CI, then they will inevitably flake, as +// tests running concurrently in different containers will be competing to set +// the same shared global state in the TFE instance. +func TestAccTFESAMLSettings_omnibus(t *testing.T) { + t.Run("basic SAML settings resource", func(t *testing.T) { + s := tfe.AdminSAMLSetting{ + IDPCert: "testIDPCertBasic", + SLOEndpointURL: "https://foobar.com/slo_endpoint_url", + SSOEndpointURL: "https://foobar.com/sso_endpoint_url", + } + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccTFESAMLSettingsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESAMLSettings_basic(s), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), + resource.TestCheckResourceAttr(testResourceName, "debug", "false"), + resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", "false"), + resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", "false"), + resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", "false"), + resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), + resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "attr_username", samlDefaultAttrUsername), + resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", samlDefaultAttrSiteAdmin), + resource.TestCheckResourceAttr(testResourceName, "attr_groups", samlDefaultAttrGroups), + resource.TestCheckResourceAttr(testResourceName, "site_admin_role", samlDefaultSiteAdminRole), + resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(int(samlDefaultSSOAPITokenSessionTimeoutSeconds))), + resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), + resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), + resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", samlSignatureMethodSHA256), + resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", samlSignatureMethodSHA256), + ), + }, }, - }, + }) }) -} -func TestAccTFESAMLSettings_full(t *testing.T) { - s := tfe.AdminSAMLSetting{ - IDPCert: "testIDPCertFull", - SLOEndpointURL: "https://foobar.com/slo_endpoint_url", - SSOEndpointURL: "https://foobar.com/sso_endpoint_url", - Debug: true, - AuthnRequestsSigned: true, - WantAssertionsSigned: true, - TeamManagementEnabled: false, - AttrUsername: "Foo" + samlDefaultAttrUsername, - AttrSiteAdmin: "Foo" + samlDefaultAttrSiteAdmin, - AttrGroups: "Foo" + samlDefaultAttrGroups, - SiteAdminRole: "foo-" + samlDefaultSiteAdminRole, - SSOAPITokenSessionTimeout: 1101100, - Certificate: "TestCertificateFull", - PrivateKey: "TestPrivateKeyFull", - SignatureSigningMethod: samlSignatureMethodSHA1, - SignatureDigestMethod: samlSignatureMethodSHA256, - } - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: testAccMuxedProviders, - CheckDestroy: testAccTFESAMLSettingsDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFESAMLSettings_full(s), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), - resource.TestCheckResourceAttr(testResourceName, "debug", strconv.FormatBool(s.Debug)), - resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", strconv.FormatBool(s.AuthnRequestsSigned)), - resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", strconv.FormatBool(s.WantAssertionsSigned)), - resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", strconv.FormatBool(s.TeamManagementEnabled)), - resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), - resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "attr_username", s.AttrUsername), - resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", s.AttrSiteAdmin), - resource.TestCheckResourceAttr(testResourceName, "attr_groups", s.AttrGroups), - resource.TestCheckResourceAttr(testResourceName, "site_admin_role", s.SiteAdminRole), - resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(s.SSOAPITokenSessionTimeout)), - resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), - resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), - resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", s.SignatureSigningMethod), - resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", s.SignatureDigestMethod), - ), + t.Run("full SAML settings resource", func(t *testing.T) { + s := tfe.AdminSAMLSetting{ + IDPCert: "testIDPCertFull", + SLOEndpointURL: "https://foobar.com/slo_endpoint_url", + SSOEndpointURL: "https://foobar.com/sso_endpoint_url", + Debug: true, + AuthnRequestsSigned: true, + WantAssertionsSigned: true, + TeamManagementEnabled: false, + AttrUsername: "Foo" + samlDefaultAttrUsername, + AttrSiteAdmin: "Foo" + samlDefaultAttrSiteAdmin, + AttrGroups: "Foo" + samlDefaultAttrGroups, + SiteAdminRole: "foo-" + samlDefaultSiteAdminRole, + SSOAPITokenSessionTimeout: 1101100, + Certificate: "TestCertificateFull", + PrivateKey: "TestPrivateKeyFull", + SignatureSigningMethod: samlSignatureMethodSHA1, + SignatureDigestMethod: samlSignatureMethodSHA256, + } + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccTFESAMLSettingsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESAMLSettings_full(s), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), + resource.TestCheckResourceAttr(testResourceName, "debug", strconv.FormatBool(s.Debug)), + resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", strconv.FormatBool(s.AuthnRequestsSigned)), + resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", strconv.FormatBool(s.WantAssertionsSigned)), + resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", strconv.FormatBool(s.TeamManagementEnabled)), + resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), + resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "attr_username", s.AttrUsername), + resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", s.AttrSiteAdmin), + resource.TestCheckResourceAttr(testResourceName, "attr_groups", s.AttrGroups), + resource.TestCheckResourceAttr(testResourceName, "site_admin_role", s.SiteAdminRole), + resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(s.SSOAPITokenSessionTimeout)), + resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), + resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), + resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", s.SignatureSigningMethod), + resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", s.SignatureDigestMethod), + ), + }, }, - }, + }) }) -} -func TestAccTFESAMLSettings_update(t *testing.T) { - s := tfe.AdminSAMLSetting{ - IDPCert: "testIDPCertUpdateInit", - SLOEndpointURL: "https://foobar.com/slo_endpoint_url", - SSOEndpointURL: "https://foobar.com/sso_endpoint_url", - } - updatedSetting := tfe.AdminSAMLSetting{ - IDPCert: "testIDPCertUpdateInit", - SLOEndpointURL: "https://foobar-updated.com/slo_endpoint_url", - SSOEndpointURL: "https://foobar-updated.com/sso_endpoint_url", - Debug: true, - AuthnRequestsSigned: true, - WantAssertionsSigned: true, - TeamManagementEnabled: false, - AttrUsername: "FooUpdate" + samlDefaultAttrUsername, - AttrSiteAdmin: "FooUpdate" + samlDefaultAttrSiteAdmin, - AttrGroups: "FooUpdate" + samlDefaultAttrGroups, - SiteAdminRole: "foo-update-" + samlDefaultSiteAdminRole, - SSOAPITokenSessionTimeout: 1234567, - Certificate: "TestCertificateUpdate", - PrivateKey: "TestPrivateKeyUpdate", - SignatureSigningMethod: samlSignatureMethodSHA1, - SignatureDigestMethod: samlSignatureMethodSHA256, - } + t.Run("SAML settings update", func(t *testing.T) { + s := tfe.AdminSAMLSetting{ + IDPCert: "testIDPCertUpdateInit", + SLOEndpointURL: "https://foobar.com/slo_endpoint_url", + SSOEndpointURL: "https://foobar.com/sso_endpoint_url", + } + updatedSetting := tfe.AdminSAMLSetting{ + IDPCert: "testIDPCertUpdateInit", + SLOEndpointURL: "https://foobar-updated.com/slo_endpoint_url", + SSOEndpointURL: "https://foobar-updated.com/sso_endpoint_url", + Debug: true, + AuthnRequestsSigned: true, + WantAssertionsSigned: true, + TeamManagementEnabled: false, + AttrUsername: "FooUpdate" + samlDefaultAttrUsername, + AttrSiteAdmin: "FooUpdate" + samlDefaultAttrSiteAdmin, + AttrGroups: "FooUpdate" + samlDefaultAttrGroups, + SiteAdminRole: "foo-update-" + samlDefaultSiteAdminRole, + SSOAPITokenSessionTimeout: 1234567, + Certificate: "TestCertificateUpdate", + PrivateKey: "TestPrivateKeyUpdate", + SignatureSigningMethod: samlSignatureMethodSHA1, + SignatureDigestMethod: samlSignatureMethodSHA256, + } - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: testAccMuxedProviders, - CheckDestroy: testAccTFESAMLSettingsDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFESAMLSettings_basic(s), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), - resource.TestCheckResourceAttr(testResourceName, "debug", "false"), - resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", "false"), - resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", "false"), - resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", "false"), - resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), - resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "attr_username", samlDefaultAttrUsername), - resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", samlDefaultAttrSiteAdmin), - resource.TestCheckResourceAttr(testResourceName, "attr_groups", samlDefaultAttrGroups), - resource.TestCheckResourceAttr(testResourceName, "site_admin_role", samlDefaultSiteAdminRole), - resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(int(samlDefaultSSOAPITokenSessionTimeoutSeconds))), - resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), - resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), - resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", samlSignatureMethodSHA256), - resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", samlSignatureMethodSHA256), - ), - }, - { - Config: testAccTFESAMLSettings_full(updatedSetting), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), - resource.TestCheckResourceAttr(testResourceName, "debug", strconv.FormatBool(updatedSetting.Debug)), - resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", strconv.FormatBool(updatedSetting.AuthnRequestsSigned)), - resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", strconv.FormatBool(updatedSetting.WantAssertionsSigned)), - resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", strconv.FormatBool(updatedSetting.TeamManagementEnabled)), - resource.TestCheckResourceAttr(testResourceName, "idp_cert", updatedSetting.IDPCert), - resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", updatedSetting.SLOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", updatedSetting.SSOEndpointURL), - resource.TestCheckResourceAttr(testResourceName, "attr_username", updatedSetting.AttrUsername), - resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", updatedSetting.AttrSiteAdmin), - resource.TestCheckResourceAttr(testResourceName, "attr_groups", updatedSetting.AttrGroups), - resource.TestCheckResourceAttr(testResourceName, "site_admin_role", updatedSetting.SiteAdminRole), - resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(updatedSetting.SSOAPITokenSessionTimeout)), - resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), - resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), - resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", updatedSetting.SignatureSigningMethod), - resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", updatedSetting.SignatureDigestMethod), - ), + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccTFESAMLSettingsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESAMLSettings_basic(s), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), + resource.TestCheckResourceAttr(testResourceName, "debug", "false"), + resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", "false"), + resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", "false"), + resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", "false"), + resource.TestCheckResourceAttr(testResourceName, "idp_cert", s.IDPCert), + resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", s.SLOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", s.SSOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "attr_username", samlDefaultAttrUsername), + resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", samlDefaultAttrSiteAdmin), + resource.TestCheckResourceAttr(testResourceName, "attr_groups", samlDefaultAttrGroups), + resource.TestCheckResourceAttr(testResourceName, "site_admin_role", samlDefaultSiteAdminRole), + resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(int(samlDefaultSSOAPITokenSessionTimeoutSeconds))), + resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), + resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), + resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", samlSignatureMethodSHA256), + resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", samlSignatureMethodSHA256), + ), + }, + { + Config: testAccTFESAMLSettings_full(updatedSetting), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "enabled", "true"), + resource.TestCheckResourceAttr(testResourceName, "debug", strconv.FormatBool(updatedSetting.Debug)), + resource.TestCheckResourceAttr(testResourceName, "authn_requests_signed", strconv.FormatBool(updatedSetting.AuthnRequestsSigned)), + resource.TestCheckResourceAttr(testResourceName, "want_assertions_signed", strconv.FormatBool(updatedSetting.WantAssertionsSigned)), + resource.TestCheckResourceAttr(testResourceName, "team_management_enabled", strconv.FormatBool(updatedSetting.TeamManagementEnabled)), + resource.TestCheckResourceAttr(testResourceName, "idp_cert", updatedSetting.IDPCert), + resource.TestCheckResourceAttr(testResourceName, "slo_endpoint_url", updatedSetting.SLOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "sso_endpoint_url", updatedSetting.SSOEndpointURL), + resource.TestCheckResourceAttr(testResourceName, "attr_username", updatedSetting.AttrUsername), + resource.TestCheckResourceAttr(testResourceName, "attr_site_admin", updatedSetting.AttrSiteAdmin), + resource.TestCheckResourceAttr(testResourceName, "attr_groups", updatedSetting.AttrGroups), + resource.TestCheckResourceAttr(testResourceName, "site_admin_role", updatedSetting.SiteAdminRole), + resource.TestCheckResourceAttr(testResourceName, "sso_api_token_session_timeout", strconv.Itoa(updatedSetting.SSOAPITokenSessionTimeout)), + resource.TestCheckResourceAttrSet(testResourceName, "acs_consumer_url"), + resource.TestCheckResourceAttrSet(testResourceName, "metadata_url"), + resource.TestCheckResourceAttr(testResourceName, "signature_signing_method", updatedSetting.SignatureSigningMethod), + resource.TestCheckResourceAttr(testResourceName, "signature_digest_method", updatedSetting.SignatureDigestMethod), + ), + }, }, - }, + }) }) -} -func TestAccTFESAMLSettings_import(t *testing.T) { - idpCert := "testIDPCertImport" - slo := "https://foobar-import.com/slo_endpoint_url" - sso := "https://foobar-import.com/sso_endpoint_url" - s := tfe.AdminSAMLSetting{ - IDPCert: idpCert, - SLOEndpointURL: slo, - SSOEndpointURL: sso, - } - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV5ProviderFactories: testAccMuxedProviders, - CheckDestroy: testAccTFESAMLSettingsDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFESAMLSettings_basic(s), - }, - { - ResourceName: testResourceName, - ImportState: true, - ImportStateCheck: func(s []*terraform.InstanceState) error { - if len(s) != 1 { - return fmt.Errorf("expected 1 state: %+v", s) - } - rs := s[0] - if rs.Attributes["private_key"] != "" { - return fmt.Errorf("expected private_key attribute to not be set, received: %s", rs.Attributes["private_key"]) - } - if rs.Attributes["idp_cert"] != idpCert { - return fmt.Errorf("expected idp_cert attribute to be equal to %s, received: %s", idpCert, rs.Attributes["idp_cert"]) - } - if rs.Attributes["slo_endpoint_url"] != slo { - return fmt.Errorf("expected slo_endpoint_url attribute to be equal to %s, received: %s", slo, rs.Attributes["slo_endpoint_url"]) - } - if rs.Attributes["sso_endpoint_url"] != sso { - return fmt.Errorf("expected sso_endpoint_url attribute to be equal to %s, received: %s", sso, rs.Attributes["sso_endpoint_url"]) - } - return nil + t.Run("SAML settings import", func(t *testing.T) { + idpCert := "testIDPCertImport" + slo := "https://foobar-import.com/slo_endpoint_url" + sso := "https://foobar-import.com/sso_endpoint_url" + s := tfe.AdminSAMLSetting{ + IDPCert: idpCert, + SLOEndpointURL: slo, + SSOEndpointURL: sso, + } + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccTFESAMLSettingsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESAMLSettings_basic(s), + }, + { + ResourceName: testResourceName, + ImportState: true, + ImportStateCheck: func(s []*terraform.InstanceState) error { + if len(s) != 1 { + return fmt.Errorf("expected 1 state: %+v", s) + } + rs := s[0] + if rs.Attributes["private_key"] != "" { + return fmt.Errorf("expected private_key attribute to not be set, received: %s", rs.Attributes["private_key"]) + } + if rs.Attributes["idp_cert"] != idpCert { + return fmt.Errorf("expected idp_cert attribute to be equal to %s, received: %s", idpCert, rs.Attributes["idp_cert"]) + } + if rs.Attributes["slo_endpoint_url"] != slo { + return fmt.Errorf("expected slo_endpoint_url attribute to be equal to %s, received: %s", slo, rs.Attributes["slo_endpoint_url"]) + } + if rs.Attributes["sso_endpoint_url"] != sso { + return fmt.Errorf("expected sso_endpoint_url attribute to be equal to %s, received: %s", sso, rs.Attributes["sso_endpoint_url"]) + } + return nil + }, }, }, - }, + }) }) } From 70824dfa82d1cf46dc2ac3b7f13c69194382430f Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 30 Oct 2023 15:36:49 -0400 Subject: [PATCH 070/420] fetch latest go-tfe --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index e43335f6d..df5cb848a 100644 --- a/go.mod +++ b/go.mod @@ -11,8 +11,8 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect - github.com/hashicorp/go-slug v0.12.2 - github.com/hashicorp/go-tfe v1.34.0 + github.com/hashicorp/go-slug v0.13.0 + github.com/hashicorp/go-tfe v1.38.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect @@ -43,7 +43,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-plugin v1.5.1 // indirect github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d // indirect + github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.19.0 // indirect github.com/hashicorp/terraform-json v0.17.1 // indirect @@ -76,7 +76,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/sync v0.3.0 // indirect + golang.org/x/sync v0.4.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 2e8f6a04e..60dc0f3bb 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBY github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.12.2 h1:Gb6nxnV5GI1UVa3aLJGUj66J8AOZFnjIoYalNCp2Cbo= -github.com/hashicorp/go-slug v0.12.2/go.mod h1:JZVtycnZZbiJ4oxpJ/zfhyfBD8XxT4f0uOSyjNLCqFY= -github.com/hashicorp/go-tfe v1.34.0 h1:33xcVQ8sbkdPVhubpVH208+S72l6l5bFEi14363yOIE= -github.com/hashicorp/go-tfe v1.34.0/go.mod h1:xA+N8r81ldvS7PC/DVbL+FqGsgfrcu1Ak4+6His+51s= +github.com/hashicorp/go-slug v0.13.0 h1:3mYM2jpoRxSvWGY/GBKtK9eagcx48UVZRGP037+rUM4= +github.com/hashicorp/go-slug v0.13.0/go.mod h1:JZVtycnZZbiJ4oxpJ/zfhyfBD8XxT4f0uOSyjNLCqFY= +github.com/hashicorp/go-tfe v1.38.0 h1:R1b5CQ/B+91pIZA36Es509FBoBlxYC8PQ0/sBT4Lxys= +github.com/hashicorp/go-tfe v1.38.0/go.mod h1:awOuTZ4K9F1EJsKBIoxonJlb7Axn3PIb8YeBLtm/G/0= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -73,8 +73,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d h1:9ARUJJ1VVynB176G1HCwleORqCaXm/Vx0uUi0dL26I0= -github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= +github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 h1:w/i7859FOgNZETHpR7nHNVZzipCypYBNqW5sRZXLFjc= +github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= @@ -184,8 +184,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 8e3269e91ad7a9f86fb01257fc1a87a5d3fa3049 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 2 Nov 2023 10:25:25 -0700 Subject: [PATCH 071/420] Fix flaky `TestAccTFEVariableSetsDataSource_full` This test was checking that the varset was connected to the project, but that connection is managed by a separate resource that was not a declared or inferred dependency of the data source. So, random chance determined whether the varset had been connected to the project yet by the time the data source was read. The fix is to declare the dependency. --- internal/provider/data_source_variable_set_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/data_source_variable_set_test.go b/internal/provider/data_source_variable_set_test.go index dc715fa60..678f6cfa1 100644 --- a/internal/provider/data_source_variable_set_test.go +++ b/internal/provider/data_source_variable_set_test.go @@ -127,6 +127,6 @@ func testAccTFEVariableSetsDataSourceConfig_full(rInt int) string { data "tfe_variable_set" "foobar" { name = tfe_variable_set.foobar.name organization = tfe_variable_set.foobar.organization - depends_on = [tfe_variable.envfoo] + depends_on = [tfe_variable.envfoo, tfe_project_variable_set.foobar] }`, rInt, rInt, rInt, rInt) } From 8c7510f474be1efa15050048cc8695a9f673c527 Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 6 Nov 2023 11:48:54 -0600 Subject: [PATCH 072/420] [TF-10363] skip SAML resource tests when CI runs (#1127) * skip SAML tests when CI runs * set default val for new input * prev regex excluded all tests, fix * comment solution for context * add comment in TestAccTFESAMLSettings_omnibus file noting new changes to when tests run --- .github/actions/test-provider-tfe/action.yml | 6 ++++++ .github/workflows/ci.yml | 5 +++++ internal/provider/resource_tfe_saml_settings_test.go | 3 +++ 3 files changed, 14 insertions(+) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index d2a34ad26..c55f26da9 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -43,6 +43,10 @@ inputs: enterprise: description: Test enterprise features (`hostname` must be running in ON_PREM mode) required: false + list_tests: + description: Accepts regex rules to either include or exclude specific tests from running in either CI or nightly workflows. + required: false + default: "." runs: using: composite @@ -79,6 +83,8 @@ runs: index: ${{ inputs.matrix_index }} total: ${{ inputs.matrix_total }} junit-summary: ./ci-summary-provider.xml + # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite + list: ${{ inputs.list_tests }} - name: Run Tests shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b5743447..2289a0e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,11 @@ jobs: admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }} admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }} admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }} + # Run terminal cmd 'go help testflag' to learn more about -list flag + # action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests + # which runs against all tests using the list arg + # lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only + list_tests: "[^(TestAccTFESAMLSettings_omnibus)]" tests-combine-summaries: name: Combine Test Reports diff --git a/internal/provider/resource_tfe_saml_settings_test.go b/internal/provider/resource_tfe_saml_settings_test.go index d057a17a6..a8bbb2b65 100644 --- a/internal/provider/resource_tfe_saml_settings_test.go +++ b/internal/provider/resource_tfe_saml_settings_test.go @@ -27,6 +27,9 @@ const testResourceName = "tfe_saml_settings.foobar" // different test runner partitions in CI, then they will inevitably flake, as // tests running concurrently in different containers will be competing to set // the same shared global state in the TFE instance. + +// TestAccTFESAMLSettings_omnibus test suite is skipped in the CI, and will only run in TFE Nightly workflow +// Should this test name ever change, you will also need to update the regex in ci.yml func TestAccTFESAMLSettings_omnibus(t *testing.T) { t.Run("basic SAML settings resource", func(t *testing.T) { s := tfe.AdminSAMLSetting{ From 956dd5d23ff57a39b18d31d4910fb6a8983aa67a Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 6 Nov 2023 15:46:49 -0800 Subject: [PATCH 073/420] Fix nil pointer dereference segfault in tfe_variable resource MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If go-tfe returns a non-nil err, you can't ever treat the `*tfe.Variable` pointer it returns as though it's valid. But in the Update path for this resource, I forgot to do an early return on client error, and thus we'd immediately try to dereference that variable pointer and do a segfault. Easiest way to reproduce this bug is to apply a config that creates a non-sensitive variable, manually create a second variable, then try to change the `key` of the config variable to conflict with the key of the manual variable. All the other crud methods were fine — Create and Read both had appropriate early returns, and Delete doesn't need it because it doesn't do anything after appending to diags. I'm guessing I must have implemented Update after Delete and gotten confused. --- internal/provider/resource_tfe_variable.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/provider/resource_tfe_variable.go b/internal/provider/resource_tfe_variable.go index e3df94027..7fa763f0b 100644 --- a/internal/provider/resource_tfe_variable.go +++ b/internal/provider/resource_tfe_variable.go @@ -479,6 +479,7 @@ func (r *resourceTFEVariable) updateWithWorkspace(ctx context.Context, req resou "Error updating variable", fmt.Sprintf("Couldn't update variable %s: %s", variableID, err.Error()), ) + return } // Update state result := modelFromTFEVariable(*variable, plan.Value) @@ -524,6 +525,7 @@ func (r *resourceTFEVariable) updateWithVariableSet(ctx context.Context, req res "Error updating variable", fmt.Sprintf("Couldn't update variable %s: %s", variableID, err.Error()), ) + return } // Update state result := modelFromTFEVariableSetVariable(*variable, plan.Value) From 8353c010f35cd2ab4df1949e0577f7561df89b00 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 6 Nov 2023 15:56:54 -0800 Subject: [PATCH 074/420] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fa22a1c2..2d92998dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ ENHANCEMENTS: * `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) * `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +BUG FIXES: + +* `r/tfe_variable`: Fix nil pointer dereference segfault on client error during Update operations, by @nfagerlund [1131](https://github.com/hashicorp/terraform-provider-tfe/1131) + ## v0.49.2 (October 4, 2023) BUG FIXES: From e7e3e4f78e309f946fa639f1c4049092342f26c4 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 30 Oct 2023 17:32:10 -0700 Subject: [PATCH 075/420] Update to go-tfe v1.39.0 Required for AutoApplyRunTrigger support. --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index df5cb848a..3775edd91 100644 --- a/go.mod +++ b/go.mod @@ -11,8 +11,8 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect - github.com/hashicorp/go-slug v0.13.0 - github.com/hashicorp/go-tfe v1.38.0 + github.com/hashicorp/go-slug v0.13.1 + github.com/hashicorp/go-tfe v1.39.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect @@ -28,9 +28,9 @@ require ( golang.org/x/crypto v0.13.0 // indirect golang.org/x/net v0.13.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.4.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) @@ -76,7 +76,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/sync v0.4.0 // indirect + golang.org/x/sync v0.5.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 60dc0f3bb..4178ac292 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBY github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.13.0 h1:3mYM2jpoRxSvWGY/GBKtK9eagcx48UVZRGP037+rUM4= -github.com/hashicorp/go-slug v0.13.0/go.mod h1:JZVtycnZZbiJ4oxpJ/zfhyfBD8XxT4f0uOSyjNLCqFY= -github.com/hashicorp/go-tfe v1.38.0 h1:R1b5CQ/B+91pIZA36Es509FBoBlxYC8PQ0/sBT4Lxys= -github.com/hashicorp/go-tfe v1.38.0/go.mod h1:awOuTZ4K9F1EJsKBIoxonJlb7Axn3PIb8YeBLtm/G/0= +github.com/hashicorp/go-slug v0.13.1 h1:2it55HK4vVXsBoCgUQ7Y2ADQpBaU1ge25VRp1wzZpTM= +github.com/hashicorp/go-slug v0.13.1/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= +github.com/hashicorp/go-tfe v1.39.0 h1:BVVVdfW4jSrDP4I/1kNSep9CMu78NkaEtFXcu0yg858= +github.com/hashicorp/go-tfe v1.39.0/go.mod h1:pVvhovAM3jzu3kgXGwPsuyylE5oRzJjiD5eLycPsGgA= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -184,8 +184,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -204,8 +204,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -220,8 +220,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= +golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= From 17f891235ccdca7a72b5178e653bd78c0eee4881 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 30 Oct 2023 18:02:57 -0700 Subject: [PATCH 076/420] Add auto_apply_run_trigger attribute to workspace resource/data-source --- internal/provider/data_source_workspace.go | 6 ++++++ internal/provider/resource_tfe_workspace.go | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/provider/data_source_workspace.go b/internal/provider/data_source_workspace.go index 4fdeadcd8..ab5664683 100644 --- a/internal/provider/data_source_workspace.go +++ b/internal/provider/data_source_workspace.go @@ -42,6 +42,11 @@ func dataSourceTFEWorkspace() *schema.Resource { Computed: true, }, + "auto_apply_run_trigger": { + Type: schema.TypeBool, + Computed: true, + }, + "file_triggers_enabled": { Type: schema.TypeBool, Computed: true, @@ -223,6 +228,7 @@ func dataSourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error // Update the config. d.Set("allow_destroy_plan", workspace.AllowDestroyPlan) d.Set("auto_apply", workspace.AutoApply) + d.Set("auto_apply_run_trigger", workspace.AutoApplyRunTrigger) d.Set("description", workspace.Description) d.Set("assessments_enabled", workspace.AssessmentsEnabled) d.Set("file_triggers_enabled", workspace.FileTriggersEnabled) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 70db1645e..5c7641a38 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -98,6 +98,12 @@ func resourceTFEWorkspace() *schema.Resource { Default: false, }, + "auto_apply_run_trigger": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "execution_mode": { Type: schema.TypeString, Optional: true, @@ -299,6 +305,7 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error Name: tfe.String(name), AllowDestroyPlan: tfe.Bool(d.Get("allow_destroy_plan").(bool)), AutoApply: tfe.Bool(d.Get("auto_apply").(bool)), + AutoApplyRunTrigger: tfe.Bool(d.Get("auto_apply_run_trigger").(bool)), Description: tfe.String(d.Get("description").(string)), AssessmentsEnabled: tfe.Bool(d.Get("assessments_enabled").(bool)), FileTriggersEnabled: tfe.Bool(d.Get("file_triggers_enabled").(bool)), @@ -448,6 +455,7 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { d.Set("assessments_enabled", workspace.AssessmentsEnabled) d.Set("auto_apply", workspace.AutoApply) + d.Set("auto_apply_run_trigger", workspace.AutoApplyRunTrigger) d.Set("description", workspace.Description) d.Set("file_triggers_enabled", workspace.FileTriggersEnabled) d.Set("operations", workspace.Operations) @@ -533,7 +541,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error config := meta.(ConfiguredClient) id := d.Id() - if d.HasChange("name") || d.HasChange("auto_apply") || d.HasChange("queue_all_runs") || + if d.HasChange("name") || d.HasChange("auto_apply") || d.HasChange("auto_apply_run_trigger") || d.HasChange("queue_all_runs") || d.HasChange("terraform_version") || d.HasChange("working_directory") || d.HasChange("vcs_repo") || d.HasChange("file_triggers_enabled") || d.HasChange("trigger_prefixes") || d.HasChange("trigger_patterns") || @@ -547,6 +555,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error Name: tfe.String(d.Get("name").(string)), AllowDestroyPlan: tfe.Bool(d.Get("allow_destroy_plan").(bool)), AutoApply: tfe.Bool(d.Get("auto_apply").(bool)), + AutoApplyRunTrigger: tfe.Bool(d.Get("auto_apply_run_trigger").(bool)), Description: tfe.String(d.Get("description").(string)), FileTriggersEnabled: tfe.Bool(d.Get("file_triggers_enabled").(bool)), GlobalRemoteState: tfe.Bool(d.Get("global_remote_state").(bool)), From 7ee741c17129d1e40c02eedf3818d7d4211ccf5d Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 7 Nov 2023 11:28:23 -0800 Subject: [PATCH 077/420] Add new `testCheckResourceAttrUnlessEnterprise` helper Sometimes you want to test a new attribute that hasn't landed in TFE yet, but you don't want to skip the entire surrounding test when running against TFE. Well! here's a wrapper around `TestCheckResourceAttr` that always passes on TFE. --- internal/provider/testing.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/provider/testing.go b/internal/provider/testing.go index 3926f55a7..200bfce4d 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -13,6 +13,8 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) const RunTasksURLEnvName = "RUN_TASKS_URL" @@ -268,6 +270,18 @@ func skipIfUnitTest(t *testing.T) { } } +// A wrapper for resource.TestCheckResourceAttr that skips the check if running tests against +// Terraform Enterprise. Useful for testing new attributes that haven't been added to TFE +// yet, without having to skip an entire test. +func testCheckResourceAttrUnlessEnterprise(name, key, value string) resource.TestCheckFunc { + if enterpriseEnabled() { + return func(s *terraform.State) error { + return nil + } + } + return resource.TestCheckResourceAttr(name, key, value) +} + func randomString(t *testing.T) string { v, err := uuid.GenerateUUID() if err != nil { From ab39f0ffd1d44c1346926925b4fc126065f784ae Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 30 Oct 2023 18:13:50 -0700 Subject: [PATCH 078/420] Add data/resource tests for auto_apply_run_trigger attribute The convoluted stuff here is temporary, and can be simplified once the feature flag is gone; I wanted to skip testing this attribute on TFE *without* creating additional test cases. --- .../provider/data_source_workspace_test.go | 11 ++++++- .../provider/resource_tfe_workspace_test.go | 33 +++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/internal/provider/data_source_workspace_test.go b/internal/provider/data_source_workspace_test.go index 9f595565e..2f3a2c158 100644 --- a/internal/provider/data_source_workspace_test.go +++ b/internal/provider/data_source_workspace_test.go @@ -83,6 +83,7 @@ func TestAccTFEWorkspaceDataSource_basic(t *testing.T) { "data.tfe_workspace.foobar", "allow_destroy_plan", "false"), resource.TestCheckResourceAttr( "data.tfe_workspace.foobar", "auto_apply", "true"), + testCheckResourceAttrUnlessEnterprise("data.tfe_workspace.foobar", "auto_apply_run_trigger", "true"), resource.TestCheckResourceAttr( "data.tfe_workspace.foobar", "file_triggers_enabled", "true"), resource.TestCheckResourceAttr( @@ -204,6 +205,13 @@ func TestAccTFEWorkspaceDataSource_readProjectIDNonDefault(t *testing.T) { } func testAccTFEWorkspaceDataSourceConfig(rInt int) string { + // Only test auto-apply-run-trigger outside enterprise... once the feature + // flag is removed, just put it in the normal config. + var aart string + if !enterpriseEnabled() { + aart = "auto_apply_run_trigger = true\n" + } + return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -225,13 +233,14 @@ resource "tfe_workspace" "foobar" { trigger_prefixes = ["/modules", "/shared"] working_directory = "terraform/test" global_remote_state = true + %s } data "tfe_workspace" "foobar" { name = tfe_workspace.foobar.name organization = tfe_workspace.foobar.organization depends_on = [tfe_workspace.foobar] -}`, rInt, rInt) +}`, rInt, rInt, aart) } func testAccTFEWorkspaceDataSourceConfigWithTriggerPatterns(workspaceName string, organizationName string) string { diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 971fdd19d..4ee7cc6ed 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -47,6 +47,7 @@ func TestAccTFEWorkspace_basic(t *testing.T) { "tfe_workspace.foobar", "allow_destroy_plan", "false"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "auto_apply", "true"), + testCheckResourceAttrUnlessEnterprise("tfe_workspace.foobar", "auto_apply_run_trigger", "true"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "file_triggers_enabled", "true"), resource.TestCheckResourceAttr( @@ -315,6 +316,7 @@ func TestAccTFEWorkspace_update(t *testing.T) { "tfe_workspace.foobar", "allow_destroy_plan", "false"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "auto_apply", "true"), + testCheckResourceAttrUnlessEnterprise("tfe_workspace.foobar", "auto_apply_run_trigger", "true"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "operations", "true"), resource.TestCheckResourceAttr( @@ -335,6 +337,7 @@ func TestAccTFEWorkspace_update(t *testing.T) { "tfe_workspace.foobar", "allow_destroy_plan", "true"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "auto_apply", "false"), + testCheckResourceAttrUnlessEnterprise("tfe_workspace.foobar", "auto_apply_run_trigger", "false"), resource.TestCheckResourceAttr( "tfe_workspace.foobar", "file_triggers_enabled", "true"), resource.TestCheckResourceAttr( @@ -2650,6 +2653,13 @@ func TestAccTFEWorkspace_createWithSourceURLAndName(t *testing.T) { } func testAccTFEWorkspace_basic(rInt int) string { + // Only test auto-apply-run-trigger outside enterprise... once the feature + // flag is removed, just put it in the normal config. + var aart string + if !enterpriseEnabled() { + aart = "auto_apply_run_trigger = true\n" + } + return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -2663,7 +2673,8 @@ resource "tfe_workspace" "foobar" { allow_destroy_plan = false auto_apply = true tag_names = ["fav", "test"] -}`, rInt) + %s +}`, rInt, aart) } func testAccTFEWorkspace_defaultOrg() string { @@ -2947,6 +2958,13 @@ resource "tfe_workspace" "foobar" { } func testAccTFEWorkspace_renamed(rInt int) string { + // Only test auto-apply-run-trigger outside enterprise... once the feature + // flag is removed, just put it in the normal config. + var aart string + if !enterpriseEnabled() { + aart = "auto_apply_run_trigger = true\n" + } + return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -2959,10 +2977,18 @@ resource "tfe_workspace" "foobar" { description = "My favorite workspace!" allow_destroy_plan = false auto_apply = true -}`, rInt) + %s +}`, rInt, aart) } func testAccTFEWorkspace_update(rInt int) string { + // Only test auto-apply-run-trigger outside enterprise... once the feature + // flag is removed, just put it in the normal config. + var aart string + if !enterpriseEnabled() { + aart = "auto_apply_run_trigger = false\n" + } + return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -2980,7 +3006,8 @@ resource "tfe_workspace" "foobar" { trigger_prefixes = ["/modules", "/shared"] working_directory = "terraform/test" operations = false -}`, rInt) + %s +}`, rInt, aart) } func testAccTFEWorkspace_updateAssessmentsEnabled(rInt int) string { From a6f5ce08d48e9dedb1be114b7b8617e2c27f657e Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 30 Oct 2023 18:18:37 -0700 Subject: [PATCH 079/420] Update docs for auto_apply_run_trigger --- website/docs/d/workspace.html.markdown | 1 + website/docs/r/workspace.html.markdown | 1 + 2 files changed, 2 insertions(+) diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index 3dc57303e..9bfe672d1 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -34,6 +34,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessments_enabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index dc522f2b4..7ec1354dd 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -60,6 +60,7 @@ The following arguments are supported: * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. From 3ed1c2582889ff5a1a309833120d98e5cd7b8f68 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 30 Oct 2023 18:21:18 -0700 Subject: [PATCH 080/420] Update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d92998dc..8e9e97669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ -ENHANCEMENTS: +FEATURES: * `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) * `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `r/tfe_workspace`: Add `auto_apply_run_trigger` attribute, by @nfagerlund [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) +* `d/tfe_workspace`: Add `auto_apply_run_trigger` attribute, by @nfagerlund [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) BUG FIXES: From 307c2794c10f60776ffee14cd786def16652772d Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Wed, 1 Nov 2023 16:30:19 -0700 Subject: [PATCH 081/420] Document testAccCheckTFEWorkspaceAttributes helper --- internal/provider/resource_tfe_workspace_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 4ee7cc6ed..3cb068b0c 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2296,6 +2296,10 @@ func testAccCheckTFEWorkspaceHasRemoteConsumers(ws string, wsConsumers []string) } } +// Helper that checks the actual workspace attribute values in the remote +// service (as opposed to just checking the terraform resource state). This +// makes hardcoded assumptions about the attribute values in the configuration, +// so it can only be used with configs that match those assumptions. func testAccCheckTFEWorkspaceAttributes( workspace *tfe.Workspace) resource.TestCheckFunc { return func(s *terraform.State) error { From de306917068af6bb2ccd7fa64b9dfe5be3cbebb8 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 7 Nov 2023 13:21:30 -0800 Subject: [PATCH 082/420] Changelog: note the fix from upgrading go-slug Upgrading go-tfe pulled in this update for free, but it fixes a user-facing bug in the provider that deserves mention. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9e97669..7e34ae840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ FEATURES: BUG FIXES: * `r/tfe_variable`: Fix nil pointer dereference segfault on client error during Update operations, by @nfagerlund [1131](https://github.com/hashicorp/terraform-provider-tfe/1131) +* `r/tfe_policy_set`: Fix detecting spurious changes on every run when providing file contents with `tfe_slug`. This may require an updated version of tfc-agent for the full fix to take effect. Fixed by upgrading go-slug to v0.13.1 [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) ## v0.49.2 (October 4, 2023) From 5482ee891cabb3ab3f4ee43102a8c1ef8ea3ccd9 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 7 Nov 2023 13:28:36 -0800 Subject: [PATCH 083/420] Ignore unused func param lint for new test helper Since this is only used for a single resource attribute at this time, the linter is being uptight about it. It's meant to vary, we're just not using it elsewhere yet! Please cool your jets!! --- internal/provider/testing.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/provider/testing.go b/internal/provider/testing.go index 200bfce4d..f4f8167c5 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -273,6 +273,8 @@ func skipIfUnitTest(t *testing.T) { // A wrapper for resource.TestCheckResourceAttr that skips the check if running tests against // Terraform Enterprise. Useful for testing new attributes that haven't been added to TFE // yet, without having to skip an entire test. +// +//nolint:unparam func testCheckResourceAttrUnlessEnterprise(name, key, value string) resource.TestCheckFunc { if enterpriseEnabled() { return func(s *terraform.State) error { From f6da346ccf35195e33ae30ce18abc309f9a8aff1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:59:59 +0000 Subject: [PATCH 084/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.39.0 to 1.39.1 Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.39.0 to 1.39.1. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.39.0...v1.39.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3775edd91..83cdb6ff5 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.4 // indirect + github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.1 - github.com/hashicorp/go-tfe v1.39.0 + github.com/hashicorp/go-tfe v1.39.1 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect diff --git a/go.sum b/go.sum index 4178ac292..e7c8c9603 100644 --- a/go.sum +++ b/go.sum @@ -56,12 +56,12 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= -github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.1 h1:2it55HK4vVXsBoCgUQ7Y2ADQpBaU1ge25VRp1wzZpTM= github.com/hashicorp/go-slug v0.13.1/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.39.0 h1:BVVVdfW4jSrDP4I/1kNSep9CMu78NkaEtFXcu0yg858= -github.com/hashicorp/go-tfe v1.39.0/go.mod h1:pVvhovAM3jzu3kgXGwPsuyylE5oRzJjiD5eLycPsGgA= +github.com/hashicorp/go-tfe v1.39.1 h1:UZF9Avfg2tRlYFuRArktWRkAgwe6I0Vp/ZVhCt/nuv8= +github.com/hashicorp/go-tfe v1.39.1/go.mod h1:/+MNl/OTw26MYEJDnc2utP43QwBgOLrbOQaug6VbeCY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 58e902ca331b10b1bb5d3ab5e025862e23afdd22 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 Nov 2023 14:53:50 -0500 Subject: [PATCH 085/420] Update version ref to v0.50.0 --- README.md | 4 ++-- website/docs/index.html.markdown | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b332203b..66e9d8c7e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.49.2" + version = "~> 0.50.0" } } } @@ -45,7 +45,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index f60d0948e..fff59410d 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.2" + version = "~> 0.50.0" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.49.2" + version = "~> 0.50.0" } # Create an organization From 051a9e12187fe12b687be80bbf59b6148404cb0a Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 Nov 2023 14:59:26 -0500 Subject: [PATCH 086/420] Upgrade go-tfe to v1.39.1 --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 3775edd91..2cd59a2d0 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.4 // indirect + github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.1 - github.com/hashicorp/go-tfe v1.39.0 + github.com/hashicorp/go-tfe v1.39.1 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect @@ -28,7 +28,7 @@ require ( golang.org/x/crypto v0.13.0 // indirect golang.org/x/net v0.13.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.4.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/go.sum b/go.sum index 4178ac292..95a6ad1ff 100644 --- a/go.sum +++ b/go.sum @@ -56,12 +56,12 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= -github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.1 h1:2it55HK4vVXsBoCgUQ7Y2ADQpBaU1ge25VRp1wzZpTM= github.com/hashicorp/go-slug v0.13.1/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.39.0 h1:BVVVdfW4jSrDP4I/1kNSep9CMu78NkaEtFXcu0yg858= -github.com/hashicorp/go-tfe v1.39.0/go.mod h1:pVvhovAM3jzu3kgXGwPsuyylE5oRzJjiD5eLycPsGgA= +github.com/hashicorp/go-tfe v1.39.1 h1:UZF9Avfg2tRlYFuRArktWRkAgwe6I0Vp/ZVhCt/nuv8= +github.com/hashicorp/go-tfe v1.39.1/go.mod h1:/+MNl/OTw26MYEJDnc2utP43QwBgOLrbOQaug6VbeCY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -204,8 +204,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= From 5341c16b50a7c514d47273f2cb862abde72ae0d8 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 Nov 2023 15:02:51 -0500 Subject: [PATCH 087/420] v0.50.0 changelog --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e34ae840..262d75602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,19 @@ +## v0.50.0 + FEATURES: -* `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) -* `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) * `r/tfe_workspace`: Add `auto_apply_run_trigger` attribute, by @nfagerlund [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) * `d/tfe_workspace`: Add `auto_apply_run_trigger` attribute, by @nfagerlund [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) +* `r/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) +* `d/tfe_variable_set`: Add `priority` attribute, by @Netra2104 [1075](https://github.com/hashicorp/terraform-provider-tfe/pull/1075) BUG FIXES: -* `r/tfe_variable`: Fix nil pointer dereference segfault on client error during Update operations, by @nfagerlund [1131](https://github.com/hashicorp/terraform-provider-tfe/1131) * `r/tfe_policy_set`: Fix detecting spurious changes on every run when providing file contents with `tfe_slug`. This may require an updated version of tfc-agent for the full fix to take effect. Fixed by upgrading go-slug to v0.13.1 [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) +* `r/tfe_variable`: Fix nil pointer dereference segfault on client error during Update operations, by @nfagerlund [1131](https://github.com/hashicorp/terraform-provider-tfe/1131) +* provider: Fix an issue where the request body is not preserved during certain retry scenarios, by @sebasslash [1135](https://github.com/hashicorp/terraform-provider-tfe/pull/1135) ## v0.49.2 (October 4, 2023) From fbc42ad7b86bc851a1786a542397e9a832b2bca1 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 9 Nov 2023 20:29:00 +0000 Subject: [PATCH 088/420] cdktf: update documentation --- .../cdktf/csharp/d/variable_set.html.markdown | 5 +- .../cdktf/csharp/d/workspace.html.markdown | 3 +- website/docs/cdktf/csharp/index.html.markdown | 8 +- .../cdktf/csharp/r/agent_pool.html.markdown | 4 +- ...gent_pool_allowed_workspaces.html.markdown | 52 ++-- .../cdktf/csharp/r/variable_set.html.markdown | 49 +++- .../cdktf/csharp/r/workspace.html.markdown | 3 +- .../cdktf/go/d/variable_set.html.markdown | 5 +- .../docs/cdktf/go/d/workspace.html.markdown | 3 +- website/docs/cdktf/go/index.html.markdown | 8 +- .../docs/cdktf/go/r/agent_pool.html.markdown | 4 +- ...gent_pool_allowed_workspaces.html.markdown | 56 ++-- .../cdktf/go/r/variable_set.html.markdown | 78 +++++- .../docs/cdktf/go/r/workspace.html.markdown | 3 +- .../cdktf/java/d/variable_set.html.markdown | 5 +- .../docs/cdktf/java/d/workspace.html.markdown | 3 +- website/docs/cdktf/java/index.html.markdown | 8 +- .../cdktf/java/r/agent_pool.html.markdown | 4 +- ...gent_pool_allowed_workspaces.html.markdown | 54 ++-- .../cdktf/java/r/variable_set.html.markdown | 50 +++- .../docs/cdktf/java/r/workspace.html.markdown | 3 +- .../cdktf/python/d/agent_pool.html.markdown | 17 +- .../d/github_installation.html.markdown | 32 +-- .../cdktf/python/d/ip_ranges.html.markdown | 21 +- .../cdktf/python/d/oauth_client.html.markdown | 47 ++-- .../cdktf/python/d/organization.html.markdown | 17 +- .../d/organization_members.html.markdown | 22 +- .../d/organization_membership.html.markdown | 47 ++-- .../d/organization_run_task.html.markdown | 17 +- .../python/d/organization_tags.html.markdown | 17 +- .../python/d/organizations.html.markdown | 17 +- .../docs/cdktf/python/d/outputs.html.markdown | 23 +- .../cdktf/python/d/policy_set.html.markdown | 17 +- .../docs/cdktf/python/d/project.html.markdown | 17 +- .../python/d/saml_settings.html.markdown | 42 ++- .../docs/cdktf/python/d/slug.html.markdown | 22 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/d/team.html.markdown | 17 +- .../cdktf/python/d/team_access.html.markdown | 17 +- .../d/team_project_access.html.markdown | 17 +- .../docs/cdktf/python/d/teams.html.markdown | 17 +- .../cdktf/python/d/variable_set.html.markdown | 20 +- .../cdktf/python/d/variables.html.markdown | 43 ++-- .../cdktf/python/d/workspace.html.markdown | 18 +- .../python/d/workspace_ids.html.markdown | 23 +- .../python/d/workspace_run_task.html.markdown | 17 +- website/docs/cdktf/python/index.html.markdown | 51 ++-- .../r/admin_organization_settings.markdown | 74 +++--- .../cdktf/python/r/agent_pool.html.markdown | 24 +- ...gent_pool_allowed_workspaces.html.markdown | 38 ++- .../cdktf/python/r/agent_token.html.markdown | 27 +- .../python/r/no_code_module.html.markdown | 56 ++-- .../notification_configuration.html.markdown | 96 ++++--- .../cdktf/python/r/oauth_client.html.markdown | 47 ++-- .../cdktf/python/r/organization.html.markdown | 17 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../python/r/organization_token.html.markdown | 48 ++-- .../docs/cdktf/python/r/policy.html.markdown | 32 +-- .../cdktf/python/r/policy_set.html.markdown | 113 +++----- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 34 +-- .../r/project_variable_set.html.markdown | 35 ++- .../python/r/registry_module.html.markdown | 121 ++++----- .../cdktf/python/r/run_trigger.html.markdown | 33 +-- .../python/r/saml_settings.html.markdown | 35 +-- .../python/r/sentinel_policy.html.markdown | 17 +- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 32 +-- .../cdktf/python/r/team_access.html.markdown | 27 +- .../cdktf/python/r/team_member.html.markdown | 22 +- .../cdktf/python/r/team_members.html.markdown | 46 ++-- .../r/team_organization_member.html.markdown | 29 +-- .../r/team_organization_members.html.markdown | 72 +++--- .../r/team_project_access.html.markdown | 53 ++-- .../cdktf/python/r/team_token.html.markdown | 48 ++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 ++++----- .../cdktf/python/r/variable_set.html.markdown | 128 +++++---- .../cdktf/python/r/workspace.html.markdown | 50 ++-- .../r/workspace_policy_set.html.markdown | 35 ++- ...rkspace_policy_set_exclusion.html.markdown | 35 ++- .../python/r/workspace_run.html.markdown | 110 ++++---- .../python/r/workspace_run_task.html.markdown | 25 +- .../r/workspace_variable_set.html.markdown | 35 ++- .../typescript/d/agent_pool.html.markdown | 21 +- .../d/github_installation.html.markdown | 56 ++-- .../typescript/d/ip_ranges.html.markdown | 29 ++- .../typescript/d/oauth_client.html.markdown | 59 ++--- .../typescript/d/organization.html.markdown | 21 +- .../d/organization_members.html.markdown | 26 +- .../d/organization_membership.html.markdown | 89 +++---- .../d/organization_run_task.html.markdown | 31 +-- .../d/organization_tags.html.markdown | 21 +- .../typescript/d/organizations.html.markdown | 21 +- .../cdktf/typescript/d/outputs.html.markdown | 37 +-- .../typescript/d/policy_set.html.markdown | 21 +- .../cdktf/typescript/d/project.html.markdown | 21 +- .../typescript/d/saml_settings.html.markdown | 41 +-- .../cdktf/typescript/d/slug.html.markdown | 26 +- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +- .../cdktf/typescript/d/team.html.markdown | 21 +- .../typescript/d/team_access.html.markdown | 21 +- .../d/team_project_access.html.markdown | 21 +- .../cdktf/typescript/d/teams.html.markdown | 21 +- .../typescript/d/variable_set.html.markdown | 24 +- .../typescript/d/variables.html.markdown | 79 +++--- .../typescript/d/workspace.html.markdown | 22 +- .../typescript/d/workspace_ids.html.markdown | 27 +- .../d/workspace_run_task.html.markdown | 21 +- .../docs/cdktf/typescript/index.html.markdown | 55 ++-- .../r/admin_organization_settings.markdown | 73 +++--- .../typescript/r/agent_pool.html.markdown | 38 +-- ...gent_pool_allowed_workspaces.html.markdown | 78 +++--- .../typescript/r/agent_token.html.markdown | 49 ++-- .../typescript/r/no_code_module.html.markdown | 140 +++++----- .../notification_configuration.html.markdown | 208 ++++++++------- .../typescript/r/oauth_client.html.markdown | 59 ++--- .../typescript/r/organization.html.markdown | 21 +- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 21 +- .../r/organization_run_task.html.markdown | 21 +- .../r/organization_token.html.markdown | 51 ++-- .../cdktf/typescript/r/policy.html.markdown | 40 ++- .../typescript/r/policy_set.html.markdown | 112 +++----- .../r/policy_set_parameter.html.markdown | 48 ++-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 54 ++-- .../r/project_variable_set.html.markdown | 51 ++-- .../r/registry_module.html.markdown | 243 ++++++++++-------- .../typescript/r/run_trigger.html.markdown | 63 +++-- .../typescript/r/saml_settings.html.markdown | 34 +-- .../r/sentinel_policy.html.markdown | 21 +- .../cdktf/typescript/r/ssh_key.html.markdown | 21 +- .../cdktf/typescript/r/team.html.markdown | 40 ++- .../typescript/r/team_access.html.markdown | 31 +-- .../typescript/r/team_member.html.markdown | 26 +- .../typescript/r/team_members.html.markdown | 54 ++-- .../r/team_organization_member.html.markdown | 47 ++-- .../r/team_organization_members.html.markdown | 115 ++++----- .../r/team_project_access.html.markdown | 65 ++--- .../typescript/r/team_token.html.markdown | 56 ++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 +++++------ .../typescript/r/variable_set.html.markdown | 171 +++++++----- .../typescript/r/workspace.html.markdown | 88 ++++--- .../r/workspace_policy_set.html.markdown | 51 ++-- ...rkspace_policy_set_exclusion.html.markdown | 59 +++-- .../typescript/r/workspace_run.html.markdown | 182 +++++++------ .../r/workspace_run_task.html.markdown | 26 +- .../r/workspace_variable_set.html.markdown | 55 ++-- 153 files changed, 3053 insertions(+), 3422 deletions(-) diff --git a/website/docs/cdktf/csharp/d/variable_set.html.markdown b/website/docs/cdktf/csharp/d/variable_set.html.markdown index 499015be7..7ed5e75a4 100644 --- a/website/docs/cdktf/csharp/d/variable_set.html.markdown +++ b/website/docs/cdktf/csharp/d/variable_set.html.markdown @@ -46,9 +46,10 @@ The following arguments are supported: * `Organization` - Name of the organization. * `Name` - Name of the variable set. * `Description` - Description of the variable set. -* `Global` - Whether or not the variable set applies to all workspaces in the organization. +* `Global` - Whether the variable set applies to all workspaces in the organization. +* `Priority` - Whether the variables in this set are able to be over-written. * `WorkspaceIds` - IDs of the workspaces that use the variable set. * `VariableIds` - IDs of the variables attached to the variable set. * `ProjectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/workspace.html.markdown b/website/docs/cdktf/csharp/d/workspace.html.markdown index 1eba787ab..eacbfd771 100644 --- a/website/docs/cdktf/csharp/d/workspace.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace.html.markdown @@ -47,6 +47,7 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The workspace ID. * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). @@ -87,4 +88,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index aa5d383c7..4f9356bba 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.2" + version = "~> 0.50.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.49.2" + version = "~> 0.50.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/agent_pool.html.markdown b/website/docs/cdktf/csharp/r/agent_pool.html.markdown index 53129cd7b..89ef473d2 100644 --- a/website/docs/cdktf/csharp/r/agent_pool.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool.html.markdown @@ -46,7 +46,7 @@ The following arguments are supported: * `Name` - (Required) Name of the agent pool. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `OrganizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `True`. +* `OrganizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `True`. Should be `False` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference @@ -66,4 +66,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown index a722e5a15..b04692099 100644 --- a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown @@ -19,26 +19,34 @@ for Business account. Basic usage: -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true -} - -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeWorkspaceTestWorkspace = new Workspace.Workspace(this, "test-workspace", new WorkspaceConfig { + Name = "my-workspace-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + }); + var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { + Name = "my-agent-pool-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name), + OrganizationScoped = false + }); + new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig { + AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), + AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTestWorkspace.Id) } + }); + } } ``` @@ -46,7 +54,7 @@ resource "tfe_agent_pool_allowed_workspaces" "foobar" { The following arguments are supported: -* `AgentPoolId` - (Required) ID of the team. +* `AgentPoolId` - (Required) The ID of the agent pool. * `AllowedWorkspaceIds` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. @@ -59,4 +67,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/variable_set.html.markdown b/website/docs/cdktf/csharp/r/variable_set.html.markdown index 6cd8e83dc..2be6d4b7e 100644 --- a/website/docs/cdktf/csharp/r/variable_set.html.markdown +++ b/website/docs/cdktf/csharp/r/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variable sets. --- + + # tfe_variable_set Creates, updates and destroys variable sets. @@ -120,13 +122,56 @@ class MyConvertedCode : TerraformStack } ``` +Create a priority variable set: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeVariableSetTest = new VariableSet.VariableSet(this, "test_1", new VariableSetConfig { + Description = "Variable set applied to all workspaces.", + Name = "Global Varset", + Organization = Token.AsString(tfeOrganizationTest.Name), + Priority = true + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.OverrideLogicalId("test"); + new Variable.Variable(this, "test-a", new VariableConfig { + Category = "terraform", + Description = "a useful description", + Key = "seperate_variable", + Value = "my_value_name", + VariableSetId = Token.AsString(tfeVariableSetTest.Id) + }); + new Variable.Variable(this, "test-b", new VariableConfig { + Category = "env", + Description = "an environment variable", + Key = "another_variable", + Value = "my_value_name", + VariableSetId = Token.AsString(tfeVariableSetTest.Id) + }); + } +} +``` + ## Argument Reference The following arguments are supported: * `Name` - (Required) Name of the variable set. * `Description` - (Optional) Description of the variable set. -* `Global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `False`. +* `Global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `False`. +* `Priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `False`. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `WorkspaceIds` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `Global` is set. This argument is mutually exclusive with using the resource @@ -145,4 +190,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index 455d9993a..8eae67322 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -81,6 +81,7 @@ The following arguments are supported: * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. +* `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. * `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. @@ -180,4 +181,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/variable_set.html.markdown b/website/docs/cdktf/go/d/variable_set.html.markdown index 1cfe6bbba..e91e7e99e 100644 --- a/website/docs/cdktf/go/d/variable_set.html.markdown +++ b/website/docs/cdktf/go/d/variable_set.html.markdown @@ -49,9 +49,10 @@ The following arguments are supported: * `Organization` - Name of the organization. * `Name` - Name of the variable set. * `Description` - Description of the variable set. -* `Global` - Whether or not the variable set applies to all workspaces in the organization. +* `Global` - Whether the variable set applies to all workspaces in the organization. +* `Priority` - Whether the variables in this set are able to be over-written. * `WorkspaceIds` - IDs of the workspaces that use the variable set. * `VariableIds` - IDs of the variables attached to the variable set. * `ProjectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/workspace.html.markdown b/website/docs/cdktf/go/d/workspace.html.markdown index 398539117..df1d3ac00 100644 --- a/website/docs/cdktf/go/d/workspace.html.markdown +++ b/website/docs/cdktf/go/d/workspace.html.markdown @@ -50,6 +50,7 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The workspace ID. * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). @@ -90,4 +91,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index aa5d383c7..4f9356bba 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.2" + version = "~> 0.50.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.49.2" + version = "~> 0.50.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/agent_pool.html.markdown b/website/docs/cdktf/go/r/agent_pool.html.markdown index 72aa6f039..21da38f62 100644 --- a/website/docs/cdktf/go/r/agent_pool.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool.html.markdown @@ -50,7 +50,7 @@ The following arguments are supported: * `Name` - (Required) Name of the agent pool. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `OrganizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `True`. +* `OrganizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `True`. Should be `False` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown index a722e5a15..2a99c7204 100644 --- a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown @@ -19,26 +19,42 @@ for Business account. Basic usage: -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" +type myConvertedCode struct { + terraformStack } -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true -} - -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeWorkspaceTestWorkspace := workspace.NewWorkspace(this, jsii.String("test-workspace"), &workspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + }) + tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ + name: jsii.String("my-agent-pool-name"), + organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), + organizationScoped: jsii.Boolean(false), + }) + agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test-allowed-workspaces"), &agentPoolAllowedWorkspacesConfig{ + agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: []*string{ + cdktf.Token_*AsString(tfeWorkspaceTestWorkspace.id), + }, + }) + return this } ``` @@ -46,7 +62,7 @@ resource "tfe_agent_pool_allowed_workspaces" "foobar" { The following arguments are supported: -* `AgentPoolId` - (Required) ID of the team. +* `AgentPoolId` - (Required) The ID of the agent pool. * `AllowedWorkspaceIds` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. @@ -59,4 +75,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/variable_set.html.markdown b/website/docs/cdktf/go/r/variable_set.html.markdown index 1a23e5a92..7b71f0dbb 100644 --- a/website/docs/cdktf/go/r/variable_set.html.markdown +++ b/website/docs/cdktf/go/r/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variable sets. --- + + # tfe_variable_set Creates, updates and destroys variable sets. @@ -38,34 +40,34 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) tfeProjectTest := project.NewProject(this, jsii.String("test_1"), &projectConfig{ name: jsii.String("projectname"), - organization: cdktf.*token_AsString(tfeOrganizationTest.name), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.OverrideLogicalId(jsii.String("test")) tfeVariableSetTest := variableSet.NewVariableSet(this, jsii.String("test_2"), &variableSetConfig{ description: jsii.String("Some description."), name: jsii.String("Test Varset"), - organization: cdktf.*token_*AsString(tfeOrganizationTest.name), + organization: cdktf.Token_*AsString(tfeOrganizationTest.name), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.OverrideLogicalId(jsii.String("test")) tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test_3"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.*token_*AsString(tfeOrganizationTest.name), + organization: cdktf.Token_*AsString(tfeOrganizationTest.name), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.OverrideLogicalId(jsii.String("test")) tfeWorkspaceVariableSetTest := workspaceVariableSet.NewWorkspaceVariableSet(this, jsii.String("test_4"), &workspaceVariableSetConfig{ - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), - workspaceId: cdktf.*token_*AsString(tfeWorkspaceTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), + workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.OverrideLogicalId(jsii.String("test")) tfeProjectVariableSetTest := projectVariableSet.NewProjectVariableSet(this, jsii.String("test_5"), &projectVariableSetConfig{ - projectId: cdktf.*token_*AsString(tfeProjectTest.id), - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), + projectId: cdktf.Token_*AsString(tfeProjectTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.OverrideLogicalId(jsii.String("test")) @@ -74,14 +76,14 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { description: jsii.String("a useful description"), key: jsii.String("seperate_variable"), value: jsii.String("my_value_name"), - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), }) variable.NewVariable(this, jsii.String("test-b"), &variableConfig{ category: jsii.String("env"), description: jsii.String("an environment variable"), key: jsii.String("another_variable"), value: jsii.String("my_value_name"), - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), }) return this } @@ -112,7 +114,54 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { description: jsii.String("Variable set applied to all workspaces."), global: jsii.Boolean(true), name: jsii.String("Global Varset"), - organization: cdktf.*token_AsString(tfeOrganizationTest.name), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.OverrideLogicalId(jsii.String("test")) + variable.NewVariable(this, jsii.String("test-a"), &variableConfig{ + category: jsii.String("terraform"), + description: jsii.String("a useful description"), + key: jsii.String("seperate_variable"), + value: jsii.String("my_value_name"), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), + }) + variable.NewVariable(this, jsii.String("test-b"), &variableConfig{ + category: jsii.String("env"), + description: jsii.String("an environment variable"), + key: jsii.String("another_variable"), + value: jsii.String("my_value_name"), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), + }) + return this +} +``` + +Create a priority variable set: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/variableSet" +import "github.com/aws-samples/dummy/gen/providers/tfe/variable" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTest := organization.NewOrganization(this, jsii.String("test"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeVariableSetTest := variableSet.NewVariableSet(this, jsii.String("test_1"), &variableSetConfig{ + description: jsii.String("Variable set applied to all workspaces."), + name: jsii.String("Global Varset"), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), + priority: jsii.Boolean(true), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.OverrideLogicalId(jsii.String("test")) @@ -121,14 +170,14 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { description: jsii.String("a useful description"), key: jsii.String("seperate_variable"), value: jsii.String("my_value_name"), - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), }) variable.NewVariable(this, jsii.String("test-b"), &variableConfig{ category: jsii.String("env"), description: jsii.String("an environment variable"), key: jsii.String("another_variable"), value: jsii.String("my_value_name"), - variableSetId: cdktf.*token_*AsString(tfeVariableSetTest.id), + variableSetId: cdktf.Token_*AsString(tfeVariableSetTest.id), }) return this } @@ -140,7 +189,8 @@ The following arguments are supported: * `Name` - (Required) Name of the variable set. * `Description` - (Optional) Description of the variable set. -* `Global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `False`. +* `Global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `False`. +* `Priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `False`. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `WorkspaceIds` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `Global` is set. This argument is mutually exclusive with using the resource @@ -159,4 +209,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index 66449648b..9f91e668a 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -93,6 +93,7 @@ The following arguments are supported: * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. +* `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. * `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. @@ -192,4 +193,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/variable_set.html.markdown b/website/docs/cdktf/java/d/variable_set.html.markdown index 8e8ed5322..5368234d0 100644 --- a/website/docs/cdktf/java/d/variable_set.html.markdown +++ b/website/docs/cdktf/java/d/variable_set.html.markdown @@ -45,9 +45,10 @@ The following arguments are supported: * `organization` - Name of the organization. * `name` - Name of the variable set. * `description` - Description of the variable set. -* `global` - Whether or not the variable set applies to all workspaces in the organization. +* `global` - Whether the variable set applies to all workspaces in the organization. +* `priority` - Whether the variables in this set are able to be over-written. * `workspaceIds` - IDs of the workspaces that use the variable set. * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/workspace.html.markdown b/website/docs/cdktf/java/d/workspace.html.markdown index ea2a6da49..371cf05ba 100644 --- a/website/docs/cdktf/java/d/workspace.html.markdown +++ b/website/docs/cdktf/java/d/workspace.html.markdown @@ -46,6 +46,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). @@ -86,4 +87,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index 0af537aa4..a6579445d 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.49.2" + version = "~> 0.50.0" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` token = var.token - version = "~> 0.49.2" + version = "~> 0.50.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/agent_pool.html.markdown b/website/docs/cdktf/java/r/agent_pool.html.markdown index a0fa1612d..cad61c82c 100644 --- a/website/docs/cdktf/java/r/agent_pool.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool.html.markdown @@ -46,7 +46,7 @@ The following arguments are supported: * `name` - (Required) Name of the agent pool. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `organizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. +* `organizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. Should be `false` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference @@ -66,4 +66,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown index 9458015d2..b98fae86d 100644 --- a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown @@ -19,26 +19,36 @@ for Business account. Basic usage: -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = true -} - -resource "tfe_agent_pool_allowed_workspaces" "foobar" { - agent_pool_id = tfe_agent_pool.foobar.id - allowed_workspace_ids = [tfe_workspace.test.id] +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.workspace.*; +import gen.providers.tfe.agentPool.*; +import gen.providers.tfe.agentPoolAllowedWorkspaces.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + Workspace tfeWorkspaceTestWorkspace = new Workspace(this, "test-workspace", new WorkspaceConfig() + .name("my-workspace-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + ); + AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() + .name("my-agent-pool-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + .organizationScoped(false) + ); + new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig() + .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) + .allowedWorkspaceIds(List.of(Token.asString(tfeWorkspaceTestWorkspace.getId()))) + ); + } } ``` @@ -46,7 +56,7 @@ resource "tfe_agent_pool_allowed_workspaces" "foobar" { The following arguments are supported: -* `agentPoolId` - (Required) ID of the team. +* `agentPoolId` - (Required) The ID of the agent pool. * `allowedWorkspaceIds` - (Required) IDs of workspaces to be added as allowed workspaces on the agent pool. @@ -59,4 +69,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/variable_set.html.markdown b/website/docs/cdktf/java/r/variable_set.html.markdown index b77b4d9ca..f944e4120 100644 --- a/website/docs/cdktf/java/r/variable_set.html.markdown +++ b/website/docs/cdktf/java/r/variable_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variable sets. --- + + # tfe_variable_set Creates, updates and destroys variable sets. @@ -126,13 +128,57 @@ public class MyConvertedCode extends TerraformStack { } ``` +Create a priority variable set: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.variableSet.*; +import gen.providers.tfe.variable.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTest = new Organization(this, "test", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + VariableSet tfeVariableSetTest = new VariableSet(this, "test_1", new VariableSetConfig() + .description("Variable set applied to all workspaces.") + .name("Global Varset") + .organization(Token.asString(tfeOrganizationTest.getName())) + .priority(true) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.overrideLogicalId("test"); + new Variable(this, "test-a", new VariableConfig() + .category("terraform") + .description("a useful description") + .key("seperate_variable") + .value("my_value_name") + .variableSetId(Token.asString(tfeVariableSetTest.getId())) + ); + new Variable(this, "test-b", new VariableConfig() + .category("env") + .description("an environment variable") + .key("another_variable") + .value("my_value_name") + .variableSetId(Token.asString(tfeVariableSetTest.getId())) + ); + } +} +``` + ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. -* `global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `false`. +* `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspaceIds` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource @@ -151,4 +197,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index 702a048d7..548fdd526 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -82,6 +82,7 @@ The following arguments are supported: * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. @@ -181,4 +182,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 5ef505403..7293e009c 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeAgentPool(self, "test", + tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 4307e1f6a..8a6457b5a 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345 ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding a Github App Installation by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="installation_name" ) ``` @@ -65,4 +59,4 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index e4846574b..d51c305d5 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,20 +14,17 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformOutput, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - addresses = DataTfeIpRanges(self, "addresses") - TerraformOutput(self, "notifications_ips", - value=addresses.notifications + data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") + cdktf.TerraformOutput(self, "notifications_ips", + value=data_tfe_ip_ranges_addresses.notifications ) ``` @@ -45,4 +42,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index d597ecc3c..4aec1ba13 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its service provider ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -102,4 +93,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 138cd2228..5045a6657 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization import DataTfeOrganization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganization(self, "foo", + tfe.data_tfe_organization.DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index ccd7dcf24..73670ef47 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - bar = Organization(self, "bar", + tfe_organization_bar = tfe.organization.Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - DataTfeOrganizationMembers(self, "foo", - organization=bar.name + tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", + organization=cdktf.Token.as_string(tfe_organization_bar.name) ) ``` @@ -52,4 +48,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index ffff8bf2a..cc1def6d2 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,18 +22,15 @@ be updated manually. ### Fetch by email ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -42,18 +39,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by username ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -62,18 +56,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by organization membership ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -98,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index c7ed30ddb..8429aa128 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationRunTask(self, "example", + tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -50,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 6f11a23fa..4fffc37f9 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationTags(self, "example", + tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -47,4 +44,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index b3cf933e5..292e9c76f 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organizations import DataTfeOrganizations -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizations(self, "foo") + tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -44,4 +41,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 2e4e48760..8f6ed2dc5 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -21,28 +21,25 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.random.id import Id -from imports.tfe.data_tfe_outputs import DataTfeOutputs -class MyConvertedCode(TerraformStack): +import ...gen.providers.random as random +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. # For a more precise conversion please use the --provider flag in convert. - foo = DataTfeOutputs(self, "foo", + data_tfe_outputs_foo = tfe.data_tfe_outputs.DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) - Id(self, "vpc_id", + random.id.Id(self, "vpc_id", byte_length=8, keepers=[{ - "bar": foo.values.bar + "bar": data_tfe_outputs_foo.values.bar } ] ) @@ -62,4 +59,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 1650cb017..9b8aca2a9 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_policy_set import DataTfePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfePolicySet(self, "test", + tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -67,4 +64,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index f40145ff2..4a596f35f 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_project import DataTfeProject -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeProject(self, "foo", + tfe.data_tfe_project.DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index 376cdd483..338f92bfc 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,31 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - DataTfeSamlSettings(self, "foo", - provider=admin - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -74,4 +64,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 89ee070e4..6537c5f55 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeSlug(self, "test", + data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=Token.as_string_map(test) + slug=cdktf.Token.as_string_map(data_tfe_slug_test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -51,4 +47,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index 17ae4aad2..e95a873b6 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ssh_key import DataTfeSshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeSshKey(self, "test", + tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 8dcf44b9b..3e4f2c5e4 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team import DataTfeTeam -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeam(self, "test", + tfe.data_tfe_team.DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index 6ce1b674f..9755cf929 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_access import DataTfeTeamAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamAccess(self, "test", + tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -55,4 +52,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index 0d0da5115..503c9eb11 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamProjectAccess(self, "test", + tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index 4c55522ec..d812caa3c 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_teams import DataTfeTeams -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeams(self, "foo", + tfe.data_tfe_teams.DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -42,4 +39,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 4922935a4..3db389fb4 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeVariableSet(self, "test", + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -46,9 +43,10 @@ The following arguments are supported: * `organization` - Name of the organization. * `name` - Name of the variable set. * `description` - Description of the variable set. -* `global` - Whether or not the variable set applies to all workspaces in the organization. +* `global` - Whether the variable set applies to all workspaces in the organization. +* `priority` - Whether the variables in this set are able to be over-written. * `workspace_ids` - IDs of the workspaces that use the variable set. * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 77353b5c0..86ecde0ac 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,24 +16,20 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variables import DataTfeVariables -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - workspace_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -42,24 +38,21 @@ class MyConvertedCode(TerraformStack): For variable set variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -from imports.tfe.data_tfe_variables import DataTfeVariables -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeVariableSet(self, "test", + data_tfe_variable_set_test = + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - variable_set_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -87,4 +80,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 875803789..50048398f 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspace(self, "test", + tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -47,6 +44,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessments_enabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). @@ -87,4 +85,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index 58a1fb01e..31ac562e9 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceIds(self, "all", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "app-frontend", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "prod-apps", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - DataTfeWorkspaceIds(self, "prod-only", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -64,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 1cb0789a7..a278338f7 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceRunTask(self, "foobar", + tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 488a1e9d5..b2c222f1a 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,13 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.50.0" + } + } +} ``` As this provider is still at version zero, you should constrain the acceptable @@ -89,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -98,27 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name, *, email, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - Organization(self, "org", - email=email, - name=name - ) +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + token = var.token + version = "~> 0.50.0" +} + +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -138,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index a73146090..09c1f631e 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,45 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.admin_organization_settings import AdminOrganizationSettings -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - a_module_consumer = Organization(self, "a-module-consumer", - email="admin@company.com", - name="my-other-org" - ) - a_module_producer = Organization(self, "a-module-producer", - email="admin@company.com", - name="my-org" - ) - AdminOrganizationSettings(self, "test-settings", - access_beta_tools=False, - global_module_sharing=False, - module_sharing_consumer_organizations=[a_module_consumer.name], - organization=a_module_producer.name, - provider="${tfe.admin}", - workspace_limit=15 - ) +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" +} + +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -76,4 +70,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index f7947edeb..7f5d6afd1 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,25 +18,21 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - AgentPool(self, "test-agent-pool", + tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), organization_scoped=True ) ``` @@ -47,7 +43,7 @@ The following arguments are supported: * `name` - (Required) Name of the agent pool. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `organization_scoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. +* `organization_scoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. Should be `false` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference @@ -67,4 +63,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index 9e24ffa93..d993f5b18 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -20,36 +20,32 @@ for Business account. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = Workspace(self, "test", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=Token.as_string(tfe_organization_test.name) + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, - organization_scoped=True + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization_scoped=False ) - AgentPoolAllowedWorkspaces(self, "foobar", - agent_pool_id=Token.as_string(tfe_agent_pool_foobar.id), - allowed_workspace_ids=[test.id] + tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + allowed_workspace_ids=[ + cdktf.Token.as_string(tfe_workspace_test_workspace.id) + ] ) ``` @@ -70,4 +66,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 357e859cc..7cc7972c4 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,29 +17,24 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_token import AgentToken -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - AgentToken(self, "test-agent-token", - agent_pool_id=test_agent_pool.id, + tfe.agent_token.AgentToken(self, "test-agent-token", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), description="my-agent-token-name" ) ``` @@ -57,4 +52,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 678ab8cd0..797abcd7c 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,33 +16,28 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -51,33 +46,28 @@ class MyConvertedCode(TerraformStack): Creating a no-code module with variable options: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -119,4 +109,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index 39c9d68ef..d84e282c3 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,36 +19,32 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -57,43 +53,41 @@ class MyConvertedCode(TerraformStack): With `destination_type` of `email`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -102,45 +96,43 @@ class MyConvertedCode(TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -188,4 +180,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index 7b06126a3..f739902ae 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -47,18 +44,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -77,18 +71,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -130,4 +121,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index bdcc33f7b..f32912a93 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Organization(self, "test", + tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -64,4 +61,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 390a2e73c..1582dadb2 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationMembership(self, "test", + tfe.organization_membership.OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -69,4 +66,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 165fb1666..492a62139 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_module_sharing import OrganizationModuleSharing -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationModuleSharing(self, "test", + tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -43,4 +40,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 076f8a0b6..535677464 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_run_task import OrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationRunTask(self, "example", + tfe.organization_run_task.OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -63,4 +60,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index bed2c0235..66f833f7b 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationToken(self, "test", + tfe.organization_token.OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -49,28 +46,15 @@ never expire. When a token has an expiry: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - # For a more precise conversion please use the --provider flag in convert. - example = Rotating(self, "example", - rotation_days=30 - ) - OrganizationToken(self, "test", - expired_at=Token.as_string(example.rotation_rfc3339), - organization=Token.as_string(org.name) - ) +```hcl +resource "time_rotating" "example" { + rotation_days = 30 +} + +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -87,4 +71,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 793b3429b..5da71d87c 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -45,18 +42,15 @@ class MyConvertedCode(TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -97,4 +91,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index afa0bedd6..421c6b526 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,85 +21,54 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policies_path="policies/my-policy-set", - vcs_repo=PolicySetVcsRepo( - branch="main", - identifier="my-org-name/my-policy-set-repository", - ingress_submodules=False, - oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) - ), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id + } +} ``` Using manually-specified policies: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] +} ``` Manually uploaded policy set, in lieu of VCS: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test = DataTfeSlug(self, "test", - source_path="policies/my-policy-set" - ) - tfe_policy_set_test = PolicySet(self, "test_1", - description="A brand new policy set", - name="my-policy-set", - organization="my-org-name", - slug=Token.as_string_map(test), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_policy_set_test.override_logical_id("test") +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -159,4 +128,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 002101944..9758004e6 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,32 +16,28 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.policy_set_parameter import PolicySetParameter -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = + tfe.policy_set_parameter.PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=Token.as_string(tfe_policy_set_test.id), + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -73,4 +69,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index abdf640b8..0763e2626 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,25 +16,21 @@ Provides a project resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Project(self, "test", + tfe.project.Project(self, "test", name="projectname", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -59,4 +55,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index a2687c8f0..f3a5cd235 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -16,40 +16,34 @@ Adds and removes policy sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.project import Project -from imports.tfe.project_policy_set import ProjectPolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_project_test = Project(self, "test_2", + tfe_project_test = tfe.project.Project(self, "test_2", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - project_id=Token.as_string(tfe_project_test.id) + tfe_project_policy_set_test = tfe.project_policy_set.ProjectPolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + project_id=cdktf.Token.as_string(tfe_project_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_policy_set_test.override_logical_id("test") @@ -74,4 +68,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 066c7d5e0..da5561bc7 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,40 +16,35 @@ Adds and removes variable sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_3", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -74,4 +69,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 11c5bef3b..d73e2216d 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,35 +16,30 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -52,31 +47,27 @@ class MyConvertedCode(TerraformStack): Create private registry module with GitHub App: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", + data_tfe_github_app_installation_gha_installation = + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - RegistryModule(self, "petstore", - organization=test_organization.name, + tfe.registry_module.RegistryModule(self, "petstore", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=Token.as_string(gha_installation.id), + github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -85,26 +76,22 @@ class MyConvertedCode(TerraformStack): Create private registry module without VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-private-registry-module", + tfe.registry_module.RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="private" ) ``` @@ -112,27 +99,23 @@ class MyConvertedCode(TerraformStack): Create public registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-public-registry-module", + tfe.registry_module.RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) ``` @@ -140,33 +123,29 @@ class MyConvertedCode(TerraformStack): Create no-code provisioning registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", + tfe_registry_module_test_no_code_provisioning_registry_module = + tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) - NoCodeModule(self, "foobar", - organization=test_organization.id, - registry_module=test_no_code_provisioning_registry_module.id + tfe.no_code_module.NoCodeModule(self, "foobar", + organization=cdktf.Token.as_string(tfe_organization_test_organization.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) ) ``` @@ -218,4 +197,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index e49570aed..f4dd3b56c 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,34 +19,29 @@ to up to 20 source workspaces. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.run_trigger import RunTrigger -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_sourceable = Workspace(self, "test-sourceable", + tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - test_workspace = Workspace(self, "test-workspace", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - RunTrigger(self, "test", - sourceable_id=test_sourceable.id, - workspace_id=test_workspace.id + tfe.run_trigger.RunTrigger(self, "test", + sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) ) ``` @@ -70,4 +65,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index e955b370a..0fa49386c 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,28 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.provider import TfeProvider -from imports.tfe.saml_settings import SamlSettings -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=admin_token.string_value - ) - SamlSettings(self, "this", - idp_cert="foobarCertificate", - slo_endpoint_url="https://example.com/slo_endpoint_url", - sso_endpoint_url="https://example.com/sso_endpoint_url" - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -75,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index c9f5d2db2..73d0ed16c 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_policy import SentinelPolicy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelPolicy(self, "test", + tfe.sentinel_policy.SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 5a43faf22..177974c7f 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.ssh_key import SshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SshKey(self, "test", + tfe.ssh_key.SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -52,4 +49,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 5232b4f29..bec6f6a88 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): Organization Permission usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -97,4 +91,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index 0cf68d501..ab50b1a2d 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_access import TeamAccess -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = TeamAccess(self, "test_2", + tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", access="read", - team_id=test.id, - workspace_id=Token.as_string(tfe_workspace_test.id) + team_id=cdktf.Token.as_string(tfe_team_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -82,4 +77,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index cbb0466be..e146c6558 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_member import TeamMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = TeamMember(self, "test_1", - team_id=test.id, + tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -65,4 +61,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index f04aedc6e..697cfe48b 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -52,26 +48,22 @@ class MyConvertedCode(TerraformStack): With a set of usernames: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_usernames = Fn.toset(["user1", "user2"]) - test = Team(self, "test", + all_usernames = cdktf.Fn.toset(["user1", "user2"]) + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, - usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), + usernames=cdktf.Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_members_test.override_logical_id("test") @@ -96,4 +88,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index b74af25bb..5353364f6 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,32 +24,29 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_member import TeamOrganizationMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_1", + tfe_team_test = tfe.team.Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", - organization_membership_id=test.id, - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = + tfe.team_organization_member.TeamOrganizationMember(self, "test_2", + organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -75,4 +72,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 44a247b02..04ced9cca 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,36 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - sample = OrganizationMembership(self, "sample", + tfe_organization_membership_sample = + tfe.organization_membership.OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_2", + tfe_team_test = tfe.team.Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[test.id, sample.id], - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.id), + cdktf.Token.as_string(tfe_organization_membership_sample.id) + ], + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -62,38 +63,35 @@ class MyConvertedCode(TerraformStack): With a set of organization members: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformIterator, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) + all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" + ]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - all_membership_for_each_iterator = TerraformIterator.from_list( - Token.as_any(all_users)) - OrganizationMembership(self, "all_membership", - email=Token.as_string(all_membership_for_each_iterator.key), + tfe_organization_membership_all_membership_for_each_iterator = + cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) + tfe.organization_membership.OrganizationMembership(self, "all_membership", + email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), organization="my-org-name", - for_each=all_membership_for_each_iterator + for_each=tfe_organization_membership_all_membership_for_each_iterator ) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", - organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=test.id + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", + organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -115,4 +113,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index ff15b44e0..c731f4db5 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,31 +16,27 @@ Associate a team to permissions on a project. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - admin = Team(self, "admin", + tfe_team_admin = tfe.team.Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = + tfe.team_project_access.TeamProjectAccess(self, "admin_2", access="admin", - project_id=test.id, - team_id=admin.id + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_admin.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -88,36 +84,31 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - dev = Team(self, "dev", + tfe_team_dev = tfe.team.Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - TeamProjectAccess(self, "custom", + tfe.team_project_access.TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=test.id, - team_id=dev.id, + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_dev.id), workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -146,4 +137,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index 7e1f2ec67..4c90cfbb8 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = TeamToken(self, "test_1", - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -56,31 +52,27 @@ never expire. When a token has an expiry: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +import ...gen.providers.time as time +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. # For a more precise conversion please use the --provider flag in convert. - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - example = Rotating(self, "example", + time_rotating_example = time.rotating.Rotating(self, "example", rotation_days=30 ) - tfe_team_token_test = TeamToken(self, "test_2", - expired_at=Token.as_string(example.rotation_rfc3339), - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_2", + expired_at=cdktf.Token.as_string(time_rotating_example.rotation_rfc3339), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -99,4 +91,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 4945a4a2d..5d19d8f3e 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.terraform_version import TerraformVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - TerraformVersion(self, "test", + tfe.terraform_version.TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -65,4 +62,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index 364a6b27d..a32fa5e33 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,35 +16,30 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = Variable(self, "test_2", + tfe_variable_test = tfe.variable.Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -53,44 +48,39 @@ class MyConvertedCode(TerraformStack): Basic usage for variable sets: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -129,41 +119,33 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - sensitive_var = Variable(self, "sensitive_var", - category="terraform", - key="sensitive_key", - sensitive=True, - value="sensitive_value", - workspace_id=workspace.id - ) - visible_var = Variable(self, "visible_var", - category="terraform", - key="visible_key", - sensitive=False, - value="visible_value", - workspace_id=workspace.id - ) - Workspace(self, "sensitive_workspace", - name="workspace-${" + sensitive_var.value + "}", - organization="organization name" - ) - Workspace(self, "visible_workspace", - name="workspace-${" + visible_var.readable_value + "}", - organization="organization name" - ) +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" +} + ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -189,4 +171,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index e48e36c71..524373524 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,115 +16,142 @@ Creates, updates and destroys variable sets. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="projectname", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_3", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_5", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + ) +``` + +Create a priority variable set: + +```python +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. +# See https://cdk.tf/provider-generation for more details. +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + tfe_organization_test = tfe.organization.Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + description="Variable set applied to all workspaces.", + name="Global Varset", + organization=cdktf.Token.as_string(tfe_organization_test.name), + priority=True + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_variable_set_test.override_logical_id("test") + tfe.variable.Variable(self, "test-a", + category="terraform", + description="a useful description", + key="seperate_variable", + value="my_value_name", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + ) + tfe.variable.Variable(self, "test-b", + category="env", + description="an environment variable", + key="another_variable", + value="my_value_name", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -134,7 +161,8 @@ The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. -* `global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `false`. +* `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspace_ids` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource @@ -153,4 +181,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 97f02223c..6fc069904 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -18,25 +18,21 @@ Provides a workspace resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Workspace(self, "test", + tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), tag_names=["test", "app"] ) ``` @@ -44,32 +40,27 @@ class MyConvertedCode(TerraformStack): With `execution_mode` of `agent`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - Workspace(self, "test", - agent_pool_id=test_agent_pool.id, + tfe.workspace.Workspace(self, "test", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), execution_mode="agent", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -84,6 +75,7 @@ The following arguments are supported: * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. @@ -183,4 +175,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index c628fedb3..733784218 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set import WorkspacePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = + tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 14839cae4..5f052b546 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = + tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -76,4 +71,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index d32e5c6e7..e79741bc7 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,52 +24,46 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - child = Workspace(self, "child", + tfe_workspace_child = tfe.workspace.Workspace(self, "child", name="child-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - ws_run_parent = WorkspaceRun(self, "ws_run_parent", + tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -82,64 +76,58 @@ class MyConvertedCode(TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) - WorkspaceRun(self, "ws_run_child", + tfe.workspace_run.WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[ws_run_parent], + depends_on=[tfe_workspace_run_ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=child.id + workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) ) ``` With manual confirmation: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -147,49 +135,43 @@ class MyConvertedCode(TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` With no retries: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -199,7 +181,7 @@ class MyConvertedCode(TerraformStack): retry=False, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` @@ -228,4 +210,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 9f1525ed7..450d01813 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,23 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.workspace_run_task import WorkspaceRunTask -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - WorkspaceRunTask(self, "example", - enforcement_level="advisory", - task_id=tfe_organization_run_task.example.id, - workspace_id=tfe_workspace.example.id - ) +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" +} ``` ## Argument Reference @@ -58,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index 29f11de9f..de6cad570 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes variable sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index 44f318eca..ffbc8593d 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeAgentPool(this, "test", { + new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 304f6a929..54c0ea219 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,20 +16,21 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - installationId: 12345, - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + installationId: 12345, + } + ); } } @@ -38,20 +39,21 @@ class MyConvertedCode extends TerraformStack { ### Finding a Github App Installation by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - name: "installation_name", - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "installation_name", + } + ); } } @@ -71,4 +73,4 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index a4c0927da..3aef65fe1 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,20 +14,21 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformOutput, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const addresses = new DataTfeIpRanges(this, "addresses", {}); - new TerraformOutput(this, "notifications_ips", { - value: addresses.notifications, + const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( + this, + "addresses", + {} + ); + new cdktf.TerraformOutput(this, "notifications_ips", { + value: dataTfeIpRangesAddresses.notifications, }); } } @@ -48,4 +49,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index e093c1f42..fd3cee123 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -38,18 +35,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -61,18 +55,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its service provider ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -111,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 80eeb599a..97f356774 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganization(this, "foo", { + new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 95b1990cb..290c8836c 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const bar = new Organization(this, "bar", { + const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new DataTfeOrganizationMembers(this, "foo", { - organization: bar.name, + new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { + organization: cdktf.Token.asString(tfeOrganizationBar.name), }); } } @@ -55,4 +51,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index f9f65f023..a5a620a28 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,21 +22,22 @@ be updated manually. ### Fetch by email ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - email: "user@company.com", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + email: "user@company.com", + organization: "my-org-name", + } + ); } } @@ -45,21 +46,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by username ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - username: "my-username", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + username: "my-username", + } + ); } } @@ -68,21 +70,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by organization membership ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + } + ); } } @@ -107,4 +110,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index c1f65f0b8..1ee342ef1 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,21 +16,22 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationRunTask(this, "example", { - name: "task-name", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( + this, + "example", + { + name: "task-name", + organization: "my-org-name", + } + ); } } @@ -53,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index 75763fa62..d608cc1e3 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationTags(this, "example", { + new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -50,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index f612f9fcb..31989059d 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizations(this, "foo", {}); + new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); } } @@ -47,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index e1230ab01..9b23d1a90 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -21,29 +21,30 @@ Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as s In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Id } from "./.gen/providers/random/id"; -import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as random from "./.gen/providers/random"; +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. For a more precise conversion please use the --provider flag in convert.*/ - const foo = new DataTfeOutputs(this, "foo", { - organization: "my-org", - workspace: "my-workspace", - }); - new Id(this, "vpc_id", { + const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( + this, + "foo", + { + organization: "my-org", + workspace: "my-workspace", + } + ); + new random.id.Id(this, "vpc_id", { byte_length: 8, keepers: [ { - bar: foo.values.bar, + bar: dataTfeOutputsFoo.values.bar, }, ], }); @@ -66,4 +67,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 4ed6c1d99..2a104a3c0 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfePolicySet(this, "test", { + new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -70,4 +67,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index 875b65281..5f30b68c5 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeProject(this, "foo", { + new tfe.dataTfeProject.DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 4045d9037..eac1110a0 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,34 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new DataTfeSamlSettings(this, "foo", { - provider: admin, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token } +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -77,4 +64,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 8fe21a539..af7210b06 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeSlug(this, "test", { + const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: Token.asStringMap(test), + slug: cdktf.Token.asStringMap(dataTfeSlugTest), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -54,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 3ba919e18..0d701abdd 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeSshKey(this, "test", { + new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 97471ee15..51606205e 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeam(this, "test", { + new tfe.dataTfeTeam.DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index f09d31bf6..8cd9aea95 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamAccess(this, "test", { + new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -58,4 +55,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 0288eca84..65ed3def9 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamProjectAccess(this, "test", { + new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index e2de9c343..d19832163 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeams(this, "foo", { + new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index e63ff625a..c5bab02a4 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeVariableSet(this, "test", { + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -49,9 +46,10 @@ The following arguments are supported: * `organization` - Name of the organization. * `name` - Name of the variable set. * `description` - Description of the variable set. -* `global` - Whether or not the variable set applies to all workspaces in the organization. +* `global` - Whether the variable set applies to all workspaces in the organization. +* `priority` - Whether the variables in this set are able to be over-written. * `workspaceIds` - IDs of the workspaces that use the variable set. * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index ec9627457..93b932f9d 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,25 +16,29 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -45,25 +49,26 @@ class MyConvertedCode extends TerraformStack { For variable set variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - variableSetId: Token.asString(test.id), - }); + const dataTfeVariableSetTest = + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -93,4 +98,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index c68212b0e..b4332b458 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspace(this, "test", { + new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -50,6 +47,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. +* `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). @@ -90,4 +88,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 2b9cd5008..3f83d01b9 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceIds(this, "all", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "app-frontend", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "prod-apps", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new DataTfeWorkspaceIds(this, "prod-only", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -67,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 96d78871e..7aa26820c 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceRunTask(this, "foobar", { + new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 4a01c70f6..a6579445d 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -73,16 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.50.0" + } } } - ``` As this provider is still at version zero, you should constrain the acceptable @@ -92,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.49.2" + version = "~> 0.50.0" ... } ``` @@ -101,34 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -interface MyConfig { - email: any; - name: any; -} -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string, config: MyConfig) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - new Organization(this, "org", { - email: config.email, - name: config.name, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + token = var.token + version = "~> 0.50.0" } +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -136,7 +117,7 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. - Defaults to `appTerraformIo`. Can be overridden by setting the + Defaults to `app.terraform.io`. Can be overridden by setting the `tfeHostname` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. @@ -148,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index a6ed9a465..93f71e023 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,48 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - const aModuleConsumer = new Organization(this, "a-module-consumer", { - email: "admin@company.com", - name: "my-other-org", - }); - const aModuleProducer = new Organization(this, "a-module-producer", { - email: "admin@company.com", - name: "my-org", - }); - new AdminOrganizationSettings(this, "test-settings", { - accessBetaTools: false, - globalModuleSharing: false, - moduleSharingConsumerOrganizations: [aModuleConsumer.name], - organization: aModuleProducer.name, - provider: "${tfe.admin}", - workspaceLimit: 15, - }); - } +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" } +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -79,4 +70,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 1b3d9b210..40f488f24 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new AgentPool(this, "test-agent-pool", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.agentPool.AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), organizationScoped: true, }); } @@ -50,7 +50,7 @@ The following arguments are supported: * `name` - (Required) Name of the agent pool. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. -* `organizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. +* `organizationScoped` - (Optional) Whether or not the agent pool is scoped to all workspaces in the organization. Defaults to `true`. Should be `false` when limiting workspaces that can use the agent pool with the [tfe_agent_pool_allowed_workspaces](agent_pool_allowed_workspaces.html) resource. ## Attributes Reference @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index 035622708..ae669f287 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -20,37 +20,53 @@ for Business account. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { - name: "my-workspace-name", - organization: Token.asString(tfeOrganizationTest.name), - }); - new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - organizationScoped: true, - }); - new AgentPoolAllowedWorkspaces(this, "foobar", { - agentPoolId: Token.asString(tfeAgentPoolFoobar.id), - allowedWorkspaceIds: [test.id], - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + organizationScoped: false, + } + ); + new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( + this, + "test-allowed-workspaces", + { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: [ + cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + ], + } + ); } } @@ -73,4 +89,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index 530a19d6a..e37e6da4d 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,29 +17,32 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentToken } from "./.gen/providers/tfe/agent-token"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.id, - }); - new AgentToken(this, "test-agent-token", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.agentToken.AgentToken(this, "test-agent-token", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), description: "my-agent-token-name", }); } @@ -60,4 +63,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index bd4c0def0..f740a6434 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,34 +16,41 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -54,46 +61,53 @@ class MyConvertedCode extends TerraformStack { Creating a no-code module with variable options: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -127,4 +141,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index f772d9699..81ee6208b 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { - name: "my-workspace-name", - organization: test.id, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_2", + "test", { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: Token.asString(tfeWorkspaceTest.id), + email: "admin@company.com", + name: "my-org-name", } ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,52 +64,50 @@ class MyConvertedCode extends TerraformStack { With `destinationType` of `email`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -120,57 +118,55 @@ class MyConvertedCode extends TerraformStack { (**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -220,4 +216,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 5fe9abf31..da2e6cca5 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -50,18 +47,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -84,18 +78,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -142,4 +133,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 94f77e3c1..cbaab56b4 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Organization(this, "test", { + new tfe.organization.Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -67,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index af3a1efb7..1ba96fccd 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationMembership(this, "test", { + new tfe.organizationMembership.OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -72,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 6b1954c0d..7a8d6f4bc 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationModuleSharing(this, "test", { + new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -46,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index c7b69cabc..af88749b5 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationRunTask(this, "example", { + new tfe.organizationRunTask.OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index d37a973cf..13d4d4730 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationToken(this, "test", { + new tfe.organizationToken.OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -52,31 +49,15 @@ never expire. When a token has an expiry: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - For a more precise conversion please use the --provider flag in convert.*/ - const example = new Rotating(this, "example", { - rotation_days: 30, - }); - new OrganizationToken(this, "test", { - expiredAt: Token.asString(example.rotationRfc3339), - organization: Token.asString(org.name), - }); - } +```hcl +resource "time_rotating" "example" { + rotation_days = 30 } +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -93,4 +74,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index e5f2e8540..d99b59da7 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -48,18 +45,15 @@ class MyConvertedCode extends TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -103,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 0d970bf07..8d382fa79 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,94 +21,54 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policiesPath: "policies/my-policy-set", - vcsRepo: { - branch: "main", - identifier: "my-org-name/my-policy-set-repository", - ingressSubmodules: false, - oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), - }, - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id } } - ``` Using manually-specified policies: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policyIds: [Token.asString(tfeSentinelPolicyTest.id)], - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - } +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } - ``` Manually uploaded policy set, in lieu of VCS: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new DataTfeSlug(this, "test", { - sourcePath: "policies/my-policy-set", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { - description: "A brand new policy set", - name: "my-policy-set", - organization: "my-org-name", - slug: Token.asStringMap(test), - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfePolicySetTest.overrideLogicalId("test"); - } +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" } +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -168,4 +128,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index c1cd54e3d..f7d672c9d 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = + new tfe.policySetParameter.PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index eaee9c086..06087bc21 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Project(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.project.Project(this, "test", { name: "projectname", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 90a574997..86709c22d 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -16,41 +16,43 @@ Adds and removes policy sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new Project(this, "test_2", { + const tfeProjectTest = new tfe.project.Project(this, "test_2", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - projectId: Token.asString(tfeProjectTest.id), - }); + const tfeProjectPolicySetTest = new tfe.projectPolicySet.ProjectPolicySet( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + projectId: cdktf.Token.asString(tfeProjectTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectPolicySetTest.overrideLogicalId("test"); } @@ -77,4 +79,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index a973a2f2d..62fa66b9d 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -16,41 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_3", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); } @@ -77,4 +76,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index d318812d2..4e29b136c 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,35 +16,42 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -55,35 +62,37 @@ class MyConvertedCode extends TerraformStack { Create private registry module with GitHub App: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const ghaInstallation = new DataTfeGithubAppInstallation( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "gha_installation", + "test-organization", { - name: "YOUR_GH_NAME", + email: "admin@company.com", + name: "my-org-name", } ); - new RegistryModule(this, "petstore", { - organization: testOrganization.name, + const dataTfeGithubAppInstallationGhaInstallation = + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "YOUR_GH_NAME", + } + ); + new tfe.registryModule.RegistryModule(this, "petstore", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: Token.asString(ghaInstallation.id), + githubAppInstallationId: cdktf.Token.asString( + dataTfeGithubAppInstallationGhaInstallation.id + ), identifier: "GH_NAME/REPO_NAME", }, }); @@ -95,28 +104,34 @@ class MyConvertedCode extends TerraformStack { Create private registry module without VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-private-registry-module", { - moduleProvider: "my_provider", - name: "another_test_module", - organization: testOrganization.name, - registryName: "private", - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule( + this, + "test-private-registry-module", + { + moduleProvider: "my_provider", + name: "another_test_module", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "private", + } + ); } } @@ -125,27 +140,27 @@ class MyConvertedCode extends TerraformStack { Create public registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-public-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), registryName: "public", }); } @@ -156,37 +171,41 @@ class MyConvertedCode extends TerraformStack { Create no-code provisioning registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testNoCodeProvisioningRegistryModule = new RegistryModule( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "test-no-code-provisioning-registry-module", + "test-organization", { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: testOrganization.name, - registryName: "public", + email: "admin@company.com", + name: "my-org-name", } ); - new NoCodeModule(this, "foobar", { - organization: testOrganization.id, - registryModule: testNoCodeProvisioningRegistryModule.id, + const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = + new tfe.registryModule.RegistryModule( + this, + "test-no-code-provisioning-registry-module", + { + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "public", + } + ); + new tfe.noCodeModule.NoCodeModule(this, "foobar", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + registryModule: cdktf.Token.asString( + tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id + ), }); } } @@ -241,4 +260,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 89588e323..dcfe00943 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,34 +19,41 @@ to up to 20 source workspaces. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testSourceable = new Workspace(this, "test-sourceable", { - name: "my-sourceable-workspace-name", - organization: testOrganization.id, - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.id, - }); - new RunTrigger(this, "test", { - sourceableId: testSourceable.id, - workspaceId: testWorkspace.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( + this, + "test-sourceable", + { + name: "my-sourceable-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.runTrigger.RunTrigger(this, "test", { + sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), }); } } @@ -73,4 +80,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index d73db9393..430a810e7 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,31 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TfeProvider } from "./.gen/providers/tfe/provider"; -import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new SamlSettings(this, "this", { - idpCert: "foobarCertificate", - sloEndpointUrl: "https://example.com/slo_endpoint_url", - ssoEndpointUrl: "https://example.com/sso_endpoint_url", - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token } +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -78,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 8b6cdfcf7..206276ff4 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelPolicy(this, "test", { + new tfe.sentinelPolicy.SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -69,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 8124e2b2f..90680d24c 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SshKey } from "./.gen/providers/tfe/ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SshKey(this, "test", { + new tfe.sshKey.SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -55,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index f9fd2da7d..b793d408b 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -39,18 +36,15 @@ class MyConvertedCode extends TerraformStack { Organization Permission usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -103,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 97c4e80f1..8af746faa 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamAccess } from "./.gen/providers/tfe/team-access"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { access: "read", - teamId: test.id, - workspaceId: Token.asString(tfeWorkspaceTest.id), + teamId: cdktf.Token.asString(tfeTeamTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -85,4 +80,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index 045b3bec9..eb7cf719c 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMember } from "./.gen/providers/tfe/team-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new TeamMember(this, "test_1", { - teamId: test.id, + const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -68,4 +64,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index c1940fcc2..5ca27b059 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -55,26 +51,22 @@ class MyConvertedCode extends TerraformStack { With a set of usernames: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsernames = Fn.toset(["user1", "user2"]); - const test = new Team(this, "test", { + const allUsernames = cdktf.Fn.toset(["user1", "user2"]); + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, - usernames: Token.asList( + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), + usernames: cdktf.Token.asList( "${[ for user in ${" + allUsernames + "} : user]}" ), }); @@ -104,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index cb37b34f4..1eec91879 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,37 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_1", { + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( - this, - "test_2", - { - organizationMembershipId: test.id, - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMemberTest = + new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { + organizationMembershipId: cdktf.Token.asString( + tfeOrganizationMembershipTest.id + ), + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -82,4 +77,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 8480e22d9..ba1476eec 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,41 +24,38 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const sample = new OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_2", { + const tfeOrganizationMembershipSample = + new tfe.organizationMembership.OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_3", - { - organizationMembershipIds: [test.id, sample.id], - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { + organizationMembershipIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.id), + cdktf.Token.asString(tfeOrganizationMembershipSample.id), + ], + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -69,48 +66,48 @@ class MyConvertedCode extends TerraformStack { With a set of organization members: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); + const allUsers = cdktf.Fn.toset([ + "user1@hashicorp.com", + "user2@hashicorp.com", + ]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const allMembershipForEachIterator = TerraformIterator.fromList( - Token.asAny(allUsers) + const tfeOrganizationMembershipAllMembershipForEachIterator = + cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); + new tfe.organizationMembership.OrganizationMembership( + this, + "all_membership", + { + email: cdktf.Token.asString( + tfeOrganizationMembershipAllMembershipForEachIterator.key + ), + organization: "my-org-name", + forEach: tfeOrganizationMembershipAllMembershipForEachIterator, + } ); - new OrganizationMembership(this, "all_membership", { - email: Token.asString(allMembershipForEachIterator.key), - organization: "my-org-name", - forEach: allMembershipForEachIterator, - }); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_2", - { - organizationMembershipIds: Token.asList( + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { + organizationMembershipIds: cdktf.Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: test.id, - } - ); + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -134,4 +131,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 4c9e1f8f8..db12e574d 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,32 +16,28 @@ Associate a team to permissions on a project. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const admin = new Team(this, "admin", { + const tfeTeamAdmin = new tfe.team.Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: test.id, - teamId: admin.id, - }); + const tfeTeamProjectAccessAdmin = + new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamAdmin.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -91,28 +87,23 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const dev = new Team(this, "dev", { + const tfeTeamDev = new tfe.team.Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new TeamProjectAccess(this, "custom", { + new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -120,8 +111,8 @@ class MyConvertedCode extends TerraformStack { teams: "none", }, ], - projectId: test.id, - teamId: dev.id, + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamDev.id), workspaceAccess: [ { create: true, @@ -154,4 +145,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index 1b0eeb542..f450192af 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new TeamToken(this, "test_1", { - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -59,31 +55,27 @@ never expire. When a token has an expiry: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +import * as time from "./.gen/providers/time"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const example = new Rotating(this, "example", { + const timeRotatingExample = new time.rotating.Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new TeamToken(this, "test_2", { - expiredAt: Token.asString(example.rotationRfc3339), - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { + expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -105,4 +97,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 18d301451..f122ae910 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new TerraformVersion(this, "test", { + new tfe.terraformVersion.TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -68,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 015d5d326..1d442d61a 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,35 +16,34 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new Variable(this, "test_2", { + const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: Token.asString(tfeWorkspaceTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -56,44 +55,43 @@ class MyConvertedCode extends TerraformStack { Basic usage for variable sets: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -135,42 +133,31 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const sensitiveVar = new Variable(this, "sensitive_var", { - category: "terraform", - key: "sensitive_key", - sensitive: true, - value: "sensitive_value", - workspaceId: workspace.id, - }); - const visibleVar = new Variable(this, "visible_var", { - category: "terraform", - key: "visible_key", - sensitive: false, - value: "visible_value", - workspaceId: workspace.id, - }); - new Workspace(this, "sensitive_workspace", { - name: "workspace-${" + sensitiveVar.value + "}", - organization: "organization name", - }); - new Workspace(this, "visible_workspace", { - name: "workspace-${" + visibleVar.readableValue + "}", - organization: "organization name", - }); - } +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" } ``` @@ -198,4 +185,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index 106d723e6..ceb0d3f23 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,75 +16,68 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "projectname", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_3", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_4", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -94,44 +87,89 @@ class MyConvertedCode extends TerraformStack { Creating a global variable set: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.overrideLogicalId("test"); + new tfe.variable.Variable(this, "test-a", { + category: "terraform", + description: "a useful description", + key: "seperate_variable", + value: "my_value_name", + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); + new tfe.variable.Variable(this, "test-b", { + category: "env", + description: "an environment variable", + key: "another_variable", + value: "my_value_name", + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); + } +} + +``` + +Create a priority variable set: + +```typescript +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { + super(scope, name); + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + description: "Variable set applied to all workspaces.", + name: "Global Varset", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + priority: true, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -144,7 +182,8 @@ The following arguments are supported: * `name` - (Required) Name of the variable set. * `description` - (Optional) Description of the variable set. -* `global` - (Optional) Whether or not the variable set applies to all workspaces in the organization. Defaults to `false`. +* `global` - (Optional) Whether the variable set applies to all workspaces in the organization. Defaults to `false`. +* `priority` - (Optional) Whether the variables in this set can be over-written by more specific scopes including values set on the command line. Defaults to `false`. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `workspaceIds` - **Deprecated** (Optional) IDs of the workspaces that use the variable set. Must not be set if `global` is set. This argument is mutually exclusive with using the resource @@ -163,4 +202,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 0e9cecb61..18a00183b 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -18,25 +18,25 @@ Provides a workspace resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), tagNames: ["test", "app"], }); } @@ -47,32 +47,37 @@ class MyConvertedCode extends TerraformStack { With `executionMode` of `agent`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - }); - new Workspace(this, "test", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + } + ); + new tfe.workspace.Workspace(this, "test", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), executionMode: "agent", name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -90,6 +95,7 @@ The following arguments are supported: * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. +* `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. @@ -189,4 +195,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index f1f0420c9..08afbc792 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -18,41 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = + new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -79,4 +78,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 635fdf53c..2bca759b3 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -18,45 +18,44 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = + new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -83,4 +82,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 466abe78e..f1875dbe2 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -24,80 +24,82 @@ The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or Basic usage with multiple workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const child = new Workspace(this, "child", { + const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { name: "child-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, - }, - }); - const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: parent.id, }); - new WorkspaceRun(this, "ws_run_child", { + const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( + this, + "ws_run_parent", + { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, + }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + } + ); + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [wsRunParent], + dependsOn: [tfeWorkspaceRunWsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: child.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), }); } } @@ -107,42 +109,40 @@ class MyConvertedCode extends TerraformStack { With manual confirmation: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -160,42 +160,40 @@ class MyConvertedCode extends TerraformStack { With no retries: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -205,7 +203,7 @@ class MyConvertedCode extends TerraformStack { retry: false, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -237,4 +235,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 4a9ed1f46..2af33a4b9 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,26 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new WorkspaceRunTask(this, "example", { - enforcementLevel: "advisory", - taskId: tfeOrganizationRunTask.example.id, - workspaceId: tfeWorkspace.example.id, - }); - } +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" } - ``` ## Argument Reference @@ -61,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index aa89dcd59..946d0f324 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -18,45 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_3", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -83,4 +78,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From b6f78c940e7192e47f28635648aa328d38e4c7cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:19:05 +0000 Subject: [PATCH 089/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 2cd59a2d0..c8d3f8a55 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect - github.com/hashicorp/terraform-plugin-framework v1.4.1 + github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.19.0 github.com/hashicorp/terraform-plugin-mux v0.12.0 @@ -25,8 +25,8 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.0 - golang.org/x/crypto v0.13.0 // indirect - golang.org/x/net v0.13.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.13.0 // indirect @@ -37,7 +37,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/mock v1.6.0 - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect diff --git a/go.sum b/go.sum index 95a6ad1ff..c1ba5880c 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -81,8 +81,8 @@ github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81Sp github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= -github.com/hashicorp/terraform-plugin-framework v1.4.1 h1:ZC29MoB3Nbov6axHdgPbMz7799pT5H8kIrM8YAsaVrs= -github.com/hashicorp/terraform-plugin-framework v1.4.1/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0= +github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5OckzhoiO3ig6SGxwelD2sI= +github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= @@ -159,8 +159,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -175,8 +175,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From f8c3ea402749c85962fec340e4688e43019cc6ab Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Fri, 10 Nov 2023 13:18:32 -0500 Subject: [PATCH 090/420] Upgrade go-tfe to v1.39.2 --- CHANGELOG.md | 1 + go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 262d75602..7f8380cd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ BUG FIXES: * `r/tfe_policy_set`: Fix detecting spurious changes on every run when providing file contents with `tfe_slug`. This may require an updated version of tfc-agent for the full fix to take effect. Fixed by upgrading go-slug to v0.13.1 [1123](https://github.com/hashicorp/terraform-provider-tfe/pull/1123) * `r/tfe_variable`: Fix nil pointer dereference segfault on client error during Update operations, by @nfagerlund [1131](https://github.com/hashicorp/terraform-provider-tfe/1131) * provider: Fix an issue where the request body is not preserved during certain retry scenarios, by @sebasslash [1135](https://github.com/hashicorp/terraform-provider-tfe/pull/1135) +* provider: Fix a build failure for 32 bit linux architectures by @brandonc [1139](https://github.com/hashicorp/terraform-provider-tfe/pull/1139) ## v0.49.2 (October 4, 2023) diff --git a/go.mod b/go.mod index 2cd59a2d0..d22cacf3d 100644 --- a/go.mod +++ b/go.mod @@ -11,8 +11,8 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect - github.com/hashicorp/go-slug v0.13.1 - github.com/hashicorp/go-tfe v1.39.1 + github.com/hashicorp/go-slug v0.13.2 + github.com/hashicorp/go-tfe v1.39.2 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect diff --git a/go.sum b/go.sum index 95a6ad1ff..390f79150 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBY github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.13.1 h1:2it55HK4vVXsBoCgUQ7Y2ADQpBaU1ge25VRp1wzZpTM= -github.com/hashicorp/go-slug v0.13.1/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.39.1 h1:UZF9Avfg2tRlYFuRArktWRkAgwe6I0Vp/ZVhCt/nuv8= -github.com/hashicorp/go-tfe v1.39.1/go.mod h1:/+MNl/OTw26MYEJDnc2utP43QwBgOLrbOQaug6VbeCY= +github.com/hashicorp/go-slug v0.13.2 h1:ArlarJ8w1Rinx4P1N6Sr00t+GmjJWtYZuSEDYPQBErA= +github.com/hashicorp/go-slug v0.13.2/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= +github.com/hashicorp/go-tfe v1.39.2 h1:2RrFa6UWEJghQVl248Avd9TJE+ii3NqDD75jBEcr/Tg= +github.com/hashicorp/go-tfe v1.39.2/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 975ea0f09eea5987237dfde6e29d4e27365ed198 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:15:04 +0000 Subject: [PATCH 091/420] cdktf: update d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- .../cdktf/python/d/agent_pool.html.markdown | 17 +++-- .../d/github_installation.html.markdown | 32 +++++---- .../cdktf/python/d/ip_ranges.html.markdown | 21 +++--- .../cdktf/python/d/oauth_client.html.markdown | 47 +++++++------ .../cdktf/python/d/organization.html.markdown | 17 +++-- .../d/organization_members.html.markdown | 22 +++--- .../typescript/d/agent_pool.html.markdown | 21 +++--- .../d/github_installation.html.markdown | 58 ++++++++-------- .../typescript/d/ip_ranges.html.markdown | 29 ++++---- .../typescript/d/oauth_client.html.markdown | 67 +++++++++++-------- .../typescript/d/organization.html.markdown | 23 ++++--- .../d/organization_members.html.markdown | 26 ++++--- 12 files changed, 212 insertions(+), 168 deletions(-) diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 7293e009c..ea054dd0d 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", + DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 8a6457b5a..9a94a3068 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345 ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding a Github App Installation by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", name="installation_name" ) ``` @@ -59,4 +65,4 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index d51c305d5..111748bdc 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,17 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") - cdktf.TerraformOutput(self, "notifications_ips", - value=data_tfe_ip_ranges_addresses.notifications + addresses = DataTfeIpRanges(self, "addresses") + TerraformOutput(self, "notifications_ips", + value=addresses.notifications ) ``` @@ -42,4 +45,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 4aec1ba13..9a8213f0f 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -49,15 +55,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its service provider ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -93,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 5045a6657..afd3d171d 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization import DataTfeOrganization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization.DataTfeOrganization(self, "foo", + DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index 73670ef47..9ca351a93 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_bar = tfe.organization.Organization(self, "bar", + bar = Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", - organization=cdktf.Token.as_string(tfe_organization_bar.name) + DataTfeOrganizationMembers(self, "foo", + organization=bar.name ) ``` @@ -48,4 +52,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index ffbc8593d..c3a9bc3e7 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { + new DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 54c0ea219..5226e5f82 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,21 +16,20 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - installationId: 12345, - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + installationId: 12345, + }); } } @@ -39,21 +38,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding a Github App Installation by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "installation_name", - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + name: "installation_name", + }); } } @@ -72,5 +70,5 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: -* `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file +* `id` - The internal ID of the Github Installation. This is different from the `installation_id`. + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 3aef65fe1..a60d0351c 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,21 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( - this, - "addresses", - {} - ); - new cdktf.TerraformOutput(this, "notifications_ips", { - value: dataTfeIpRangesAddresses.notifications, + const addresses = new DataTfeIpRanges(this, "addresses", {}); + new TerraformOutput(this, "notifications_ips", { + value: addresses.notifications, }); } } @@ -49,4 +48,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index fd3cee123..365fbd2b7 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -35,15 +38,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -55,15 +61,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its service provider ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -83,15 +92,15 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, - `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or - `gitlabEnterpriseEdition`. + must be one of: `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, + `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or + `gitlab_enterprise_edition`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `id` - The OAuth client ID. This will match `oauthClientId`. +* `id` - The OAuth client ID. This will match `oauth_client_id`. * `apiUrl` - The client's API URL. * `callbackUrl` - OAuth callback URL to provide to the OAuth service provider. * `createdAt` - The date and time this OAuth client was created in RFC3339 format. @@ -102,4 +111,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 97f356774..71a333d7c 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { + new DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -43,9 +46,9 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. -* `collaboratorAuthPolicy` - Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. +* `collaboratorAuthPolicy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 290c8836c..b03a855ff 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { + const bar = new Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { - organization: cdktf.Token.asString(tfeOrganizationBar.name), + new DataTfeOrganizationMembers(this, "foo", { + organization: bar.name, }); } } @@ -51,4 +55,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file From dad1c79c21ce9376fa24e8c5a8d0af3f49ca27d3 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:15:32 +0000 Subject: [PATCH 092/420] cdktf: update d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown --- .../d/organization_membership.html.markdown | 47 ++++++---- .../d/organization_run_task.html.markdown | 17 ++-- .../python/d/organization_tags.html.markdown | 17 ++-- .../python/d/organizations.html.markdown | 17 ++-- .../docs/cdktf/python/d/outputs.html.markdown | 23 ++--- .../cdktf/python/d/policy_set.html.markdown | 17 ++-- .../docs/cdktf/python/d/project.html.markdown | 17 ++-- .../python/d/saml_settings.html.markdown | 42 +++++---- .../docs/cdktf/python/d/slug.html.markdown | 22 +++-- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 ++-- .../d/organization_membership.html.markdown | 89 +++++++++---------- .../d/organization_run_task.html.markdown | 31 ++++--- .../d/organization_tags.html.markdown | 21 +++-- .../typescript/d/organizations.html.markdown | 21 +++-- .../cdktf/typescript/d/outputs.html.markdown | 37 ++++---- .../typescript/d/policy_set.html.markdown | 23 ++--- .../cdktf/typescript/d/project.html.markdown | 21 +++-- .../typescript/d/saml_settings.html.markdown | 41 ++++++--- .../cdktf/typescript/d/slug.html.markdown | 26 +++--- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +++-- 20 files changed, 319 insertions(+), 248 deletions(-) diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index cc1def6d2..d43914fb2 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,15 +22,18 @@ be updated manually. ### Fetch by email ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -39,15 +42,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by username ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -56,15 +62,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by organization membership ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -89,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index 8429aa128..c906839c1 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", + DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -47,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 4fffc37f9..e2de47ed3 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", + DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -44,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index 292e9c76f..e90bf98be 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organizations import DataTfeOrganizations +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") + DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -41,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 8f6ed2dc5..461739d77 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -21,25 +21,28 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.random as random -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.random.id import Id +from imports.tfe.data_tfe_outputs import DataTfeOutputs +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. # For a more precise conversion please use the --provider flag in convert. - data_tfe_outputs_foo = tfe.data_tfe_outputs.DataTfeOutputs(self, "foo", + foo = DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) - random.id.Id(self, "vpc_id", + Id(self, "vpc_id", byte_length=8, keepers=[{ - "bar": data_tfe_outputs_foo.values.bar + "bar": foo.values.bar } ] ) @@ -59,4 +62,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 9b8aca2a9..6216ae254 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_policy_set import DataTfePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", + DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -64,4 +67,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 4a596f35f..e06865a57 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_project import DataTfeProject +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_project.DataTfeProject(self, "foo", + DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index 338f92bfc..ebbd46fa2 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,21 +16,31 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + DataTfeSamlSettings(self, "foo", + provider=admin + ) ``` ## Argument Reference @@ -64,4 +74,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 6537c5f55..b91a074be 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", + test = DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=cdktf.Token.as_string_map(data_tfe_slug_test) + slug=Token.as_string_map(test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -47,4 +51,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index e95a873b6..f6a0cff6b 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ssh_key import DataTfeSshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", + DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index a5a620a28..c251e74ab 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,22 +22,21 @@ be updated manually. ### Fetch by email ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - email: "user@company.com", - organization: "my-org-name", - } - ); + new DataTfeOrganizationMembership(this, "test", { + email: "user@company.com", + organization: "my-org-name", + }); } } @@ -46,22 +45,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by username ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - username: "my-username", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + username: "my-username", + }); } } @@ -70,22 +68,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by organization membership ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + }); } } @@ -110,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index 1ee342ef1..37bfa78a2 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,22 +16,21 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( - this, - "example", - { - name: "task-name", - organization: "my-org-name", - } - ); + new DataTfeOrganizationRunTask(this, "example", { + name: "task-name", + organization: "my-org-name", + }); } } @@ -54,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index d608cc1e3..a8c737753 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { + new DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -47,4 +50,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 31989059d..4ecf4f8b2 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); + new DataTfeOrganizations(this, "foo", {}); } } @@ -44,4 +47,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 9b23d1a90..59648bd54 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -21,30 +21,29 @@ Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as s In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as random from "./.gen/providers/random"; -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Id } from "./.gen/providers/random/id"; +import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. For a more precise conversion please use the --provider flag in convert.*/ - const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( - this, - "foo", - { - organization: "my-org", - workspace: "my-workspace", - } - ); - new random.id.Id(this, "vpc_id", { + const foo = new DataTfeOutputs(this, "foo", { + organization: "my-org", + workspace: "my-workspace", + }); + new Id(this, "vpc_id", { byte_length: 8, keepers: [ { - bar: dataTfeOutputsFoo.values.bar, + bar: foo.values.bar, }, ], }); @@ -67,4 +66,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 2a104a3c0..9cb0f5f25 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { + new DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -53,7 +56,7 @@ The following arguments are supported: * `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `projectIds` - IDs of the projects that use the policy set. * `policyIds` - IDs of the policies attached to the policy set. -* `policiesPath` - The sub-path within the attached VCS repository when using `vcsRepo`. +* `policiesPath` - The sub-path within the attached VCS repository when using `vcs_repo`. * `vcsRepo` - Settings for the workspace's VCS repository. The `vcsRepo` block contains: @@ -67,4 +70,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index 5f30b68c5..e65662563 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeProject.DataTfeProject(this, "foo", { + new DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index eac1110a0..196e0d4ec 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,21 +16,34 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new DataTfeSamlSettings(this, "foo", { + provider: admin, + }); + } } -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} ``` ## Argument Reference @@ -64,4 +77,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index af7210b06..b439d6bf2 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { + const test = new DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: cdktf.Token.asStringMap(dataTfeSlugTest), + slug: Token.asStringMap(test), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -50,4 +54,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 0d701abdd..c4b47bc18 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { + new DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file From 0ccdf930d96cead43ed717fba903a22bce924837 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:15:32 +0000 Subject: [PATCH 093/420] cdktf: update r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown,d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown --- .../docs/cdktf/python/d/team.html.markdown | 17 ++-- .../cdktf/python/d/team_access.html.markdown | 17 ++-- .../d/team_project_access.html.markdown | 17 ++-- .../docs/cdktf/python/d/teams.html.markdown | 17 ++-- .../cdktf/python/d/variable_set.html.markdown | 17 ++-- .../cdktf/python/d/variables.html.markdown | 43 +++++----- .../cdktf/python/d/workspace.html.markdown | 17 ++-- .../python/d/workspace_ids.html.markdown | 23 +++--- .../python/d/workspace_run_task.html.markdown | 17 ++-- .../r/admin_organization_settings.markdown | 74 +++++++++-------- .../cdktf/typescript/d/team.html.markdown | 21 ++--- .../typescript/d/team_access.html.markdown | 23 +++--- .../d/team_project_access.html.markdown | 21 ++--- .../cdktf/typescript/d/teams.html.markdown | 21 ++--- .../typescript/d/variable_set.html.markdown | 21 ++--- .../typescript/d/variables.html.markdown | 79 +++++++++---------- .../typescript/d/workspace.html.markdown | 25 +++--- .../typescript/d/workspace_ids.html.markdown | 29 ++++--- .../d/workspace_run_task.html.markdown | 21 ++--- .../r/admin_organization_settings.markdown | 73 +++++++++-------- 20 files changed, 329 insertions(+), 264 deletions(-) diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 3e4f2c5e4..36e3b016f 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team import DataTfeTeam +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team.DataTfeTeam(self, "test", + DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index 9755cf929..d5efb474c 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_access import DataTfeTeamAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", + DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -52,4 +55,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index 503c9eb11..b4dcd2558 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", + DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index d812caa3c..b8908216b 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_teams import DataTfeTeams +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_teams.DataTfeTeams(self, "foo", + DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -39,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 3db389fb4..b22392cd9 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -49,4 +52,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 86ecde0ac..59a64a81c 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,20 +16,24 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variables import DataTfeVariables +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + test = DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + workspace_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -38,21 +42,24 @@ class MyConvertedCode(cdktf.TerraformStack): For variable set variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +from imports.tfe.data_tfe_variables import DataTfeVariables +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_variable_set_test = - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + test = DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + variable_set_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -80,4 +87,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 50048398f..de8ddff14 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -85,4 +88,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index 31ac562e9..e4e168168 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", + DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", + DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", + DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", + DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -61,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index a278338f7..3d0a9c37a 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", + DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 09c1f631e..f7ee2700b 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,39 +17,45 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" -} - -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.admin_organization_settings import AdminOrganizationSettings +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + a_module_consumer = Organization(self, "a-module-consumer", + email="admin@company.com", + name="my-other-org" + ) + a_module_producer = Organization(self, "a-module-producer", + email="admin@company.com", + name="my-org" + ) + AdminOrganizationSettings(self, "test-settings", + access_beta_tools=False, + global_module_sharing=False, + module_sharing_consumer_organizations=[a_module_consumer.name], + organization=a_module_producer.name, + provider="${tfe.admin}", + workspace_limit=15 + ) ``` ## Argument Reference @@ -70,4 +76,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 51606205e..63e141292 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeam.DataTfeTeam(this, "test", { + new DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index 8cd9aea95..e02662e12 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { + new DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -50,9 +53,9 @@ The `permissions` block contains: * `runs` - The permission granted to runs. Valid values are `read`, `plan`, or `apply` * `variables` - The permissions granted to variables. Valid values are `none`, `read`, or `write` -* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `readOutputs`, `read`, or `write` +* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `read-outputs`, `read`, or `write` * `sentinelMocks` - The permissions granted to Sentinel mocks. Valid values are `none` or `read` * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 65ed3def9..123165f0d 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { + new DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index d19832163..0626d4bc4 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { + new DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index c5bab02a4..d2094ec92 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + new DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -52,4 +55,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 93b932f9d..932991993 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,29 +16,25 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( - this, - "test", - { - name: "my-workspace-name", - organization: "my-org-name", - } - ); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), - } - ); + const test = new DataTfeWorkspace(this, "test", { + name: "my-workspace-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + workspaceId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -49,26 +45,25 @@ class MyConvertedCode extends cdktf.TerraformStack { For variable set variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeVariableSetTest = - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), - } - ); + const test = new DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + variableSetId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -98,4 +93,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index b4332b458..fac92fae9 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { + new DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -50,8 +53,8 @@ In addition to all arguments above, the following attributes are exported: * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). -* `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). -* `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `globalRemoteState` is set to `true`. +* `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). +* `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `global_remote_state` is set to `true`. * `operations` - Indicates whether the workspace is using remote execution mode. Set to `false` to switch execution mode to local. `true` by default. * `policyCheckFailures` - The number of policy check failures from the latest run. * `projectId` - ID of the workspace's project @@ -88,4 +91,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 3f83d01b9..6d75f9837 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { + new DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { + new DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { + new DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { + new DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -52,7 +55,7 @@ The following arguments are supported. At least one of `names` or `tagNames` mus match a valid workspace will be omitted from the results, but are not an error. To select _all_ workspaces for an organization, provide a list with a single - asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*Prod]`, `[test-*]`, `[*dev*]`. + asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*-prod]`, `[test-*]`, `[*dev*]`. * `tagNames` - (Optional) A list of tag names to search for. * `excludeTags` - (Optional) A list of tag names to exclude when searching. * `organization` - (Required) Name of the organization. @@ -64,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 7aa26820c..0898bd0cb 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { + new DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -48,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 93f71e023..34ff108d6 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,39 +17,48 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + const aModuleConsumer = new Organization(this, "a-module-consumer", { + email: "admin@company.com", + name: "my-other-org", + }); + const aModuleProducer = new Organization(this, "a-module-producer", { + email: "admin@company.com", + name: "my-org", + }); + new AdminOrganizationSettings(this, "test-settings", { + accessBetaTools: false, + globalModuleSharing: false, + moduleSharingConsumerOrganizations: [aModuleConsumer.name], + organization: aModuleProducer.name, + provider: "${tfe.admin}", + workspaceLimit: 15, + }); + } } -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} ``` ## Argument Reference @@ -70,4 +79,4 @@ The following arguments are supported: This resource does not manage the creation of an organization and there is no need to import it. - \ No newline at end of file + \ No newline at end of file From 6ec87f05c41c5e6beb1f69e03d8d36144f33768b Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:15:51 +0000 Subject: [PATCH 094/420] cdktf: update r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown,r/sentinel_policy.html.markdown --- .../python/r/sentinel_policy.html.markdown | 17 +-- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +-- .../docs/cdktf/python/r/team.html.markdown | 32 +++-- .../cdktf/python/r/team_access.html.markdown | 27 ++-- .../cdktf/python/r/team_member.html.markdown | 22 ++-- .../cdktf/python/r/team_members.html.markdown | 46 ++++--- .../r/team_organization_member.html.markdown | 29 +++-- .../r/team_organization_members.html.markdown | 72 +++++------ .../r/team_project_access.html.markdown | 53 ++++---- .../cdktf/python/r/team_token.html.markdown | 48 +++++--- .../r/sentinel_policy.html.markdown | 25 ++-- .../cdktf/typescript/r/ssh_key.html.markdown | 21 ++-- .../cdktf/typescript/r/team.html.markdown | 44 ++++--- .../typescript/r/team_access.html.markdown | 33 ++--- .../typescript/r/team_member.html.markdown | 26 ++-- .../typescript/r/team_members.html.markdown | 54 ++++---- .../r/team_organization_member.html.markdown | 47 +++---- .../r/team_organization_members.html.markdown | 115 +++++++++--------- .../r/team_project_access.html.markdown | 65 +++++----- .../typescript/r/team_token.html.markdown | 56 +++++---- 20 files changed, 477 insertions(+), 372 deletions(-) diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index 73d0ed16c..ace6e7320 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.sentinel_policy import SentinelPolicy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.sentinel_policy.SentinelPolicy(self, "test", + SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 177974c7f..050d1c8e4 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.ssh_key import SshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.ssh_key.SshKey(self, "test", + SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -49,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index bec6f6a88..b3a650bed 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -33,15 +36,18 @@ class MyConvertedCode(cdktf.TerraformStack): Organization Permission usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -91,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index ab50b1a2d..4d4ccba8c 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_access import TeamAccess +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", + tfe_team_access_test = TeamAccess(self, "test_2", access="read", - team_id=cdktf.Token.as_string(tfe_team_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + team_id=test.id, + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -77,4 +82,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index e146c6558..cb2bb3b22 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_member import TeamMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_member_test = TeamMember(self, "test_1", + team_id=test.id, username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -61,4 +65,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 697cfe48b..64bae9350 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -48,22 +52,26 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of usernames: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_usernames = cdktf.Fn.toset(["user1", "user2"]) - tfe_team_test = tfe.team.Team(self, "test", + all_usernames = Fn.toset(["user1", "user2"]) + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), - usernames=cdktf.Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, + usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_members_test.override_logical_id("test") @@ -88,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 5353364f6..f82bf0b69 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,29 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_member import TeamOrganizationMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_1", + tfe_team_test = Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = - tfe.team_organization_member.TeamOrganizationMember(self, "test_2", - organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", + organization_membership_id=test.id, + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -72,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 04ced9cca..bd6119e0e 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,37 +24,36 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_sample = - tfe.organization_membership.OrganizationMembership(self, "sample", + sample = OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_2", + tfe_team_test = Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.id), - cdktf.Token.as_string(tfe_organization_membership_sample.id) - ], - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[test.id, sample.id], + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -63,35 +62,38 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of organization members: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" - ]) + all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - tfe_organization_membership_all_membership_for_each_iterator = - cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) - tfe.organization_membership.OrganizationMembership(self, "all_membership", - email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), + all_membership_for_each_iterator = TerraformIterator.from_list( + Token.as_any(all_users)) + OrganizationMembership(self, "all_membership", + email=Token.as_string(all_membership_for_each_iterator.key), organization="my-org-name", - for_each=tfe_organization_membership_all_membership_for_each_iterator + for_each=all_membership_for_each_iterator ) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", - organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", + organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -113,4 +115,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index c731f4db5..1da65f94b 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,27 +16,31 @@ Associate a team to permissions on a project. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_admin = tfe.team.Team(self, "admin", + admin = Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = - tfe.team_project_access.TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", access="admin", - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_admin.id) + project_id=test.id, + team_id=admin.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -84,31 +88,36 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_dev = tfe.team.Team(self, "dev", + dev = Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - tfe.team_project_access.TeamProjectAccess(self, "custom", + TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_dev.id), + project_id=test.id, + team_id=dev.id, workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -137,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index 4c90cfbb8..da179f43c 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_token_test = TeamToken(self, "test_1", + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -52,27 +56,31 @@ never expire. When a token has an expiry: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -import ...gen.providers.time as time -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. # For a more precise conversion please use the --provider flag in convert. - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - time_rotating_example = time.rotating.Rotating(self, "example", + example = Rotating(self, "example", rotation_days=30 ) - tfe_team_token_test = tfe.team_token.TeamToken(self, "test_2", - expired_at=cdktf.Token.as_string(time_rotating_example.rotation_rfc3339), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_token_test = TeamToken(self, "test_2", + expired_at=Token.as_string(example.rotation_rfc3339), + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -91,4 +99,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 206276ff4..441c9e7d2 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sentinelPolicy.SentinelPolicy(this, "test", { + new SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -50,8 +53,8 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values are `advisory`, `hardMandatory` and `softMandatory`. Defaults - to `softMandatory`. + values are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults + to `soft-mandatory`. ## Attributes Reference @@ -66,4 +69,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 90680d24c..77b9e12b5 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SshKey } from "./.gen/providers/tfe/ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sshKey.SshKey(this, "test", { + new SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -52,4 +55,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index b793d408b..6a6b76659 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -36,15 +39,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Organization Permission usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -69,7 +75,7 @@ The following arguments are supported: The `organizationAccess` block supports: * `readWorkspaces` - (Optional) Allow members to view all workspaces in this organization. -* `readProjects` - (Optional) Allow members to view all projects within the organization. Requires `readWorkspaces` to be set to `true`. +* `readProjects` - (Optional) Allow members to view all projects within the organization. Requires `read_workspaces` to be set to `true`. * `managePolicies` - (Optional) Allows members to create, edit, and delete the organization's Sentinel policies. * `managePolicyOverrides` - (Optional) Allows members to override soft-mandatory policy checks. * `manageWorkspaces` - (Optional) Allows members to create and administrate all workspaces within the organization. @@ -77,7 +83,7 @@ The `organizationAccess` block supports: * `manageProviders` - (Optional) Allow members to publish and delete providers in the organization's private registry. * `manageModules` - (Optional) Allow members to publish and delete modules in the organization's private registry. * `manageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. -* `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manageWorkspaces` to be set to `true`. +* `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manage_workspaces` to be set to `true`. * `manageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. ## Attributes Reference @@ -97,4 +103,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 8af746faa..df127a57e 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamAccess } from "./.gen/providers/tfe/team-access"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new TeamAccess(this, "test_2", { access: "read", - teamId: cdktf.Token.asString(tfeTeamTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + teamId: test.id, + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -59,7 +64,7 @@ The `permissions` block supports: * `runs` - (Required) The permission to grant the team on the workspace's runs. Valid values are `read`, `plan`, or `apply`. * `variables` - (Required) The permission to grant the team on the workspace's variables. Valid values are `none`, `read`, or `write`. -* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `readOutputs`, or `write`. +* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `read-outputs`, or `write`. * `sentinelMocks` - (Required) The permission to grant the team on the workspace's generated Sentinel mocks, Valid values are `none` or `read`. * `workspaceLocking` - (Required) Boolean determining whether or not to grant the team permission to manually lock/unlock the workspace. * `runTasks` - (Required) Boolean determining whether or not to grant the team permission to manage workspace run tasks. @@ -80,4 +85,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index eb7cf719c..de7629028 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMember } from "./.gen/providers/tfe/team-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMemberTest = new TeamMember(this, "test_1", { + teamId: test.id, username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -64,4 +68,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 5ca27b059..7934b1ac2 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -51,22 +55,26 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of usernames: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const allUsernames = cdktf.Fn.toset(["user1", "user2"]); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const allUsernames = Fn.toset(["user1", "user2"]); + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), - usernames: cdktf.Token.asList( + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, + usernames: Token.asList( "${[ for user in ${" + allUsernames + "} : user]}" ), }); @@ -96,4 +104,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 1eec91879..ef8edbd8c 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,32 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_1", { + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = - new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { - organizationMembershipId: cdktf.Token.asString( - tfeOrganizationMembershipTest.id - ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( + this, + "test_2", + { + organizationMembershipId: test.id, + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -77,4 +82,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index ba1476eec..c6ade2d68 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,38 +24,41 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipSample = - new tfe.organizationMembership.OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_2", { + const sample = new OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { - organizationMembershipIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.id), - cdktf.Token.asString(tfeOrganizationMembershipSample.id), - ], - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_3", + { + organizationMembershipIds: [test.id, sample.id], + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -66,48 +69,48 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of organization members: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const allUsers = cdktf.Fn.toset([ - "user1@hashicorp.com", - "user2@hashicorp.com", - ]); + const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const tfeOrganizationMembershipAllMembershipForEachIterator = - cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); - new tfe.organizationMembership.OrganizationMembership( - this, - "all_membership", - { - email: cdktf.Token.asString( - tfeOrganizationMembershipAllMembershipForEachIterator.key - ), - organization: "my-org-name", - forEach: tfeOrganizationMembershipAllMembershipForEachIterator, - } + const allMembershipForEachIterator = TerraformIterator.fromList( + Token.asAny(allUsers) ); - const tfeTeamTest = new tfe.team.Team(this, "test", { + new OrganizationMembership(this, "all_membership", { + email: Token.asString(allMembershipForEachIterator.key), + organization: "my-org-name", + forEach: allMembershipForEachIterator, + }); + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { - organizationMembershipIds: cdktf.Token.asList( + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_2", + { + organizationMembershipIds: Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + teamId: test.id, + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -131,4 +134,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index db12e574d..961db963a 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,28 +16,32 @@ Associate a team to permissions on a project. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamAdmin = new tfe.team.Team(this, "admin", { + const admin = new Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = - new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamAdmin.id), - }); + const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: test.id, + teamId: admin.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -87,23 +91,28 @@ The following permissions apply to all workpsaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamDev = new tfe.team.Team(this, "dev", { + const dev = new Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { + new TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -111,8 +120,8 @@ class MyConvertedCode extends cdktf.TerraformStack { teams: "none", }, ], - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamDev.id), + projectId: test.id, + teamId: dev.id, workspaceAccess: [ { create: true, @@ -145,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index f450192af..a7d0f6fec 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_1", { + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -55,27 +59,31 @@ never expire. When a token has an expiry: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -import * as time from "./.gen/providers/time"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const timeRotatingExample = new time.rotating.Rotating(this, "example", { + const example = new Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { - expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_2", { + expiredAt: Token.asString(example.rotationRfc3339), + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -97,4 +105,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file From c50aa8e81374c56db93c5d4243617b7ab5cbc12a Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:15:53 +0000 Subject: [PATCH 095/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown --- website/docs/cdktf/python/index.html.markdown | 49 +++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 ++++++----- .../cdktf/python/r/variable_set.html.markdown | 115 +++++----- .../cdktf/python/r/workspace.html.markdown | 49 +++-- .../r/workspace_policy_set.html.markdown | 35 ++-- ...rkspace_policy_set_exclusion.html.markdown | 35 ++-- .../python/r/workspace_run.html.markdown | 110 ++++++---- .../python/r/workspace_run_task.html.markdown | 25 ++- .../r/workspace_variable_set.html.markdown | 35 ++-- .../docs/cdktf/typescript/index.html.markdown | 63 ++++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 149 +++++++------ .../typescript/r/variable_set.html.markdown | 165 ++++++++------- .../typescript/r/workspace.html.markdown | 107 +++++----- .../r/workspace_policy_set.html.markdown | 51 ++--- ...rkspace_policy_set_exclusion.html.markdown | 59 +++--- .../typescript/r/workspace_run.html.markdown | 196 +++++++++--------- .../r/workspace_run_task.html.markdown | 28 ++- .../r/workspace_variable_set.html.markdown | 55 ++--- 20 files changed, 822 insertions(+), 660 deletions(-) diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index b2c222f1a..6262f883f 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,14 +73,13 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.50.0" - } - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) ``` As this provider is still at version zero, you should constrain the acceptable @@ -99,17 +98,27 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` - token = var.token - version = "~> 0.50.0" -} - -# Create an organization -resource "tfe_organization" "org" { - # ... -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, email, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + Organization(self, "org", + email=email, + name=name + ) ``` ## Argument Reference @@ -129,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 5d19d8f3e..be02b4e5c 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.terraform_version import TerraformVersion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.terraform_version.TerraformVersion(self, "test", + TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -62,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index a32fa5e33..19ff3fc86 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,30 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = tfe.variable.Variable(self, "test_2", + tfe_variable_test = Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -48,39 +53,44 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for variable sets: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -119,33 +129,41 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" -} - +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + sensitive_var = Variable(self, "sensitive_var", + category="terraform", + key="sensitive_key", + sensitive=True, + value="sensitive_value", + workspace_id=workspace.id + ) + visible_var = Variable(self, "visible_var", + category="terraform", + key="visible_key", + sensitive=False, + value="visible_value", + workspace_id=workspace.id + ) + Workspace(self, "sensitive_workspace", + name="workspace-${" + sensitive_var.value + "}", + organization="organization name" + ) + Workspace(self, "visible_workspace", + name="workspace-${" + visible_var.readable_value + "}", + organization="organization name" + ) ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -171,4 +189,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index 524373524..735cf96bb 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,142 +16,159 @@ Creates, updates and destroys variable sets. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", + tfe_workspace_test = Workspace(self, "test_3", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_5", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` Create a priority variable set: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Variable set applied to all workspaces.", name="Global Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name), + organization=test.name, priority=True ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -181,4 +198,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 6fc069904..1a53aff00 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -18,21 +18,25 @@ Provides a workspace resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.workspace.Workspace(self, "test", + Workspace(self, "test", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, tag_names=["test", "app"] ) ``` @@ -40,27 +44,32 @@ class MyConvertedCode(cdktf.TerraformStack): With `execution_mode` of `agent`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe.workspace.Workspace(self, "test", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + Workspace(self, "test", + agent_pool_id=test_agent_pool.id, execution_mode="agent", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) ``` @@ -175,4 +184,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 733784218..4fc68bd52 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set import WorkspacePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = - tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 5f052b546..4cb65ee3e 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = - tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -71,4 +76,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index e79741bc7..ec7373c95 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,46 +24,52 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_child = tfe.workspace.Workspace(self, "child", + child = Workspace(self, "child", name="child-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + ws_run_parent = WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -76,58 +82,64 @@ class MyConvertedCode(cdktf.TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_child", + WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[tfe_workspace_run_ws_run_parent], + depends_on=[ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) + workspace_id=child.id ) ``` With manual confirmation: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -135,43 +147,49 @@ class MyConvertedCode(cdktf.TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` With no retries: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -181,7 +199,7 @@ class MyConvertedCode(cdktf.TerraformStack): retry=False, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` @@ -210,4 +228,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 450d01813..cffdb1f71 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,12 +17,23 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.workspace_run_task import WorkspaceRunTask +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + WorkspaceRunTask(self, "example", + enforcement_level="advisory", + task_id=tfe_organization_run_task.example.id, + workspace_id=tfe_workspace.example.id + ) ``` ## Argument Reference @@ -47,4 +58,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index de6cad570..a3c2bb050 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index a6579445d..b2f3505e3 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -44,7 +44,7 @@ There are several ways to provide the required token: the `token` argument in the provider configuration. Use an input variable for the token. - **Set the `tfeToken` environment variable:** The provider can read the -`tfeToken` environment variable and the token stored there to authenticate. +`TFE_TOKEN` environment variable and the token stored there to authenticate. When configuring the input variable for either of these options, mark them as sensitive. @@ -62,9 +62,9 @@ Terraform on your local command line, it can automatically discover the credenti [`terraform login`](https://developer.hashicorp.com/terraform/cli/commands/login). - **Set a `credentials` block in your CLI config file (.terraformrc):** See the [CLI Configuration File documentation](/docs/commands/cli-config.html). -If you used the `tfCliConfigFile` environment variable to specify a +If you used the `TF_CLI_CONFIG_FILE` environment variable to specify a non-default location for .terraformrc, the provider will also use that location. -Using a `credentialsHelper` block is not supported. +Using a `credentials_helper` block is not supported. ## Versions @@ -73,14 +73,16 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.50.0" - } +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); } } + ``` As this provider is still at version zero, you should constrain the acceptable @@ -99,17 +101,34 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` - token = var.token - version = "~> 0.50.0" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +interface MyConfig { + email: any; + name: any; } - -# Create an organization -resource "tfe_organization" "org" { - # ... +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + new Organization(this, "org", { + email: config.email, + name: config.name, + }); + } } + ``` ## Argument Reference @@ -118,15 +137,15 @@ The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the - `tfeHostname` environment variable. + `TFE_HOSTNAME` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. - Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` + Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` environment variable. * `organization` - (Optional) The default organization that resources should belong to. If provided, it's usually possible to omit resource-specific `organization` arguments. Ensure that the organization already exists prior to using this argument. - This can also be specified using the `tfeOrganization` environment variable. + This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index f122ae910..efc291025 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.terraformVersion.TerraformVersion(this, "test", { + new TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -65,4 +68,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 1d442d61a..2457a5939 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,34 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { + const tfeVariableTest = new Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -55,43 +56,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for variable sets: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -112,8 +114,8 @@ The following arguments are supported: * `sensitive` - (Optional) Whether the value is sensitive. If true then the variable is written once and not visible thereafter. Defaults to `false`. * One of the following (Required) - * `workspaceId` - ID of the workspace that owns the variable. - * `variableSetId` - ID of the variable set that owns the variable. + * `workspace_id` - ID of the workspace that owns the variable. + * `variable_set_id` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair drift if `value` is later changed out-of-band via the Terraform Cloud UI. @@ -133,31 +135,42 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const sensitiveVar = new Variable(this, "sensitive_var", { + category: "terraform", + key: "sensitive_key", + sensitive: true, + value: "sensitive_value", + workspaceId: workspace.id, + }); + const visibleVar = new Variable(this, "visible_var", { + category: "terraform", + key: "visible_key", + sensitive: false, + value: "visible_value", + workspaceId: workspace.id, + }); + new Workspace(this, "sensitive_workspace", { + name: "workspace-${" + sensitiveVar.value + "}", + organization: "organization name", + }); + new Workspace(this, "visible_workspace", { + name: "workspace-${" + visibleVar.readableValue + "}", + organization: "organization name", + }); + } } ``` @@ -185,4 +198,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index ceb0d3f23..bf194a7a7 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,68 +16,75 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeProjectTest = new tfe.project.Project(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { + const tfeVariableSetTest = new VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { + const tfeWorkspaceTest = new Workspace(this, "test_3", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_4", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = - new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { - projectId: cdktf.Token.asString(tfeProjectTest.id), - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -87,43 +94,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a global variable set: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -133,43 +141,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Create a priority variable set: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", name: "Global Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, priority: true, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -202,4 +211,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 18a00183b..0c338f0cb 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -18,25 +18,25 @@ Provides a workspace resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.workspace.Workspace(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Workspace(this, "test", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, tagNames: ["test", "app"], }); } @@ -47,37 +47,32 @@ class MyConvertedCode extends cdktf.TerraformStack { With `executionMode` of `agent`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - } - ); - new tfe.workspace.Workspace(this, "test", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + }); + new Workspace(this, "test", { + agentPoolId: testAgentPool.id, executionMode: "agent", name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); } } @@ -89,8 +84,8 @@ class MyConvertedCode extends cdktf.TerraformStack { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` - to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value or if `operations` is +* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` + to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is provided. * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. @@ -108,10 +103,10 @@ The following arguments are supported: 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. * `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. -* `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remoteStateConsumerIds`). +* `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remote_state_consumer_ids`). * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for - state storage only. This value _must not_ be provided if `executionMode` is + state storage only. This value _must not_ be provided if `execution_mode` is provided. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `projectId` - (Optional) ID of the project where the workspace should be created. @@ -127,11 +122,11 @@ The following arguments are supported: * `sourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". - Requires `sourceUrl` to also be set. + Requires `source_url` to also be set. * `sourceUrl` - (Optional) A URL for the application or client creating this workspace. This can be the URL of a related resource in another app, or a link to documentation or other info about the client. - Requires `sourceName` to also be set. + Requires `source_name` to also be set. **Note:** The API does not (currently) allow this to be updated after a workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument @@ -152,7 +147,7 @@ The following arguments are supported: (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). @@ -167,12 +162,12 @@ The `vcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. - This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. -* `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. + This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. +* `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `trigger_patterns` and `trigger_prefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -195,4 +190,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index 08afbc792..f874166cb 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -18,40 +18,41 @@ Adds and removes policy sets from a workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = - new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -78,4 +79,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 2bca759b3..6ce27ecbe 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -18,44 +18,45 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = - new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -82,4 +83,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index f1875dbe2..4e90a1e2c 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -14,8 +14,8 @@ Provides a resource to manage the _initial_ and/or _final_ Terraform run in a gi There are a few main use cases this resource was designed for: - **Workspaces that depend on other workspaces.** If a workspace will create infrastructure that other workspaces rely on (for example, a Kubernetes cluster to deploy resources into), those downstream workspaces can depend on an initial `apply` with `wait_for_run = true`, so they aren't created before their infrastructure dependencies. -- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfeWorkspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfeVariable` resources themselves depend on the `tfeWorkspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfeVariables`, you can accomplish the same goal without a circular dependency. -- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfeWorkspace` resource's default safe deletion behavior. +- **A more reliable `queue_all_runs = true`.** The `queue_all_runs` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. +- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfe_workspace` resource's default safe deletion behavior. The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfeWorkspaceRun` resource that includes an `apply` block will queue a new apply when added to a config. @@ -24,82 +24,80 @@ The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or Basic usage with multiple workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { + const child = new Workspace(this, "child", { name: "child-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, + }, + }); + const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: parent.id, }); - const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( - this, - "ws_run_parent", - { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, - }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), - } - ); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { + new WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [tfeWorkspaceRunWsRunParent], + dependsOn: [wsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), + workspaceId: child.id, }); } } @@ -109,40 +107,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With manual confirmation: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends cdktf.TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -160,40 +160,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With no retries: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -203,7 +205,7 @@ class MyConvertedCode extends cdktf.TerraformStack { retry: false, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -221,18 +223,18 @@ The following arguments are supported: Both `apply` and `destroy` block supports: * `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. - * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. - * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfeWorkspace` data source. -* `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. + * If `wait_for_run` is set to `false`, this auto-apply will be done by Terraform Cloud. + * If `wait_for_run` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manual_confirm` is set to false. + * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `auto_apply` with the `tfe_workspace` data source. +* `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retry_attempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. * `retryAttempts` - (Optional) The number to retry attempts made after an initial error. Defaults to `3`. * `retryBackoffMin` - (Optional) The minimum time in seconds to backoff before attempting a retry. Defaults to `1`. * `retryBackoffMax` - (Optional) The maximum time in seconds to backoff before attempting a retry. Defaults to `30`. -* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfeWorkspaceRun` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. +* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfe_workspace_run` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 2af33a4b9..914408037 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,12 +17,26 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new WorkspaceRunTask(this, "example", { + enforcementLevel: "advisory", + taskId: tfeOrganizationRunTask.example.id, + workspaceId: tfeWorkspace.example.id, + }); + } } + ``` ## Argument Reference @@ -32,7 +46,7 @@ The following arguments are supported: * `enforcementLevel` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`. * `taskId` - (Required) The id of the Run task to associate to the Workspace. * `workspaceId` - (Required) The id of the workspace to associate the Run task to. -* `stage` - (Optional) The stage to run the task in. Valid values are `prePlan`, `postPlan`, and `preApply`. +* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`. ## Attributes Reference @@ -47,4 +61,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 946d0f324..41030bb00 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -18,40 +18,45 @@ Adds and removes variable sets from a workspace Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_3", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -78,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 0dfb6a39b0b9231b1c0e8917764320d7f06b8831 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:16:34 +0000 Subject: [PATCH 096/420] cdktf: update r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown,r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown --- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 36 +-- .../cdktf/python/r/agent_token.html.markdown | 27 ++- .../python/r/no_code_module.html.markdown | 56 +++-- .../notification_configuration.html.markdown | 96 ++++---- .../cdktf/python/r/oauth_client.html.markdown | 47 ++-- .../cdktf/python/r/organization.html.markdown | 17 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 78 +++--- .../typescript/r/agent_token.html.markdown | 49 ++-- .../typescript/r/no_code_module.html.markdown | 140 +++++------ .../notification_configuration.html.markdown | 224 +++++++++--------- .../typescript/r/oauth_client.html.markdown | 77 +++--- .../typescript/r/organization.html.markdown | 23 +- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 21 +- .../r/organization_run_task.html.markdown | 21 +- 20 files changed, 543 insertions(+), 499 deletions(-) diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index 7f5d6afd1..458b24d29 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,21 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.agent_pool.AgentPool(self, "test-agent-pool", + AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, organization_scoped=True ) ``` @@ -63,4 +67,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index d993f5b18..237093a42 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -20,32 +20,36 @@ for Business account. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", + test_workspace = Workspace(self, "test-workspace", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, organization_scoped=False ) - tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), - allowed_workspace_ids=[ - cdktf.Token.as_string(tfe_workspace_test_workspace.id) - ] + AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", + agent_pool_id=test_agent_pool.id, + allowed_workspace_ids=[test_workspace.id] ) ``` @@ -66,4 +70,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 7cc7972c4..c90ab3ff6 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,24 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_token import AgentToken +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.agent_token.AgentToken(self, "test-agent-token", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + AgentToken(self, "test-agent-token", + agent_pool_id=test_agent_pool.id, description="my-agent-token-name" ) ``` @@ -52,4 +57,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 797abcd7c..5fc9a1cfd 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,28 +16,33 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -46,28 +51,33 @@ class MyConvertedCode(cdktf.TerraformStack): Creating a no-code module with variable options: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -109,4 +119,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index d84e282c3..c9cc66db1 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,32 +19,36 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -53,41 +57,43 @@ class MyConvertedCode(cdktf.TerraformStack): With `destination_type` of `email`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -96,43 +102,45 @@ class MyConvertedCode(cdktf.TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -180,4 +188,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index f739902ae..cd9234004 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -44,15 +47,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -71,15 +77,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -121,4 +130,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index f32912a93..f4727dc30 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization.Organization(self, "test", + Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -61,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 1582dadb2..17610f185 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_membership.OrganizationMembership(self, "test", + OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -66,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 492a62139..80126fa0e 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,15 +19,18 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_module_sharing import OrganizationModuleSharing +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", + OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -40,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 535677464..cf07b9620 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_run_task import OrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_run_task.OrganizationRunTask(self, "example", + OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -60,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 40f488f24..08b7f09a0 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.agentPool.AgentPool(this, "test-agent-pool", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index ae669f287..053a639d7 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -20,53 +20,37 @@ for Business account. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( - this, - "test-workspace", - { - name: "my-workspace-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - organizationScoped: false, - } - ); - new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( - this, - "test-allowed-workspaces", - { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), - allowedWorkspaceIds: [ - cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), - ], - } - ); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testWorkspace = new Workspace(this, "test-workspace", { + name: "my-workspace-name", + organization: testOrganization.name, + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + organizationScoped: false, + }); + new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", { + agentPoolId: testAgentPool.id, + allowedWorkspaceIds: [testWorkspace.id], + }); } } @@ -89,4 +73,4 @@ terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index e37e6da4d..90019bba1 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,32 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentToken } from "./.gen/providers/tfe/agent-token"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.agentToken.AgentToken(this, "test-agent-token", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.id, + }); + new AgentToken(this, "test-agent-token", { + agentPoolId: testAgentPool.id, description: "my-agent-token-name", }); } @@ -63,4 +60,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index f740a6434..3640b4c11 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,41 +16,34 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -61,53 +54,46 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a no-code module with variable options: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -141,4 +127,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 81ee6208b..c35020939 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_2", - { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,50 +64,52 @@ class MyConvertedCode extends cdktf.TerraformStack { With `destinationType` of `email`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -118,55 +120,57 @@ class MyConvertedCode extends cdktf.TerraformStack { (**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -184,23 +188,23 @@ The following arguments are supported: * `generic` * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later * `slack` - * `microsoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value - _must not_ be provided if `destinationType` is `generic`, `microsoftTeams`, or `slack`. + _must not_ be provided if `destination_type` is `generic`, `microsoft-teams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided - if `destinationType` is `generic`, `microsoftTeams`, or `slack`. + if `destination_type` is `generic`, `microsoft-teams`, or `slack`. * `enabled` - (Optional) Whether the notification configuration should be enabled or not. Disabled configurations will not send any notifications. Defaults to `false`. * `token` - (Optional) A write-only secure token for the notification configuration, which can be used by the receiving server to verify request authenticity when configured for notification configurations with a destination type of `generic`. Defaults to `null`. - This value _must not_ be provided if `destinationType` is `email`, `microsoftTeams`, or `slack`. + This value _must not_ be provided if `destination_type` is `email`, `microsoft-teams`, or `slack`. * `triggers` - (Optional) The array of triggers for which this notification configuration will - send notifications. Valid values are `run:created`, `run:planning`, `run:needsAttention`, `run:applying` - `run:completed`, `run:errored`, `assessment:checkFailure`, `assessment:drifted`, or `assessment:failed`. + send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` + `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, or `assessment:failed`. If omitted, no notification triggers are configured. -* `url` - (Required if `destinationType` is `generic`, `microsoftTeams`, or `slack`) The HTTP or HTTPS URL of the notification - configuration where notification requests will be made. This value _must not_ be provided if `destinationType` +* `url` - (Required if `destination_type` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification + configuration where notification requests will be made. This value _must not_ be provided if `destination_type` is `email`. * `workspaceId` - (Required) The id of the workspace that owns the notification configuration. @@ -216,4 +220,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index da2e6cca5..33f1db35a 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -47,15 +50,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -78,15 +84,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -107,30 +116,30 @@ class MyConvertedCode extends cdktf.TerraformStack { The following arguments are supported: -* `name` - (Optional) Display name for the OAuth Client. Defaults to the `serviceProvider` if not supplied. +* `name` - (Optional) Display name for the OAuth Client. Defaults to the `service_provider` if not supplied. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `apiUrl` - (Required) The base URL of your VCS provider's API (e.g. - `https://apiGithubCom` or `https://gheExampleCom/api/v3`). + `https://api.github.com` or `https://ghe.example.com/api/v3`). * `httpUrl` - (Required) The homepage of your VCS provider (e.g. - `https://githubCom` or `https://gheExampleCom`). -* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghpXxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. -* `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account + `https://github.com` or `https://ghe.example.com`). +* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghp_xxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. +* `privateKey` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the +* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for BitBucket Server, this secret is the the text of the SSH private key associated with your BitBucket Server Application Link. -* `rsaPublicKey` - (Required for `bitbucketServer`) Required for BitBucket +* `rsaPublicKey` - (Required for `bitbucket_server`) Required for BitBucket Server in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your BitBucket Server Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, `github`, `githubEnterprise`, `gitlabHosted`, - `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. + options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, + `gitlab_community_edition`, or `gitlab_enterprise_edition`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index cbaab56b4..7e3244e1d 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organization.Organization(this, "test", { + new Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -44,7 +47,7 @@ The following arguments are supported: * `sessionRememberMinutes` - (Optional) Session expiration. Defaults to `20160`. * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` - or `twoFactorMandatory`). Defaults to `password`. + or `two_factor_mandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. @@ -64,4 +67,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 1ba96fccd..b856b2207 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationMembership.OrganizationMembership(this, "test", { + new OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -69,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 7a8d6f4bc..729b78ded 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -19,15 +19,18 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { + new OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -43,4 +46,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index af88749b5..e3d825a1d 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationRunTask.OrganizationRunTask(this, "example", { + new OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file From c25f4dd55c3cde2dc865196ee278b2c88116ec4f Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 13 Nov 2023 00:16:42 +0000 Subject: [PATCH 097/420] cdktf: update r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_module.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown --- .../python/r/organization_token.html.markdown | 48 ++-- .../docs/cdktf/python/r/policy.html.markdown | 32 ++- .../cdktf/python/r/policy_set.html.markdown | 113 +++++--- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 34 ++- .../r/project_variable_set.html.markdown | 35 ++- .../python/r/registry_module.html.markdown | 121 +++++---- .../cdktf/python/r/run_trigger.html.markdown | 33 ++- .../python/r/saml_settings.html.markdown | 35 ++- .../r/organization_token.html.markdown | 51 ++-- .../cdktf/typescript/r/policy.html.markdown | 44 +-- .../typescript/r/policy_set.html.markdown | 132 +++++---- .../r/policy_set_parameter.html.markdown | 48 ++-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 54 ++-- .../r/project_variable_set.html.markdown | 51 ++-- .../r/registry_module.html.markdown | 257 ++++++++---------- .../typescript/r/run_trigger.html.markdown | 63 ++--- .../typescript/r/saml_settings.html.markdown | 38 ++- 20 files changed, 718 insertions(+), 557 deletions(-) diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 66f833f7b..39b73ec33 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_token import OrganizationToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_token.OrganizationToken(self, "test", + OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -46,15 +49,28 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 -} - -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization_token import OrganizationToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + # For a more precise conversion please use the --provider flag in convert. + example = Rotating(self, "example", + rotation_days=30 + ) + OrganizationToken(self, "test", + expired_at=Token.as_string(example.rotation_rfc3339), + organization=Token.as_string(org.name) + ) ``` ## Attributes Reference @@ -71,4 +87,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 5da71d87c..ec98263bb 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -42,15 +45,18 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -91,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 421c6b526..8015eced1 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,54 +21,85 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policies_path="policies/my-policy-set", + vcs_repo=PolicySetVcsRepo( + branch="main", + identifier="my-org-name/my-policy-set-repository", + ingress_submodules=False, + oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) + ), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" -} - -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataTfeSlug(self, "test", + source_path="policies/my-policy-set" + ) + tfe_policy_set_test = PolicySet(self, "test_1", + description="A brand new policy set", + name="my-policy-set", + organization="my-org-name", + slug=Token.as_string_map(test), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_policy_set_test.override_logical_id("test") ``` ## Argument Reference @@ -128,4 +159,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 9758004e6..9ce7997d8 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,28 +16,32 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.policy_set_parameter import PolicySetParameter +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = - tfe.policy_set_parameter.PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + policy_set_id=Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -69,4 +73,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 0763e2626..06f793b80 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,21 +16,25 @@ Provides a project resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.project.Project(self, "test", + Project(self, "test", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) ``` @@ -55,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index f3a5cd235..1a92fbed9 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -16,34 +16,40 @@ Adds and removes policy sets from a project Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.project import Project +from imports.tfe.project_policy_set import ProjectPolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_project_test = tfe.project.Project(self, "test_2", + tfe_project_test = Project(self, "test_2", name="my-project-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = tfe.project_policy_set.ProjectPolicySet(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - project_id=cdktf.Token.as_string(tfe_project_test.id) + tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + project_id=Token.as_string(tfe_project_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_policy_set_test.override_logical_id("test") @@ -68,4 +74,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index da5561bc7..8160d98b9 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,35 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="my-project-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_3", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -69,4 +74,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index d73e2216d..ce18cb42c 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,30 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", + test_oauth_client = OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, service_provider="github" ) - tfe.registry_module.RegistryModule(self, "test-registry-module", + RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) + oauth_token_id=test_oauth_client.oauth_token_id ) ) ``` @@ -47,27 +52,31 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module with GitHub App: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - data_tfe_github_app_installation_gha_installation = - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - tfe.registry_module.RegistryModule(self, "petstore", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + RegistryModule(self, "petstore", + organization=test_organization.name, vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), + github_app_installation_id=Token.as_string(gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -76,22 +85,26 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module without VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-private-registry-module", + RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="private" ) ``` @@ -99,23 +112,27 @@ class MyConvertedCode(cdktf.TerraformStack): Create public registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-public-registry-module", + RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) ``` @@ -123,29 +140,33 @@ class MyConvertedCode(cdktf.TerraformStack): Create no-code provisioning registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_test_no_code_provisioning_registry_module = - tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", + test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) - tfe.no_code_module.NoCodeModule(self, "foobar", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) + NoCodeModule(self, "foobar", + organization=test_organization.id, + registry_module=test_no_code_provisioning_registry_module.id ) ``` @@ -197,4 +218,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index f4dd3b56c..b70959254 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,29 +19,34 @@ to up to 20 source workspaces. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.run_trigger import RunTrigger +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", + test_sourceable = Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", + test_workspace = Workspace(self, "test-workspace", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.run_trigger.RunTrigger(self, "test", - sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) + RunTrigger(self, "test", + sourceable_id=test_sourceable.id, + workspace_id=test_workspace.id ) ``` @@ -65,4 +70,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index 0fa49386c..d234e5728 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,17 +15,28 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.provider import TfeProvider +from imports.tfe.saml_settings import SamlSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=admin_token.string_value + ) + SamlSettings(self, "this", + idp_cert="foobarCertificate", + slo_endpoint_url="https://example.com/slo_endpoint_url", + sso_endpoint_url="https://example.com/sso_endpoint_url" + ) ``` ## Argument Reference @@ -64,4 +75,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 13d4d4730..5ea6633b5 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationToken.OrganizationToken(this, "test", { + new OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -49,15 +52,31 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new Rotating(this, "example", { + rotation_days: 30, + }); + new OrganizationToken(this, "test", { + expiredAt: Token.asString(example.rotationRfc3339), + organization: Token.asString(org.name), + }); + } } -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} ``` ## Attributes Reference @@ -74,4 +93,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index d99b59da7..12636f4bb 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -45,15 +48,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -80,8 +86,8 @@ The following arguments are supported: needs to run within your Rego code. Required for all OPA policies. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values for Sentinel are `advisory`, `hardMandatory` and `softMandatory`. Defaults - to `softMandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults + values for Sentinel are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults + to `soft-mandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults to `advisory`. ## Attributes Reference @@ -97,4 +103,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 8d382fa79..f00890aa5 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,54 +21,94 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policiesPath: "policies/my-policy-set", + vcsRepo: { + branch: "main", + identifier: "my-org-name/my-policy-set-repository", + ingressSubmodules: false, + oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), + }, + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); } } + ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policyIds: [Token.asString(tfeSentinelPolicyTest.id)], + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + } } + ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataTfeSlug(this, "test", { + sourcePath: "policies/my-policy-set", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { + description: "A brand new policy set", + name: "my-policy-set", + organization: "my-org-name", + slug: Token.asStringMap(test), + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + } } -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} ``` ## Argument Reference @@ -79,7 +119,7 @@ The following arguments are supported: * `description` - (Optional) A description of the policy set's purpose. * `global` - (Optional) Whether or not policies in this set will apply to all workspaces. Defaults to `false`. This value _must not_ be provided if - `workspaceIds` is provided. + `workspace_ids` is provided. * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. @@ -87,19 +127,19 @@ The following arguments are supported: it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `policiesPath` - (Optional) The sub-path within the attached VCS repository - to ingress when using `vcsRepo`. All files and directories outside of this - sub-path will be ignored. This option can only be supplied when `vcsRepo` is + to ingress when using `vcs_repo`. All files and directories outside of this + sub-path will be ignored. This option can only be supplied when `vcs_repo` is present. Forces a new resource if changed. * `policyIds` - (Optional) A list of Sentinel policy IDs. This value _must not_ be provided - if `vcsRepo` is provided. + if `vcs_repo` is provided. * `vcsRepo` - (Optional) Settings for the policy sets VCS repository. Forces a - new resource if changed. This value _must not_ be provided if `policyIds` are provided. + new resource if changed. This value _must not_ be provided if `policy_ids` are provided. * `workspaceIds` - (Optional) A list of workspace IDs. This value _must not_ be provided if `global` is provided. -* `slug` - (Optional) A reference to the `tfeSlug` data source that contains - the `sourcePath` to where the local policies are located. This is used when +* `slug` - (Optional) A reference to the `tfe_slug` data source that contains + the `source_path` to where the local policies are located. This is used when policies are located locally, and can only be used when there is no VCS repo or -explicit Policy IDs. This _requires_ the usage of the `tfeSlug` data source. +explicit Policy IDs. This _requires_ the usage of the `tfe_slug` data source. -> **Note:** When neither `vcsRepo` or `policyIds` is not specified, the current default is to create an empty non-VCS policy set. @@ -113,8 +153,8 @@ The `vcsRepo` block supports: This defaults to the repository's default branch (e.g. main). * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. -* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. +* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. ## Attributes Reference @@ -128,4 +168,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index f7d672c9d..b265f791a 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = - new tfe.policySetParameter.PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 06087bc21..a58997243 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.project.Project(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Project(this, "test", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 86709c22d..a8af193f5 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -16,43 +16,41 @@ Adds and removes policy sets from a project Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new tfe.project.Project(this, "test_2", { + const tfeProjectTest = new Project(this, "test_2", { name: "my-project-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new tfe.projectPolicySet.ProjectPolicySet( - this, - "test_3", - { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - projectId: cdktf.Token.asString(tfeProjectTest.id), - } - ); + const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + projectId: Token.asString(tfeProjectTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectPolicySetTest.overrideLogicalId("test"); } @@ -79,4 +77,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index 62fa66b9d..11a89e985 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -16,40 +16,41 @@ Adds and removes variable sets from a project Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeProjectTest = new tfe.project.Project(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { name: "my-project-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { + const tfeVariableSetTest = new VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = - new tfe.projectVariableSet.ProjectVariableSet(this, "test_3", { - projectId: cdktf.Token.asString(tfeProjectTest.id), - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); } @@ -76,4 +77,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 4e29b136c..8beaff161 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,42 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( - this, - "test-oauth-client", - { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - serviceProvider: "github", - } - ); - new tfe.registryModule.RegistryModule(this, "test-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testOauthClient = new OauthClient(this, "test-oauth-client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: testOrganization.name, + serviceProvider: "github", + }); + new RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: cdktf.Token.asString( - tfeOauthClientTestOauthClient.oauthTokenId - ), + oauthTokenId: testOauthClient.oauthTokenId, }, }); } @@ -62,37 +55,35 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module with GitHub App: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const ghaInstallation = new DataTfeGithubAppInstallation( this, - "test-organization", + "gha_installation", { - email: "admin@company.com", - name: "my-org-name", + name: "YOUR_GH_NAME", } ); - const dataTfeGithubAppInstallationGhaInstallation = - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "YOUR_GH_NAME", - } - ); - new tfe.registryModule.RegistryModule(this, "petstore", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + new RegistryModule(this, "petstore", { + organization: testOrganization.name, vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: cdktf.Token.asString( - dataTfeGithubAppInstallationGhaInstallation.id - ), + githubAppInstallationId: Token.asString(ghaInstallation.id), identifier: "GH_NAME/REPO_NAME", }, }); @@ -104,34 +95,28 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module without VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule( - this, - "test-private-registry-module", - { - moduleProvider: "my_provider", - name: "another_test_module", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "private", - } - ); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-private-registry-module", { + moduleProvider: "my_provider", + name: "another_test_module", + organization: testOrganization.name, + registryName: "private", + }); } } @@ -140,27 +125,27 @@ class MyConvertedCode extends cdktf.TerraformStack { Create public registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, registryName: "public", }); } @@ -171,41 +156,37 @@ class MyConvertedCode extends cdktf.TerraformStack { Create no-code provisioning registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testNoCodeProvisioningRegistryModule = new RegistryModule( this, - "test-organization", + "test-no-code-provisioning-registry-module", { - email: "admin@company.com", - name: "my-org-name", + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: testOrganization.name, + registryName: "public", } ); - const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = - new tfe.registryModule.RegistryModule( - this, - "test-no-code-provisioning-registry-module", - { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "public", - } - ); - new tfe.noCodeModule.NoCodeModule(this, "foobar", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - registryModule: cdktf.Token.asString( - tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id - ), + new NoCodeModule(this, "foobar", { + organization: testOrganization.id, + registryModule: testNoCodeProvisioningRegistryModule.id, }); } } @@ -217,12 +198,12 @@ class MyConvertedCode extends cdktf.TerraformStack { The following arguments are supported: * `vcsRepo` - (Optional) Settings for the registry module's VCS repository. Forces a - new resource if changed. One of `vcsRepo` or `moduleProvider` is required. + new resource if changed. One of `vcs_repo` or `module_provider` is required. * `moduleProvider` - (Optional) Specifies the Terraform provider that this module is used for. For example, "aws" -* `name` - (Optional) The name of registry module. It must be set if `moduleProvider` is used. -* `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `moduleProvider` is used, or if `vcsRepo` is used via a GitHub App. -* `namespace` - (Optional) The namespace of a public registry module. It can be used if `moduleProvider` is set and `registryName` is public. -* `registryName` - (Optional) Whether the registry module is private or public. It can be used if `moduleProvider` is set. +* `name` - (Optional) The name of registry module. It must be set if `module_provider` is used. +* `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `module_provider` is used, or if `vcs_repo` is used via a GitHub App. +* `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. +* `registryName` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. The `vcsRepo` block supports: @@ -232,8 +213,8 @@ The `vcsRepo` block supports: * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. -* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. +* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. ## Attributes Reference @@ -260,4 +241,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index dcfe00943..481c24289 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,41 +19,34 @@ to up to 20 source workspaces. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( - this, - "test-sourceable", - { - name: "my-sourceable-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( - this, - "test-workspace", - { - name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.runTrigger.RunTrigger(this, "test", { - sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testSourceable = new Workspace(this, "test-sourceable", { + name: "my-sourceable-workspace-name", + organization: testOrganization.id, + }); + const testWorkspace = new Workspace(this, "test-workspace", { + name: "my-workspace-name", + organization: testOrganization.id, + }); + new RunTrigger(this, "test", { + sourceableId: testSourceable.id, + workspaceId: testWorkspace.id, }); } } @@ -80,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 430a810e7..fd4ed8cb5 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,17 +15,31 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TfeProvider } from "./.gen/providers/tfe/provider"; +import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new SamlSettings(this, "this", { + idpCert: "foobarCertificate", + sloEndpointUrl: "https://example.com/slo_endpoint_url", + ssoEndpointUrl: "https://example.com/sso_endpoint_url", + }); + } } -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } ``` ## Argument Reference @@ -46,8 +60,8 @@ The following arguments are supported: * `ssoApiTokenSessionTimeout` - (Optional) Specifies the Single Sign On session timeout in seconds. Defaults to 14 days. * `certificate` - (Optional) The certificate used for request and assertion signing. * `privateKey` - (Optional) The private key used for request and assertion signing. -* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. -* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. +* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. +* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. ## Attributes Reference @@ -64,4 +78,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file From 7e14b3aa4f8bf50c218b8185fc491033c444567a Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 14 Nov 2023 14:37:48 -0800 Subject: [PATCH 098/420] fix erroneous drift when toggling operations from true to false when using a version of tfe that supports default execution modes --- internal/provider/provider.go | 77 ++++---- .../provider/resource_tfe_organization.go | 6 + ...tfe_organization_default_execution_mode.go | 19 +- ...rganization_default_execution_mode_test.go | 10 +- internal/provider/resource_tfe_team.go | 5 +- .../provider/resource_tfe_variable_test.go | 1 + internal/provider/resource_tfe_workspace.go | 184 +++++++++++++++++- internal/provider/testing.go | 2 +- 8 files changed, 239 insertions(+), 65 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 0ae719028..c5abaac2d 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -106,44 +106,45 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), - "tfe_agent_pool": resourceTFEAgentPool(), - "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), - "tfe_agent_token": resourceTFEAgentToken(), - "tfe_notification_configuration": resourceTFENotificationConfiguration(), - "tfe_oauth_client": resourceTFEOAuthClient(), - "tfe_organization": resourceTFEOrganization(), - "tfe_organization_membership": resourceTFEOrganizationMembership(), - "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), - "tfe_organization_run_task": resourceTFEOrganizationRunTask(), - "tfe_organization_token": resourceTFEOrganizationToken(), - "tfe_policy": resourceTFEPolicy(), - "tfe_policy_set": resourceTFEPolicySet(), - "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), - "tfe_project": resourceTFEProject(), - "tfe_project_policy_set": resourceTFEProjectPolicySet(), - "tfe_project_variable_set": resourceTFEProjectVariableSet(), - "tfe_registry_module": resourceTFERegistryModule(), - "tfe_no_code_module": resourceTFENoCodeModule(), - "tfe_run_trigger": resourceTFERunTrigger(), - "tfe_sentinel_policy": resourceTFESentinelPolicy(), - "tfe_ssh_key": resourceTFESSHKey(), - "tfe_team": resourceTFETeam(), - "tfe_team_access": resourceTFETeamAccess(), - "tfe_team_organization_member": resourceTFETeamOrganizationMember(), - "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), - "tfe_team_project_access": resourceTFETeamProjectAccess(), - "tfe_team_member": resourceTFETeamMember(), - "tfe_team_members": resourceTFETeamMembers(), - "tfe_team_token": resourceTFETeamToken(), - "tfe_terraform_version": resourceTFETerraformVersion(), - "tfe_workspace": resourceTFEWorkspace(), - "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), - "tfe_variable_set": resourceTFEVariableSet(), - "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), - "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), - "tfe_workspace_run": resourceTFEWorkspaceRun(), - "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), + "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), + "tfe_agent_pool": resourceTFEAgentPool(), + "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), + "tfe_agent_token": resourceTFEAgentToken(), + "tfe_notification_configuration": resourceTFENotificationConfiguration(), + "tfe_oauth_client": resourceTFEOAuthClient(), + "tfe_organization": resourceTFEOrganization(), + "tfe_organization_default_execution_mode": resourceTFEOrganizationDefaultExecutionMode(), + "tfe_organization_membership": resourceTFEOrganizationMembership(), + "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), + "tfe_organization_run_task": resourceTFEOrganizationRunTask(), + "tfe_organization_token": resourceTFEOrganizationToken(), + "tfe_policy": resourceTFEPolicy(), + "tfe_policy_set": resourceTFEPolicySet(), + "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), + "tfe_project": resourceTFEProject(), + "tfe_project_policy_set": resourceTFEProjectPolicySet(), + "tfe_project_variable_set": resourceTFEProjectVariableSet(), + "tfe_registry_module": resourceTFERegistryModule(), + "tfe_no_code_module": resourceTFENoCodeModule(), + "tfe_run_trigger": resourceTFERunTrigger(), + "tfe_sentinel_policy": resourceTFESentinelPolicy(), + "tfe_ssh_key": resourceTFESSHKey(), + "tfe_team": resourceTFETeam(), + "tfe_team_access": resourceTFETeamAccess(), + "tfe_team_organization_member": resourceTFETeamOrganizationMember(), + "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), + "tfe_team_project_access": resourceTFETeamProjectAccess(), + "tfe_team_member": resourceTFETeamMember(), + "tfe_team_members": resourceTFETeamMembers(), + "tfe_team_token": resourceTFETeamToken(), + "tfe_terraform_version": resourceTFETerraformVersion(), + "tfe_workspace": resourceTFEWorkspace(), + "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), + "tfe_variable_set": resourceTFEVariableSet(), + "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), + "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), + "tfe_workspace_run": resourceTFEWorkspaceRun(), + "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), }, ConfigureContextFunc: configure(), } diff --git a/internal/provider/resource_tfe_organization.go b/internal/provider/resource_tfe_organization.go index 160391876..162909261 100644 --- a/internal/provider/resource_tfe_organization.go +++ b/internal/provider/resource_tfe_organization.go @@ -91,6 +91,11 @@ func resourceTFEOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "default_execution_mode": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -141,6 +146,7 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) + d.Set("default_execution_mode", org.DefaultExecutionMode) // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false diff --git a/internal/provider/resource_tfe_organization_default_execution_mode.go b/internal/provider/resource_tfe_organization_default_execution_mode.go index cb3d7adef..a307f1565 100644 --- a/internal/provider/resource_tfe_organization_default_execution_mode.go +++ b/internal/provider/resource_tfe_organization_default_execution_mode.go @@ -1,12 +1,13 @@ -package tfe +package provider import ( "context" + "errors" "fmt" tfe "github.com/hashicorp/go-tfe" - "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "log" ) func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { @@ -55,7 +56,7 @@ func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, m // Get the organization name. organization, err := config.schemaOrDefaultOrganization(d) if err != nil { - return err + return fmt.Errorf("error getting organization name: %w", err) } // If the "default_agent_pool_id" was provided, get the agent pool @@ -79,7 +80,7 @@ func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, m DefaultAgentPool: agentPool, }) if err != nil { - return err + return fmt.Errorf("error setting default execution mode of organization %s: %w", d.Id(), err) } d.SetId(organization) @@ -93,7 +94,7 @@ func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, met log.Printf("[DEBUG] Read the organization: %s", d.Id()) organization, err := config.Client.Organizations.Read(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] organization %s no longer exists", d.Id()) d.SetId("") return nil @@ -121,7 +122,7 @@ func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, m // Get the organization name. organization, err := config.schemaOrDefaultOrganization(d) if err != nil { - return err + return fmt.Errorf("error getting organization name: %w", err) } log.Printf("[DEBUG] Reseting default execution mode of organization: %s", organization) @@ -131,7 +132,7 @@ func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, m DefaultAgentPool: nil, }) if err != nil { - return err + return fmt.Errorf("error updating organization default execution mode: %w", err) } return nil @@ -143,7 +144,7 @@ func resourceTFEOrganizationDefaultExecutionModeImporter(ctx context.Context, d log.Printf("[DEBUG] Read the organization: %s", d.Id()) organization, err := config.Client.Organizations.Read(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] organization %s no longer exists", d.Id()) d.SetId("") } diff --git a/internal/provider/resource_tfe_organization_default_execution_mode_test.go b/internal/provider/resource_tfe_organization_default_execution_mode_test.go index ff4bd4a09..77cc4c11e 100644 --- a/internal/provider/resource_tfe_organization_default_execution_mode_test.go +++ b/internal/provider/resource_tfe_organization_default_execution_mode_test.go @@ -1,4 +1,4 @@ -package tfe +package provider import ( "fmt" @@ -6,10 +6,10 @@ import ( "testing" "time" + "errors" tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "errors" ) func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) { @@ -69,7 +69,7 @@ func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) { testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), - testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org), + testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org), ), }, }, @@ -99,7 +99,7 @@ func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) { testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), - testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org), + testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org), ), }, { @@ -153,7 +153,7 @@ func testAccCheckTFEOrganizationDefaultExecutionMode(org *tfe.Organization, expe } } -func testAccCheckTFEOrganizationDefaultAgentPoolIdExists(org *tfe.Organization) resource.TestCheckFunc { +func testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org *tfe.Organization) resource.TestCheckFunc { return func(s *terraform.State) error { if org.DefaultAgentPool == nil { return errors.New("default agent pool was not set") diff --git a/internal/provider/resource_tfe_team.go b/internal/provider/resource_tfe_team.go index 75844fa1f..d1e90c0a8 100644 --- a/internal/provider/resource_tfe_team.go +++ b/internal/provider/resource_tfe_team.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "errors" tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -162,7 +163,7 @@ func resourceTFETeamCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Create team %s for organization: %s", name, organization) team, err := config.Client.Teams.Create(ctx, organization, options) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { entitlements, _ := config.Client.Organizations.ReadEntitlements(ctx, organization) if entitlements == nil { return fmt.Errorf("Error creating team %s for organization %s: %w", name, organization, err) @@ -274,7 +275,7 @@ func resourceTFETeamDelete(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Delete team: %s", d.Id()) err := config.Client.Teams.Delete(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { return nil } return fmt.Errorf("Error deleting team %s: %w", d.Id(), err) diff --git a/internal/provider/resource_tfe_variable_test.go b/internal/provider/resource_tfe_variable_test.go index 2ce2e3bf3..bfd2c1135 100644 --- a/internal/provider/resource_tfe_variable_test.go +++ b/internal/provider/resource_tfe_variable_test.go @@ -725,6 +725,7 @@ resource "tfe_organization" "foobar" { resource "tfe_workspace" "foobar" { name = "workspace-test" organization = tfe_organization.foobar.id + execution_mode = "remote" } resource "tfe_variable" "ws_env" { diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 5c7641a38..6794d8c6f 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -46,6 +46,10 @@ func resourceTFEWorkspace() *schema.Resource { return err } + if err := overwriteDefaultExecutionMode(c, d); err != nil { + return err + } + if err := validateAgentExecution(c, d); err != nil { return err } @@ -82,7 +86,8 @@ func resourceTFEWorkspace() *schema.Resource { "agent_pool_id": { Type: schema.TypeString, Optional: true, - Default: "", + Computed: true, + Default: nil, ConflictsWith: []string{"operations"}, }, @@ -119,6 +124,24 @@ func resourceTFEWorkspace() *schema.Resource { ), }, + "setting_overwrites": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "execution_mode": { + Type: schema.TypeBool, + Required: true, + }, + + "agent_pool": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, + "file_triggers_enabled": { Type: schema.TypeBool, Optional: true, @@ -323,14 +346,34 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), + AgentPool: tfe.Bool(true), + } } if v, ok := d.GetOk("execution_mode"); ok { - options.ExecutionMode = tfe.String(v.(string)) + executionMode := tfe.String(v.(string)) + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), + AgentPool: tfe.Bool(true), + } + options.ExecutionMode = executionMode } if v, ok := d.GetOkExists("operations"); ok { options.Operations = tfe.Bool(v.(bool)) + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), + AgentPool: tfe.Bool(true), + } + } + + if options.SettingOverwrites == nil { + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(false), + AgentPool: tfe.Bool(false), + } } if v, ok := d.GetOk("source_url"); ok { @@ -438,7 +481,7 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Read configuration of workspace: %s", id) workspace, err := config.Client.Workspaces.ReadByID(ctx, id) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] Workspace %s no longer exists", id) d.SetId("") return nil @@ -472,6 +515,18 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { d.Set("organization", workspace.Organization.Name) d.Set("resource_count", workspace.ResourceCount) + var settingOverwrites []interface{} + if workspace.SettingOverwrites != nil { + settingOverwrites = append(settingOverwrites, map[string]interface{}{ + "execution_mode": workspace.SettingOverwrites.ExecutionMode, + "agent_pool": workspace.SettingOverwrites.AgentPool, + }) + } + err = d.Set("setting_overwrites", settingOverwrites) + if err != nil { + return err + } + if workspace.Links["self-html"] != nil { baseAPI := config.Client.BaseURL() htmlURL := url.URL{ @@ -541,15 +596,18 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error config := meta.(ConfiguredClient) id := d.Id() + workspaceControlsAgentPool := isSettingOverwritten("agent_pool", d) + workspaceControlsExecutionMode := isSettingOverwritten("execution_mode", d) + if d.HasChange("name") || d.HasChange("auto_apply") || d.HasChange("auto_apply_run_trigger") || d.HasChange("queue_all_runs") || d.HasChange("terraform_version") || d.HasChange("working_directory") || d.HasChange("vcs_repo") || d.HasChange("file_triggers_enabled") || d.HasChange("trigger_prefixes") || d.HasChange("trigger_patterns") || d.HasChange("allow_destroy_plan") || d.HasChange("speculative_enabled") || - d.HasChange("operations") || d.HasChange("execution_mode") || - d.HasChange("description") || d.HasChange("agent_pool_id") || + d.HasChange("operations") || (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || + d.HasChange("description") || (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || d.HasChange("global_remote_state") || d.HasChange("structured_run_output_enabled") || - d.HasChange("assessments_enabled") || d.HasChange("project_id") { + d.HasChange("assessments_enabled") || d.HasChange("project_id") || d.HasChange("setting_overwrites") { // Create a new options struct. options := tfe.WorkspaceUpdateOptions{ Name: tfe.String(d.Get("name").(string)), @@ -577,15 +635,42 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("agent_pool_id") { + if d.HasChange("agent_pool_id") && workspaceControlsAgentPool { if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) + + if options.SettingOverwrites == nil { + // avoid overwriting setting-overwrites that may have been set previously + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} + } } } - if d.HasChange("execution_mode") { - if v, ok := d.GetOk("execution_mode"); ok { - options.ExecutionMode = tfe.String(v.(string)) + if (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || d.HasChange("setting_overwrites") { + executionMode := d.GetRawConfig().GetAttr("execution_mode") + + // if the TFE instance knows about setting setting-overwrites... + if _, ok := d.GetOk("setting_overwrites"); ok { + if options.SettingOverwrites == nil { + // avoid overwriting setting-overwrites that may have been set previously + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} + } + + // if execution mode is current unset... + operations := d.GetRawConfig().GetAttr("operations") + if executionMode.IsNull() && operations.IsNull() { + // set execution mode to default (inherit from the parent organization/project) + options.SettingOverwrites.ExecutionMode = tfe.Bool(false) + } + if !executionMode.IsNull() { + options.SettingOverwrites.ExecutionMode = tfe.Bool(true) + options.ExecutionMode = tfe.String(executionMode.AsString()) + } + } else { + // since the TFE instances doesn't know about setting-overwrites, set the execution mode as normal + if v, ok := d.GetOk("execution_mode"); ok { + options.ExecutionMode = tfe.String(v.(string)) + } } } @@ -852,6 +937,21 @@ func setExecutionModeDefault(_ context.Context, d *schema.ResourceDiff) error { executionMode, executionModeReadOk := configMap["execution_mode"] executionModeState := d.Get("execution_mode") if operationsReadOk && executionModeReadOk { + // forcefully setting the execution mode default is only necessary when an existing workspace is being updated + isRecordPersisted := d.Id() != "" + if isRecordPersisted != true { + return nil + } + + // if current TFE version supports setting-overwrites... + if v, ok := d.GetOkExists("setting_overwrites"); ok { + settingOverwrites := v.([]interface{}) + if operations.IsNull() && executionMode.IsNull() && len(settingOverwrites) != 0 { + // ... don't set execution mode to remote + return nil + } + } + if operations.IsNull() && executionMode.IsNull() && executionModeState != "remote" { err := d.SetNew("execution_mode", "remote") if err != nil { @@ -863,6 +963,50 @@ func setExecutionModeDefault(_ context.Context, d *schema.ResourceDiff) error { return nil } +func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) error { + configMap := d.GetRawConfig().AsValueMap() + executionMode, executionModeReadOk := configMap["execution_mode"] + operations, operationsReadOk := configMap["operations"] + + // if the execution mode is currently overwritten, but being set to default in the current config, make sure that + // the setting overwrites will be set to false + if executionMode.IsNull() && operations.IsNull() { + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{})[0].(map[string]interface{}) + if settingOverwrites["execution_mode"] == true { + newSettingOverwrites := map[string]interface{}{ + "execution_mode": false, + "agent_pool": false, + } + d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) + d.SetNewComputed("execution_mode") + } + return nil + } + } + + if (executionMode.IsNull() || !executionModeReadOk) && (operations.IsNull() || !operationsReadOk) { + return nil + } + + // if the default execution mode and the execution_mode in the config matches, nothing will happen + // unless we inform TFE that the new execution_mode is meant to overwrite the current execution mode + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{})[0].(map[string]interface{}) + if settingOverwrites["execution_mode"] == false { + agentPool, agentPoolReadOk := configMap["agent_pool"] + + newSettingOverwrites := map[string]interface{}{ + "execution_mode": true, + "agent_pool": agentPool.IsKnown() && agentPoolReadOk, + } + d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) + } + } + + return nil +} + // An agent pool can only be specified when execution_mode is set to "agent". You currently cannot specify a // schema validation based on a different argument's value, so we do so here at plan time instead. func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { @@ -970,3 +1114,23 @@ func errWorkspaceResourceCountCheck(workspaceID string, resourceCount int) error } return nil } + +// isSettingOverwritten checks if the value of a setting is being overwritten by the workspace or not. in other words, +// if the value of the setting is determined by the workspace, this function will return true for that setting +func isSettingOverwritten(setting string, d *schema.ResourceData) bool { + if v, ok := d.GetOk("setting_overwrites"); ok { + settingOverwrites := v.([]interface{}) + if len(settingOverwrites) != 1 { + // current TFE version does not support setting-overwrites, so all settings are set at workspace-level + return true + } + + // check the value of the setting + settingOverwritesValue := settingOverwrites[0].(map[string]interface{}) + executionModeOverwritten := settingOverwritesValue[setting] + + return executionModeOverwritten.(bool) + } + + return true +} diff --git a/internal/provider/testing.go b/internal/provider/testing.go index bbe75c1f5..7271c8fd4 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -149,7 +149,7 @@ func createBusinessOrganizationWithAgentDefaultExecutionMode(t *testing.T, tfeCl DefaultAgentPool: nil, }) if err != nil { - err = fmt.Errorf("failure occured while trying to unlink organization from agent pool: %w", err) + err = fmt.Errorf("failure occurred while trying to unlink organization from agent pool: %w", err) t.Fatal(err) } From 73f87a6ebaafa662a602b8e88b2bcb8674b767c4 Mon Sep 17 00:00:00 2001 From: hashimoon <98980386+hashimoon@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:56:28 -0700 Subject: [PATCH 099/420] [TF-9605] Add Private Registry Module Testing --- CHANGELOG.md | 3 + .../provider/resource_tfe_registry_module.go | 99 +++- .../resource_tfe_registry_module_test.go | 475 ++++++++++++++++++ website/docs/r/registry_module.html.markdown | 36 ++ 4 files changed, 612 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f8380cd3..e991fc9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ +FEATURES: +* `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) + ## v0.50.0 FEATURES: diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 1f1e3c1fc..9b2f9d2bc 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -47,6 +47,10 @@ func resourceTFERegistryModule() *schema.Resource { Computed: true, ForceNew: true, }, + "publishing_mechanism": { + Type: schema.TypeString, + Computed: true, + }, "vcs_repo": { Type: schema.TypeList, Optional: true, @@ -78,6 +82,14 @@ func resourceTFERegistryModule() *schema.Resource { ConflictsWith: []string{"vcs_repo.0.oauth_token_id"}, AtLeastOneOf: []string{"vcs_repo.0.oauth_token_id", "vcs_repo.0.github_app_installation_id"}, }, + "branch": { + Type: schema.TypeString, + Optional: true, + }, + "tags": { + Type: schema.TypeBool, + Optional: true, + }, }, }, }, @@ -104,6 +116,18 @@ func resourceTFERegistryModule() *schema.Resource { true, ), }, + "test_config": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "tests_enabled": { + Type: schema.TypeBool, + Optional: true, + }, + }, + }, + }, }, } } @@ -113,6 +137,15 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * // Create module with VCS repo configuration block. options := tfe.RegistryModuleCreateWithVCSConnectionOptions{} vcsRepo := v.([]interface{})[0].(map[string]interface{}) + var testConfig map[string]interface{} + + if tc, ok := d.GetOk("test_config"); ok { + if tc.([]interface{})[0] == nil { + return nil, fmt.Errorf("tests_enabled must be provided when configuring a test_config") + } + + testConfig = tc.([]interface{})[0].(map[string]interface{}) + } orgName, err := config.schemaOrDefaultOrganization(d) if err != nil { @@ -126,10 +159,27 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * OrganizationName: tfe.String(orgName), } + tags, tagsOk := vcsRepo["tags"].(bool) + branch, branchOk := vcsRepo["branch"].(string) + + if tagsOk && tags && branchOk && branch != "" { + return nil, fmt.Errorf("tags must be set to false when a branch is provided") + } + + if branchOk && branch != "" { + options.VCSRepo.Branch = tfe.String(branch) + } + if vcsRepo["oauth_token_id"] != nil && vcsRepo["oauth_token_id"].(string) != "" { options.VCSRepo.OAuthTokenID = tfe.String(vcsRepo["oauth_token_id"].(string)) } + if testsEnabled, ok := testConfig["tests_enabled"].(bool); ok { + options.TestConfig = &tfe.RegistryModuleTestConfigOptions{ + TestsEnabled: tfe.Bool(testsEnabled), + } + } + log.Printf("[DEBUG] Create registry module from repository %s", *options.VCSRepo.Identifier) registryModule, err := config.Client.RegistryModules.CreateWithVCSConnection(ctx, options) if err != nil { @@ -174,7 +224,6 @@ func resourceTFERegistryModuleCreateWithoutVCS(meta interface{}, d *schema.Resou func resourceTFERegistryModuleCreate(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) - var registryModule *tfe.RegistryModule var err error @@ -242,6 +291,40 @@ func resourceTFERegistryModuleUpdate(d *schema.ResourceData, meta interface{}) e RegistryName: tfe.RegistryName(d.Get("registry_name").(string)), } + if v, ok := d.GetOk("vcs_repo"); ok { //nolint:nestif + vcsRepo := v.([]interface{})[0].(map[string]interface{}) + options.VCSRepo = &tfe.RegistryModuleVCSRepoUpdateOptions{} + + tags, tagsOk := vcsRepo["tags"].(bool) + branch, branchOk := vcsRepo["branch"].(string) + + if tagsOk && tags && branchOk && branch != "" { + return fmt.Errorf("tags must be set to false when a branch is provided") + } + + if tagsOk { + options.VCSRepo.Tags = tfe.Bool(tags) + } + + if branchOk { + options.VCSRepo.Branch = tfe.String(branch) + } + } + + if v, ok := d.GetOk("test_config"); ok { + if v.([]interface{})[0] == nil { + return fmt.Errorf("tests_enabled must be provided when configuring a test_config") + } + + testConfig := v.([]interface{})[0].(map[string]interface{}) + + options.TestConfig = &tfe.RegistryModuleTestConfigOptions{} + + if testsEnabled, ok := testConfig["tests_enabled"].(bool); ok { + options.TestConfig.TestsEnabled = tfe.Bool(testsEnabled) + } + } + err = resource.Retry(time.Duration(5)*time.Minute, func() *resource.RetryError { registryModule, err = config.Client.RegistryModules.Update(ctx, rmID, options) if err != nil { @@ -291,6 +374,7 @@ func resourceTFERegistryModuleRead(d *schema.ResourceData, meta interface{}) err d.Set("namespace", registryModule.Namespace) d.Set("registry_name", registryModule.RegistryName) d.Set("no_code", registryModule.NoCode) + d.Set("publishing_mechanism", registryModule.PublishingMechanism) // Set VCS repo options. var vcsRepo []interface{} @@ -300,12 +384,25 @@ func resourceTFERegistryModuleRead(d *schema.ResourceData, meta interface{}) err "oauth_token_id": registryModule.VCSRepo.OAuthTokenID, "github_app_installation_id": registryModule.VCSRepo.GHAInstallationID, "display_identifier": registryModule.VCSRepo.DisplayIdentifier, + "branch": registryModule.VCSRepo.Branch, + "tags": registryModule.VCSRepo.Tags, } vcsRepo = append(vcsRepo, vcsConfig) d.Set("vcs_repo", vcsRepo) } + var testConfig []interface{} + if registryModule.TestConfig != nil { + testConfigValues := map[string]interface{}{ + "tests_enabled": registryModule.TestConfig.TestsEnabled, + } + + testConfig = append(testConfig, testConfigValues) + + d.Set("test_config", testConfig) + } + return nil } diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index a4d187c5e..3aa206a5e 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -7,6 +7,7 @@ import ( "fmt" "math/rand" "regexp" + "strconv" "strings" "testing" "time" @@ -66,6 +67,10 @@ func TestAccTFERegistryModule_vcs(t *testing.T) { "tfe_registry_module.foobar", "vcs_repo.0.identifier", envGithubRegistryModuleIdentifer), resource.TestCheckResourceAttrSet( "tfe_registry_module.foobar", "vcs_repo.0.oauth_token_id"), + resource.TestCheckResourceAttr( + "tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + resource.TestCheckResourceAttr( + "tfe_registry_module.foobar", "vcs_repo.0.tags", "true"), ), }, }, @@ -397,6 +402,272 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T) }) } +func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsBranch(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranchWithTests(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranch(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranch(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + }, + }) +} + +func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWithTests(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsBranchWithTests(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranch(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + }, + }) +} + +func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranch(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranchWithTests(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + }, + }) +} + +func TestAccTFERegistryModule_invalidTestConfigOnCreate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsInvalidBranch(rInt), + ExpectError: regexp.MustCompile(`tests_enabled must be provided when configuring a test_config`), + }, + }, + }) +} + +func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + { + Config: testAccTFERegistryModule_vcsInvalidBranch(rInt), + ExpectError: regexp.MustCompile(`tests_enabled must be provided when configuring a test_config`), + }, + }, + }) +} + +func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsBranchWithInvalidTests(rInt), + ExpectError: regexp.MustCompile(`tests_enabled must be provided when configuring a test_config`), + }, + }, + }) +} + +func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsBranchWithTestsAndTagsEnabled(rInt), + ExpectError: regexp.MustCompile(`tags must be set to false when a branch is provided`), + }, + }, + }) +} + +func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + { + Config: testAccTFERegistryModule_vcsBranchWithTestsAndTagsEnabled(rInt), + ExpectError: regexp.MustCompile(`tags must be set to false when a branch is provided`), + }, + }, + }) +} + func TestAccTFERegistryModuleImport_nonVCSPrivateRM(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -703,6 +974,7 @@ func testAccTFERegistryModule_vcs(rInt int) string { resource "tfe_organization" "foobar" { name = "tst-terraform-%d" email = "admin@company.com" + } resource "tfe_oauth_client" "foobar" { @@ -718,6 +990,209 @@ resource "tfe_registry_module" "foobar" { display_identifier = "%s" identifier = "%s" oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + tags = true + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_vcsBranch(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } + + test_config { + tests_enabled = false + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} +func testAccTFERegistryModule_vcsInvalidBranch(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } + + test_config { + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} +func testAccTFERegistryModule_vcsBranchWithTests(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } + + test_config { + tests_enabled = true + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_vcsBranchWithInvalidTests(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } + + test_config { + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_vcsBranchWithTestsAndTagsEnabled(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = true + } + + test_config { + tests_enabled = true + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_vcsTags(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + tags = true + branch = "" } }`, rInt, diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index 2e46190e2..548dcbed9 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -36,6 +36,36 @@ resource "tfe_registry_module" "test-registry-module" { } ``` +Create private registry module with tests enabled: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test-oauth-client" { + organization = tfe_organization.test-organization.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-vcs-provider-token" + service_provider = "github" +} + +resource "tfe_registry_module" "test-registry-module" { + test_config { + tests_enabled = true + } + + vcs_repo { + display_identifier = "my-org-name/terraform-provider-name" + identifier = "my-org-name/terraform-provider-name" + oauth_token_id = tfe_oauth_client.test-oauth-client.oauth_token_id + branch = "main" + } +} +``` + Create private registry module with GitHub App: ```hcl @@ -125,6 +155,9 @@ The following arguments are supported: * `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. * `registry_name` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +The `test_config` block supports +* `tests_enabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `vcs_repo` block supports: * `display_identifier` - (Required) The display identifier for your VCS repository. @@ -135,6 +168,8 @@ The `vcs_repo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. +* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. ## Attributes Reference @@ -143,6 +178,7 @@ The `vcs_repo` block supports: * `name` - The name of registry module. * `organization` - The name of the organization associated with the registry module. * `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `publishing_mechanism` - The publishing mechanism used when releasing new versions of the module. * `registry_name` - The registry name of the registry module depicting whether the registry module is private or public. * `no_code` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. From bd56db5dc49798aacad080bca7ecee478e4c67d3 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 13:49:16 -0800 Subject: [PATCH 100/420] fix agent_pool_id not being set to null after being unset --- internal/provider/resource_tfe_workspace.go | 64 +++++++++++++-------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 6794d8c6f..1dfc7f200 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -41,8 +41,9 @@ func resourceTFEWorkspace() *schema.Resource { }, CustomizeDiff: func(c context.Context, d *schema.ResourceDiff, meta interface{}) error { - // NOTE: execution mode must be set to default first before calling the validation functions - if err := setExecutionModeDefault(c, d); err != nil { + // NOTE: execution mode and agent_pool_id must be set to default first before calling + // the validation functions + if err := setComputedDefaults(c, d); err != nil { return err } @@ -87,7 +88,6 @@ func resourceTFEWorkspace() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - Default: nil, ConflictsWith: []string{"operations"}, }, @@ -928,35 +928,48 @@ func resourceTFEWorkspaceDelete(d *schema.ResourceData, meta interface{}) error return nil } -// since execution_mode is marked as Optional: true, and Computed: true, -// unsetting the execution_mode in the config after it's been set to a valid -// value is not detected by ResourceDiff so read value from RawConfig instead -func setExecutionModeDefault(_ context.Context, d *schema.ResourceDiff) error { +// since execution_mode and agent_pool_id are marked as Optional: true, and +// Computed: true, unsetting the execution_mode/agent_pool_id in the config +// after it's been set to a valid value is not detected by ResourceDiff so +// we need to read the value from RawConfig instead +func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { configMap := d.GetRawConfig().AsValueMap() operations, operationsReadOk := configMap["operations"] executionMode, executionModeReadOk := configMap["execution_mode"] executionModeState := d.Get("execution_mode") - if operationsReadOk && executionModeReadOk { - // forcefully setting the execution mode default is only necessary when an existing workspace is being updated - isRecordPersisted := d.Id() != "" - if isRecordPersisted != true { - return nil - } + agentPoolId, agentPoolIdReadOk := configMap["agent_pool_id"] + agentPoolIdState := d.Get("agent_pool_id") - // if current TFE version supports setting-overwrites... - if v, ok := d.GetOkExists("setting_overwrites"); ok { - settingOverwrites := v.([]interface{}) - if operations.IsNull() && executionMode.IsNull() && len(settingOverwrites) != 0 { - // ... don't set execution mode to remote - return nil - } + // forcefully setting the defaults is only necessary when an existing workspace is being updated + isRecordPersisted := d.Id() != "" + if isRecordPersisted != true { + return nil + } + + if !operationsReadOk || !executionModeReadOk || !agentPoolIdReadOk { + return nil + } + + // find out current TFE version supports setting-overwrites + currentTfeSupportsSettingOverwrites := false + if v, ok := d.GetOkExists("setting_overwrites"); ok { + settingOverwrites := v.([]interface{}) + currentTfeSupportsSettingOverwrites = len(settingOverwrites) != 0 + } + + executionModeWasUnset := executionModeState != "remote" && operations.IsNull() && executionMode.IsNull() + if executionModeWasUnset && !currentTfeSupportsSettingOverwrites { + err := d.SetNew("execution_mode", "remote") + if err != nil { + return fmt.Errorf("failed to set execution_mode: %w", err) } + } - if operations.IsNull() && executionMode.IsNull() && executionModeState != "remote" { - err := d.SetNew("execution_mode", "remote") - if err != nil { - return fmt.Errorf("failed to set execution_mode: %w", err) - } + agentPoolWasUnset := (agentPoolId.IsNull() || !agentPoolIdReadOk) && agentPoolIdState != "" + if agentPoolWasUnset { + err := d.SetNew("agent_pool_id", nil) + if err != nil { + return fmt.Errorf("failed to clear agent_pool_id: %w", err) } } @@ -980,6 +993,7 @@ func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) er } d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) d.SetNewComputed("execution_mode") + d.SetNewComputed("agent_pool_id") } return nil } From ca9e73d47f506156d1c687baa3fc075ce5adff5d Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 14:30:22 -0800 Subject: [PATCH 101/420] fmt --- internal/provider/resource_tfe_workspace.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 1dfc7f200..e3723b5f3 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -937,8 +937,8 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { operations, operationsReadOk := configMap["operations"] executionMode, executionModeReadOk := configMap["execution_mode"] executionModeState := d.Get("execution_mode") - agentPoolId, agentPoolIdReadOk := configMap["agent_pool_id"] - agentPoolIdState := d.Get("agent_pool_id") + agentPoolID, agentPoolIDReadOk := configMap["agent_pool_id"] + agentPoolIDState := d.Get("agent_pool_id") // forcefully setting the defaults is only necessary when an existing workspace is being updated isRecordPersisted := d.Id() != "" @@ -946,7 +946,7 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { return nil } - if !operationsReadOk || !executionModeReadOk || !agentPoolIdReadOk { + if !operationsReadOk || !executionModeReadOk || !agentPoolIDReadOk { return nil } @@ -965,7 +965,7 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { } } - agentPoolWasUnset := (agentPoolId.IsNull() || !agentPoolIdReadOk) && agentPoolIdState != "" + agentPoolWasUnset := (agentPoolID.IsNull() || !agentPoolIDReadOk) && agentPoolIDState != "" if agentPoolWasUnset { err := d.SetNew("agent_pool_id", nil) if err != nil { From 8f432dc54ff8200b61ea496c7635dea027a92247 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 15:31:45 -0800 Subject: [PATCH 102/420] fix validations erroring erroneously when the workspace is being set to the organization default execution mode --- internal/provider/resource_tfe_workspace.go | 30 ++++++++++++------- .../provider/resource_tfe_workspace_test.go | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index e3723b5f3..3d94c146b 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -638,10 +638,9 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error if d.HasChange("agent_pool_id") && workspaceControlsAgentPool { if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) - - if options.SettingOverwrites == nil { - // avoid overwriting setting-overwrites that may have been set previously - options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} + // set setting overwrites + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + AgentPool: tfe.Bool(true), } } } @@ -966,7 +965,7 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { } agentPoolWasUnset := (agentPoolID.IsNull() || !agentPoolIDReadOk) && agentPoolIDState != "" - if agentPoolWasUnset { + if agentPoolWasUnset && !currentTfeSupportsSettingOverwrites { err := d.SetNew("agent_pool_id", nil) if err != nil { return fmt.Errorf("failed to clear agent_pool_id: %w", err) @@ -1008,11 +1007,11 @@ func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) er if v, ok := d.GetOk("setting_overwrites"); ok { settingOverwrites := v.([]interface{})[0].(map[string]interface{}) if settingOverwrites["execution_mode"] == false { - agentPool, agentPoolReadOk := configMap["agent_pool"] + agentPoolID, agentPoolReadOk := configMap["agent_pool_id"] newSettingOverwrites := map[string]interface{}{ "execution_mode": true, - "agent_pool": agentPool.IsKnown() && agentPoolReadOk, + "agent_pool": agentPoolID.IsKnown() && agentPoolReadOk, } d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) } @@ -1024,11 +1023,20 @@ func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) er // An agent pool can only be specified when execution_mode is set to "agent". You currently cannot specify a // schema validation based on a different argument's value, so we do so here at plan time instead. func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { - if executionMode, ok := d.GetOk("execution_mode"); ok { - executionModeIsAgent := executionMode.(string) == "agent" - if !executionModeIsAgent && d.Get("agent_pool_id") != "" { + // since execution_mode and agent_pool_id are marked as Optional: true, and + // Computed: true, unsetting the execution_mode/agent_pool_id in the config + // after it's been set to a valid value is not detected by ResourceDiff so + // we need to read the value from RawConfig instead + configMap := d.GetRawConfig().AsValueMap() + executionMode, executionModeReadOk := configMap["execution_mode"] + agentPoolID, agentPoolIDReadOk := configMap["agent_pool_id"] + executionModeSet := !executionMode.IsNull() && executionModeReadOk + agentPoolIDSet := !agentPoolID.IsNull() && agentPoolIDReadOk + if executionModeSet { + executionModeIsAgent := executionMode.AsString() == "agent" + if executionModeIsAgent && !agentPoolIDSet { return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") - } else if executionModeIsAgent && d.NewValueKnown("agent_pool_id") && d.Get("agent_pool_id") == "" { + } else if !executionModeIsAgent && agentPoolIDSet { return fmt.Errorf("agent_pool_id must be provided when execution_mode is 'agent'") } } diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index d694bbe77..199a7dd73 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2973,7 +2973,7 @@ resource "tfe_workspace" "foobar" { // while testing the flow of unsetting execution mode as in TestAccTFEWorkspace_unsetExecutionMode // the resource "tfe_agent_pool" has been kept in both configs(testAccTFEWorkspace_executionModeAgent & testAccTFEWorkspace_executionModeNull) -// this prevents an attempt to destroy the agent pool before dissasociating it from the workspace +// this prevents an attempt to destroy the agent pool before disassociating it from the workspace func testAccTFEWorkspace_executionModeNull(organization string) string { return fmt.Sprintf(` resource "tfe_agent_pool" "foobar" { From 70d8c7ee47417ae6a147e6bc185406e4587398f3 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 18:33:08 -0800 Subject: [PATCH 103/420] fix for error thrown when switching from the default agent pool to the same agent pool but explicitly set/overwritten --- internal/provider/resource_tfe_workspace.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 3d94c146b..7394c61d1 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -635,7 +635,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("agent_pool_id") && workspaceControlsAgentPool { + if (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || d.HasChange("setting_overwrites") { if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { options.AgentPoolID = tfe.String(v.(string)) // set setting overwrites From f6d3bd9198be885407678f5b470d5750d7f78a7d Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 18:47:03 -0800 Subject: [PATCH 104/420] remove default_execution_mode from organization, it is handled via its own resource --- internal/provider/resource_tfe_organization.go | 6 ------ internal/provider/resource_tfe_organization_test.go | 2 -- 2 files changed, 8 deletions(-) diff --git a/internal/provider/resource_tfe_organization.go b/internal/provider/resource_tfe_organization.go index 162909261..160391876 100644 --- a/internal/provider/resource_tfe_organization.go +++ b/internal/provider/resource_tfe_organization.go @@ -91,11 +91,6 @@ func resourceTFEOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, - - "default_execution_mode": { - Type: schema.TypeString, - Computed: true, - }, }, } } @@ -146,7 +141,6 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) - d.Set("default_execution_mode", org.DefaultExecutionMode) // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false diff --git a/internal/provider/resource_tfe_organization_test.go b/internal/provider/resource_tfe_organization_test.go index b2e4ae729..cae3b88b6 100644 --- a/internal/provider/resource_tfe_organization_test.go +++ b/internal/provider/resource_tfe_organization_test.go @@ -80,8 +80,6 @@ func TestAccTFEOrganization_full(t *testing.T) { "tfe_organization.foobar", "assessments_enforced", "false"), resource.TestCheckResourceAttr( "tfe_organization.foobar", "allow_force_delete_workspaces", "false"), - resource.TestCheckResourceAttr( - "tfe_organization.foobar", "default_execution_mode", "remote"), ), }, }, From cdd8f1b11478ccd9bbe0144d1576488805344e49 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 19:19:24 -0800 Subject: [PATCH 105/420] add changelog entry and documentation --- CHANGELOG.md | 2 + ...ation_default_execution_mode.html.markdown | 48 +++++++++++++++++++ website/docs/r/workspace.html.markdown | 9 ++-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 website/docs/r/tfe_organization_default_execution_mode.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index e991fc9fb..049b1d817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) +* **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' +* `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' ## v0.50.0 diff --git a/website/docs/r/tfe_organization_default_execution_mode.html.markdown b/website/docs/r/tfe_organization_default_execution_mode.html.markdown new file mode 100644 index 000000000..9afc135fc --- /dev/null +++ b/website/docs/r/tfe_organization_default_execution_mode.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_execution_mode" +description: |- + Sets the default execution mode of an organization +--- + +# tfe_organization_default_execution_mode + +Sets the default execution mode of an organization. This default execution mode will be used as the default execution mode for all workspaces in the organization. + +## Example Usage + +Basic usage: + +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_agent_pool" "my_agents" { + name = "agent_smiths" + organization = tfe_organization.test.name +} + +resource "tfe_organization_default_execution_mode" "org_default" { + organization = tfe_organization.test.name + default_execution_mode = "agent" + default_agent_pool_id = tfe_agent_pool.my_agents.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `default_execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `agent_pool_id` - (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 or if `operations` is + provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +This resource does not manage the creation of an organization and there is no need to import it. \ No newline at end of file diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 7ec1354dd..ee78ad65e 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -63,8 +63,8 @@ The following arguments are supported: * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. - Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. + Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. @@ -145,7 +145,10 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resource_count` - The number of resources managed by the workspace. -* `html_url` - The URL to the browsable HTML overview of the workspace +* `html_url` - The URL to the browsable HTML overview of the workspace. +* `setting_overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import From 4d4d4dfb267775a61348940bbfd7b7087d41760e Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 19:20:25 -0800 Subject: [PATCH 106/420] remove extra space --- internal/provider/resource_tfe_organization.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resource_tfe_organization.go b/internal/provider/resource_tfe_organization.go index 160391876..491581930 100644 --- a/internal/provider/resource_tfe_organization.go +++ b/internal/provider/resource_tfe_organization.go @@ -141,7 +141,6 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) - // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false d.Set("assessments_enforced", org.AssessmentsEnforced) From 938dc89fb3ef12e270386754bc24a468b14187b4 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 19:32:10 -0800 Subject: [PATCH 107/420] clean up comments --- internal/provider/resource_tfe_workspace.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 7394c61d1..4c211a14c 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -648,25 +648,28 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error if (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || d.HasChange("setting_overwrites") { executionMode := d.GetRawConfig().GetAttr("execution_mode") - // if the TFE instance knows about setting setting-overwrites... + // if the TFE instance knows about setting-overwrites if _, ok := d.GetOk("setting_overwrites"); ok { if options.SettingOverwrites == nil { - // avoid overwriting setting-overwrites that may have been set previously + // initialize setting-overwrites if it has not been initialized already options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} } - // if execution mode is current unset... + // if execution mode is currently unset... operations := d.GetRawConfig().GetAttr("operations") if executionMode.IsNull() && operations.IsNull() { // set execution mode to default (inherit from the parent organization/project) options.SettingOverwrites.ExecutionMode = tfe.Bool(false) } + + // if execution has been set... if !executionMode.IsNull() { + // set the execution mode to be "overwritten" options.SettingOverwrites.ExecutionMode = tfe.Bool(true) options.ExecutionMode = tfe.String(executionMode.AsString()) } } else { - // since the TFE instances doesn't know about setting-overwrites, set the execution mode as normal + // since the TFE instance doesn't know about setting-overwrites, set the execution mode as normal if v, ok := d.GetOk("execution_mode"); ok { options.ExecutionMode = tfe.String(v.(string)) } @@ -949,7 +952,7 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { return nil } - // find out current TFE version supports setting-overwrites + // find out if the current TFE version supports setting-overwrites currentTfeSupportsSettingOverwrites := false if v, ok := d.GetOkExists("setting_overwrites"); ok { settingOverwrites := v.([]interface{}) From 9c38d83e3c0de023730d91c5d6b967b4a5ee8388 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 20 Nov 2023 21:00:11 -0800 Subject: [PATCH 108/420] fix agent pool id not receiving new configuration value due to underlying behavior of computed attributes --- internal/provider/resource_tfe_workspace.go | 44 ++++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 4c211a14c..188384e70 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -636,8 +636,16 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } if (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || d.HasChange("setting_overwrites") { - if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { - options.AgentPoolID = tfe.String(v.(string)) + // Need the raw configuration value of the agent_pool_id because when the workspace's execution mode is set + // to default, we can't know for certain what the default value of the agent pool will be. This means we can + // only set the agent_pool_id as "NewComputed", meaning that the value returned by the ResourceData will be + // whatever the agent_pool_id was in the state + agentPoolID := d.GetRawConfig().GetAttr("agent_pool_id") + + // If the agent pool ID was not provided or did not change, the changes made to the execution mode will + // be sufficient + if !agentPoolID.IsNull() { + options.AgentPoolID = tfe.String(agentPoolID.AsString()) // set setting overwrites options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ AgentPool: tfe.Bool(true), @@ -958,21 +966,26 @@ func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { settingOverwrites := v.([]interface{}) currentTfeSupportsSettingOverwrites = len(settingOverwrites) != 0 } - executionModeWasUnset := executionModeState != "remote" && operations.IsNull() && executionMode.IsNull() - if executionModeWasUnset && !currentTfeSupportsSettingOverwrites { - err := d.SetNew("execution_mode", "remote") - if err != nil { - return fmt.Errorf("failed to set execution_mode: %w", err) + agentPoolWasUnset := (agentPoolID.IsNull() || !agentPoolIDReadOk) && agentPoolIDState != "" + + // if current version of TFE does not support setting-overwrites, update the computed values if either of + // them have been set to a nil value + if !currentTfeSupportsSettingOverwrites { + if executionModeWasUnset { + err := d.SetNew("execution_mode", "remote") + if err != nil { + return fmt.Errorf("failed to set execution_mode: %w", err) + } } - } - agentPoolWasUnset := (agentPoolID.IsNull() || !agentPoolIDReadOk) && agentPoolIDState != "" - if agentPoolWasUnset && !currentTfeSupportsSettingOverwrites { - err := d.SetNew("agent_pool_id", nil) - if err != nil { - return fmt.Errorf("failed to clear agent_pool_id: %w", err) + if agentPoolWasUnset { + err := d.SetNew("agent_pool_id", nil) + if err != nil { + return fmt.Errorf("failed to clear agent_pool_id: %w", err) + } } + return nil } return nil @@ -983,8 +996,9 @@ func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) er executionMode, executionModeReadOk := configMap["execution_mode"] operations, operationsReadOk := configMap["operations"] - // if the execution mode is currently overwritten, but being set to default in the current config, make sure that - // the setting overwrites will be set to false + // if the execution mode was previously overwritten, but being set to default in the current config, make sure that + // the setting overwrites will be set to false and the execution_mode and agent_pool_id are set to computed as we + // are not able to tell what the default execution mode is until after we update the workspace if executionMode.IsNull() && operations.IsNull() { if v, ok := d.GetOk("setting_overwrites"); ok { settingOverwrites := v.([]interface{})[0].(map[string]interface{}) From 37019aaf0cf5f4faf3344c6176f1b9f4276fe389 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 21 Nov 2023 09:58:23 -0800 Subject: [PATCH 109/420] simplify test helper by removing unnecessary cleanup --- internal/provider/testing.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/internal/provider/testing.go b/internal/provider/testing.go index 7271c8fd4..ae4510774 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -132,7 +132,7 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza func createBusinessOrganizationWithAgentDefaultExecutionMode(t *testing.T, tfeClient *tfe.Client) (*tfe.Organization, *tfe.AgentPool, func()) { org, orgCleanup := createBusinessOrganization(t, tfeClient) - agentPool, agentPoolCleanup := createAgentPool(t, tfeClient, org) + agentPool, _ := createAgentPool(t, tfeClient, org) // update organization to use default execution mode of "agent" org, err := tfeClient.Organizations.Update(context.Background(), org.Name, tfe.OrganizationUpdateOptions{ @@ -144,16 +144,6 @@ func createBusinessOrganizationWithAgentDefaultExecutionMode(t *testing.T, tfeCl } return org, agentPool, func() { - org, err = tfeClient.Organizations.Update(context.Background(), org.Name, tfe.OrganizationUpdateOptions{ - DefaultExecutionMode: tfe.String("remote"), - DefaultAgentPool: nil, - }) - if err != nil { - err = fmt.Errorf("failure occurred while trying to unlink organization from agent pool: %w", err) - t.Fatal(err) - } - - agentPoolCleanup() orgCleanup() } } From 3ba64e4a1f725226f1f91026707983cb51265b1a Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Wed, 8 Nov 2023 22:38:23 +0200 Subject: [PATCH 110/420] [d/tfe_organization] Make `name` attribute optional if configured for the provider --- CHANGELOG.md | 1 + internal/provider/data_source_organization.go | 3 ++- website/docs/d/organization.html.markdown | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e991fc9fb..2f08b37bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) +* `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) ## v0.50.0 diff --git a/internal/provider/data_source_organization.go b/internal/provider/data_source_organization.go index 8456d0e19..a8de9ba16 100644 --- a/internal/provider/data_source_organization.go +++ b/internal/provider/data_source_organization.go @@ -18,7 +18,7 @@ func dataSourceTFEOrganization() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, - Required: true, + Optional: true, }, "external_id": { @@ -88,6 +88,7 @@ func dataSourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) err log.Printf("[DEBUG] Setting Organization Attributes") d.SetId(org.ExternalID) + d.Set("name", org.Name) d.Set("external_id", org.ExternalID) d.Set("collaborator_auth_policy", org.CollaboratorAuthPolicy) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) diff --git a/website/docs/d/organization.html.markdown b/website/docs/d/organization.html.markdown index 86e2c9b4d..d74625c37 100644 --- a/website/docs/d/organization.html.markdown +++ b/website/docs/d/organization.html.markdown @@ -20,13 +20,12 @@ data "tfe_organization" "foo" { ## Argument Reference The following arguments are supported: -* `name` - (Required) Name of the organization. +* `name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `name` - Name of the organization. * `email` - Admin email address. * `external_id` - An identifier for the organization. * `assessments_enforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. From d18fdfe9c666f5cec749542fafc51674a4029111 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Wed, 8 Nov 2023 23:00:32 +0200 Subject: [PATCH 111/420] Convert the changelog item to enhancement --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f08b37bb..466eb3b52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) + +ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) ## v0.50.0 From 706dee8c20c78b969ad00d86b516a82b87e1bcd5 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 9 Nov 2023 12:13:39 -0800 Subject: [PATCH 112/420] d/tfe_organization: Add test case for omitting name and using default org --- .../provider/data_source_organization_test.go | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/internal/provider/data_source_organization_test.go b/internal/provider/data_source_organization_test.go index 5fb8bbbfd..d3d464c0c 100644 --- a/internal/provider/data_source_organization_test.go +++ b/internal/provider/data_source_organization_test.go @@ -6,6 +6,7 @@ package provider import ( "fmt" "math/rand" + "regexp" "testing" "time" @@ -63,6 +64,27 @@ func TestAccTFEOrganizationDataSource_defaultProject(t *testing.T) { }) } +// The data source will use the default org name from provider config if omitted. +func TestAccTFEOrganizationDataSource_defaultOrganization(t *testing.T) { + defaultOrgName, _ := setupDefaultOrganization(t) + providers := providerWithDefaultOrganization(defaultOrgName) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: providers, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationDataSourceConfig_noName(), + Check: resource.ComposeAggregateTestCheckFunc( + // check data attrs + resource.TestCheckResourceAttr("data.tfe_organization.foo", "name", defaultOrgName), + resource.TestMatchResourceAttr("data.tfe_organization.foo", "email", regexp.MustCompile(`@tfe\.local\z`)), + ), + }, + }, + }) +} + func testAccTFEOrganizationDataSourceConfig_basic(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foo" { @@ -75,3 +97,9 @@ data "tfe_organization" "foo" { depends_on = [tfe_organization.foo] }`, rInt) } + +func testAccTFEOrganizationDataSourceConfig_noName() string { + return ` +data "tfe_organization" "foo" { +}` +} From 6bcb82d8b44abee50fd381f13af18cb835496ef0 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Thu, 23 Nov 2023 14:36:04 -0500 Subject: [PATCH 113/420] upgrade go-tfe to v1.40.0 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d22cacf3d..d2bc95335 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.2 - github.com/hashicorp/go-tfe v1.39.2 + github.com/hashicorp/go-tfe v1.40.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.18.0 // indirect diff --git a/go.sum b/go.sum index 390f79150..13c45d6cc 100644 --- a/go.sum +++ b/go.sum @@ -62,6 +62,8 @@ github.com/hashicorp/go-slug v0.13.2 h1:ArlarJ8w1Rinx4P1N6Sr00t+GmjJWtYZuSEDYPQB github.com/hashicorp/go-slug v0.13.2/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= github.com/hashicorp/go-tfe v1.39.2 h1:2RrFa6UWEJghQVl248Avd9TJE+ii3NqDD75jBEcr/Tg= github.com/hashicorp/go-tfe v1.39.2/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= +github.com/hashicorp/go-tfe v1.40.0 h1:xgR/ijk5XAAo4jQHIOrKnIJrc4iM0jjYPskKgf4eDTU= +github.com/hashicorp/go-tfe v1.40.0/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From e11176792af89f587ee85a7acc3fbadf241550a6 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 27 Nov 2023 00:14:09 +0000 Subject: [PATCH 114/420] cdktf: update r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_module.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown --- .../python/r/registry_module.html.markdown | 49 ++++++++++++++++- .../r/registry_module.html.markdown | 53 ++++++++++++++++++- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index ce18cb42c..e73e4f3da 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -49,6 +49,47 @@ class MyConvertedCode(TerraformStack): ) ``` +Create private registry module with tests enabled: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test_organization = Organization(self, "test-organization", + email="admin@company.com", + name="my-org-name" + ) + test_oauth_client = OauthClient(self, "test-oauth-client", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token="my-vcs-provider-token", + organization=test_organization.name, + service_provider="github" + ) + RegistryModule(self, "test-registry-module", + test_config=[{ + "tests_enabled": True + } + ], + vcs_repo=RegistryModuleVcsRepo( + branch="main", + display_identifier="my-org-name/terraform-provider-name", + identifier="my-org-name/terraform-provider-name", + oauth_token_id=test_oauth_client.oauth_token_id + ) + ) +``` + Create private registry module with GitHub App: ```python @@ -182,6 +223,9 @@ The following arguments are supported: * `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. * `registry_name` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +The `test_config` block supports +* `tests_enabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `vcs_repo` block supports: * `display_identifier` - (Required) The display identifier for your VCS repository. @@ -192,6 +236,8 @@ The `vcs_repo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. +* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. ## Attributes Reference @@ -200,6 +246,7 @@ The `vcs_repo` block supports: * `name` - The name of registry module. * `organization` - The name of the organization associated with the registry module. * `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `publishing_mechanism` - The publishing mechanism used when releasing new versions of the module. * `registry_name` - The registry name of the registry module depicting whether the registry module is private or public. * `no_code` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. @@ -218,4 +265,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 8beaff161..26f219159 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -52,6 +52,51 @@ class MyConvertedCode extends TerraformStack { ``` +Create private registry module with tests enabled: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testOauthClient = new OauthClient(this, "test-oauth-client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: testOrganization.name, + serviceProvider: "github", + }); + new RegistryModule(this, "test-registry-module", { + test_config: [ + { + tests_enabled: true, + }, + ], + vcsRepo: { + branch: "main", + displayIdentifier: "my-org-name/terraform-provider-name", + identifier: "my-org-name/terraform-provider-name", + oauthTokenId: testOauthClient.oauthTokenId, + }, + }); + } +} + +``` + Create private registry module with GitHub App: ```typescript @@ -205,6 +250,9 @@ The following arguments are supported: * `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. * `registryName` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +The `testConfig` block supports +* `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `vcsRepo` block supports: * `displayIdentifier` - (Required) The display identifier for your VCS repository. @@ -215,6 +263,8 @@ The `vcsRepo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. +* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. ## Attributes Reference @@ -223,6 +273,7 @@ The `vcsRepo` block supports: * `name` - The name of registry module. * `organization` - The name of the organization associated with the registry module. * `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `publishingMechanism` - The publishing mechanism used when releasing new versions of the module. * `registryName` - The registry name of the registry module depicting whether the registry module is private or public. * `noCode` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. @@ -241,4 +292,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file From d3a3bce20c26206d13d6a7857b9c7fb8f2d9ef27 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 27 Nov 2023 00:14:35 +0000 Subject: [PATCH 115/420] cdktf: update d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- website/docs/cdktf/python/d/organization.html.markdown | 5 ++--- website/docs/cdktf/typescript/d/organization.html.markdown | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index afd3d171d..aedc4bc3f 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -33,13 +33,12 @@ class MyConvertedCode(TerraformStack): ## Argument Reference The following arguments are supported: -* `name` - (Required) Name of the organization. +* `name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `name` - Name of the organization. * `email` - Admin email address. * `external_id` - An identifier for the organization. * `assessments_enforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. @@ -48,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 71a333d7c..977899962 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -36,13 +36,12 @@ class MyConvertedCode extends TerraformStack { ## Argument Reference The following arguments are supported: -* `name` - (Required) Name of the organization. +* `name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `name` - Name of the organization. * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. @@ -51,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file From 8434052e74737a506046fc56337a778044bc6ba5 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Mon, 27 Nov 2023 10:54:50 -0500 Subject: [PATCH 116/420] remove old go-tfe version --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 13c45d6cc..3e2279893 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,6 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.2 h1:ArlarJ8w1Rinx4P1N6Sr00t+GmjJWtYZuSEDYPQBErA= github.com/hashicorp/go-slug v0.13.2/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.39.2 h1:2RrFa6UWEJghQVl248Avd9TJE+ii3NqDD75jBEcr/Tg= -github.com/hashicorp/go-tfe v1.39.2/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= github.com/hashicorp/go-tfe v1.40.0 h1:xgR/ijk5XAAo4jQHIOrKnIJrc4iM0jjYPskKgf4eDTU= github.com/hashicorp/go-tfe v1.40.0/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 9afcb161262f61cd07df0e772c577bdb17670f69 Mon Sep 17 00:00:00 2001 From: Eli Skeggs <1348991+skeggse@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:32:23 -0700 Subject: [PATCH 117/420] fix(tfe_policy): update query if changed --- internal/provider/resource_tfe_policy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_policy.go b/internal/provider/resource_tfe_policy.go index d69173329..692347901 100644 --- a/internal/provider/resource_tfe_policy.go +++ b/internal/provider/resource_tfe_policy.go @@ -264,7 +264,7 @@ func resourceTFEPolicyUpdate(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) // nolint:nestif - if d.HasChange("description") || d.HasChange("enforce_mode") { + if d.HasChange("description") || d.HasChange("enforce_mode") || d.HasChange("query") { // Create a new options struct. options := tfe.PolicyUpdateOptions{} @@ -288,6 +288,10 @@ func resourceTFEPolicyUpdate(d *schema.ResourceData, meta interface{}) error { } } + if query, ok := d.HasChange("query"); ok { + options.Query = tfe.String(query.(string)) + } + log.Printf("[DEBUG] Update configuration for %s policy: %s", vKind, d.Id()) _, err := config.Client.Policies.Update(ctx, d.Id(), options) if err != nil { From 2df51e1db1cc1a56f03a8eef7b3e11d851d31f40 Mon Sep 17 00:00:00 2001 From: Eli Skeggs <1348991+skeggse@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:35:40 -0700 Subject: [PATCH 118/420] docs: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 466eb3b52..5ffb3d8d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ +BUG FIXES: +* `r/tfe_policy`: Fix the provider ignoring updates to the `query` field, by @skeggse [1108](https://github.com/hashicorp/terraform-provider-tfe/pull/1108) + FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) From 6eb8f5e0c9011f3dd61c1dac86fadd437f6904d8 Mon Sep 17 00:00:00 2001 From: Eli Skeggs <1348991+skeggse@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:38:20 -0700 Subject: [PATCH 119/420] fix deref --- internal/provider/resource_tfe_policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_policy.go b/internal/provider/resource_tfe_policy.go index 692347901..b5b772ab3 100644 --- a/internal/provider/resource_tfe_policy.go +++ b/internal/provider/resource_tfe_policy.go @@ -288,7 +288,7 @@ func resourceTFEPolicyUpdate(d *schema.ResourceData, meta interface{}) error { } } - if query, ok := d.HasChange("query"); ok { + if query, ok := d.GetOk("query"); ok { options.Query = tfe.String(query.(string)) } From c01b923ffd09695ca385cd9622a0fe539fe4bdb7 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 27 Nov 2023 11:53:04 -0700 Subject: [PATCH 120/420] Remove skipUnlessBeta from tfe_policy tests --- internal/provider/resource_tfe_policy_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index 7bb0f4418..cd144f4ed 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -13,7 +13,6 @@ import ( ) func TestAccTFEPolicy_basic(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -52,7 +51,6 @@ func TestAccTFEPolicy_basic(t *testing.T) { } func TestAccTFEPolicy_basicWithDefaults(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -91,7 +89,6 @@ func TestAccTFEPolicy_basicWithDefaults(t *testing.T) { } func TestAccTFEPolicyOPA_basic(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -132,7 +129,6 @@ func TestAccTFEPolicyOPA_basic(t *testing.T) { } func TestAccTFEPolicy_update(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -244,7 +240,6 @@ func TestAccTFEPolicy_unsetEnforce(t *testing.T) { } func TestAccTFEPolicyOPA_update(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -304,7 +299,6 @@ func TestAccTFEPolicyOPA_update(t *testing.T) { } func TestAccTFEPolicy_import(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) From 9eab95ba1dbde365e5d9f14d4f4d2d09cf04c303 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 27 Nov 2023 11:16:29 -0800 Subject: [PATCH 121/420] r/tfe_policy test: Include OPA query in the "real" attributes check Failing to update this was a real provider bug. --- internal/provider/resource_tfe_policy_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index cd144f4ed..3f8876a05 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -287,9 +287,9 @@ func TestAccTFEPolicyOPA_update(t *testing.T) { resource.TestCheckResourceAttr( "tfe_policy.foobar", "description", "An updated test policy"), resource.TestCheckResourceAttr( - "tfe_policy.foobar", "policy", "package example rule[\"not allowed\"] { true }"), + "tfe_policy.foobar", "policy", "package example ruler[\"not allowed\"] { true }"), resource.TestCheckResourceAttr( - "tfe_policy.foobar", "query", "data.example.rule"), + "tfe_policy.foobar", "query", "data.example.ruler"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "enforce_mode", "advisory"), ), @@ -382,6 +382,10 @@ func testAccCheckTFEOPAPolicyAttributes( return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } + if *policy.Query != "data.example.rule" { + return fmt.Errorf("Bad OPA query string: %s", *policy.Query) + } + return nil } } @@ -432,6 +436,10 @@ func testAccCheckTFEOPAPolicyAttributesUpdated( return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } + if *policy.Query != "data.example.ruler" { + return fmt.Errorf("Bad OPA query string: %s", *policy.Query) + } + return nil } } @@ -519,8 +527,8 @@ resource "tfe_policy" "foobar" { description = "An updated test policy" organization = "%s" kind = "opa" - policy = "package example rule[\"not allowed\"] { true }" - query = "data.example.rule" + policy = "package example ruler[\"not allowed\"] { true }" + query = "data.example.ruler" enforce_mode = "advisory" }`, organization) } From 2724aeb06b1476625e8e6b7f11abc80255622af0 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 27 Nov 2023 11:18:05 -0800 Subject: [PATCH 122/420] r/tfe_policy test: check downloaded policy content too Another spot where these tests weren't sufficiently paranoid, although in this case we aren't aware of a bug in the wild. --- internal/provider/resource_tfe_policy_test.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index 3f8876a05..254c14a1b 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -150,6 +150,7 @@ func TestAccTFEPolicy_update(t *testing.T) { testAccCheckTFEPolicyExists( "tfe_policy.foobar", policy), testAccCheckTFEPolicyAttributes(policy), + testAccCheckTFEPolicyContent(policy, "main = rule { true }"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "name", "policy-test"), resource.TestCheckResourceAttr( @@ -169,6 +170,7 @@ func TestAccTFEPolicy_update(t *testing.T) { testAccCheckTFEPolicyExists( "tfe_policy.foobar", policy), testAccCheckTFEPolicyAttributesUpdated(policy), + testAccCheckTFEPolicyContent(policy, "main = rule { false }"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "name", "policy-test"), resource.TestCheckResourceAttr( @@ -261,6 +263,7 @@ func TestAccTFEPolicyOPA_update(t *testing.T) { testAccCheckTFEPolicyExists( "tfe_policy.foobar", policy), testAccCheckTFEOPAPolicyAttributes(policy), + testAccCheckTFEPolicyContent(policy, "package example rule[\"not allowed\"] { false }"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "name", "policy-test"), resource.TestCheckResourceAttr( @@ -282,6 +285,7 @@ func TestAccTFEPolicyOPA_update(t *testing.T) { testAccCheckTFEPolicyExists( "tfe_policy.foobar", policy), testAccCheckTFEOPAPolicyAttributesUpdated(policy), + testAccCheckTFEPolicyContent(policy, "package example ruler[\"not allowed\"] { true }"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "name", "policy-test"), resource.TestCheckResourceAttr( @@ -356,6 +360,22 @@ func testAccCheckTFEPolicyExists( } } +func testAccCheckTFEPolicyContent(policy *tfe.Policy, content string) resource.TestCheckFunc { + return func(_ *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + b, err := config.Client.Policies.Download(ctx, policy.ID) + if err != nil { + return err + } + s := string(b) + if s != content { + return fmt.Errorf("Policy content didn't match. Expected: %q; got: %q", content, s) + } + return nil + } +} + func testAccCheckTFEPolicyAttributes( policy *tfe.Policy) resource.TestCheckFunc { return func(s *terraform.State) error { From 6aa39dac893de20ddd7436411babd385107d8633 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 27 Nov 2023 12:24:51 -0800 Subject: [PATCH 123/420] Lint: Wrap foreign error before returning it --- internal/provider/resource_tfe_policy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index 254c14a1b..4cae5c23f 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -366,7 +366,7 @@ func testAccCheckTFEPolicyContent(policy *tfe.Policy, content string) resource.T b, err := config.Client.Policies.Download(ctx, policy.ID) if err != nil { - return err + return fmt.Errorf("Problem downloading policy content: %w", err) } s := string(b) if s != content { From 9d1b0d4f90b8533366aecdb31dc2f93a18efcc60 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 27 Nov 2023 12:44:23 -0800 Subject: [PATCH 124/420] add import docs --- .../r/tfe_organization_default_execution_mode.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/docs/r/tfe_organization_default_execution_mode.html.markdown b/website/docs/r/tfe_organization_default_execution_mode.html.markdown index 9afc135fc..88448c323 100644 --- a/website/docs/r/tfe_organization_default_execution_mode.html.markdown +++ b/website/docs/r/tfe_organization_default_execution_mode.html.markdown @@ -45,4 +45,8 @@ The following arguments are supported: ## Import -This resource does not manage the creation of an organization and there is no need to import it. \ No newline at end of file +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` \ No newline at end of file From ca721a3c3675db1fa90e095a7f559986e4bea5e6 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Mon, 27 Nov 2023 12:48:11 -0800 Subject: [PATCH 125/420] add note in changelog about execution_mode default changing --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 049b1d817..51900c56a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ +BREAKING CHANGES: +* `r/tfe_workspace`: Default value of the `execution_mode` field now uses the organization's `default_execution_mode`. If no `default_execution_mode` has been set, the default `execution_mode` will be unchanged (i.e. `remote`). + FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' From 39b81cd0e3988a37e78ae8e5e9f51fd9cc79d00b Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Mon, 27 Nov 2023 16:37:45 -0800 Subject: [PATCH 126/420] tfe_policy test: Actually test the problematic case The prior attempt at updating the test passed when it shouldn't have, because changing the query _at the same time as other attributes_ has always worked; the problematic case was changing the query _without changing the description or enforce mode._ So add a test step (and config, and check func, and and and) to validate that. --- internal/provider/resource_tfe_policy_test.go | 61 +++++++++++++++++-- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index 4cae5c23f..f0def6962 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -280,11 +280,32 @@ func TestAccTFEPolicyOPA_update(t *testing.T) { }, { - Config: testAccTFEPolicyOPA_update(org.Name), + Config: testAccTFEPolicyOPA_updateQuery(org.Name), Check: resource.ComposeTestCheckFunc( testAccCheckTFEPolicyExists( "tfe_policy.foobar", policy), - testAccCheckTFEOPAPolicyAttributesUpdated(policy), + testAccCheckTFEOPAPolicyAttributesUpdatedQuery(policy), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "name", "policy-test"), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "description", "A test policy"), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "kind", "opa"), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "policy", "package example rule[\"not allowed\"] { false }"), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "query", "data.example.ruler"), + resource.TestCheckResourceAttr( + "tfe_policy.foobar", "enforce_mode", "mandatory"), + ), + }, + + { + Config: testAccTFEPolicyOPA_updateAll(org.Name), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEPolicyExists( + "tfe_policy.foobar", policy), + testAccCheckTFEOPAPolicyAttributesUpdatedAll(policy), testAccCheckTFEPolicyContent(policy, "package example ruler[\"not allowed\"] { true }"), resource.TestCheckResourceAttr( "tfe_policy.foobar", "name", "policy-test"), @@ -445,7 +466,26 @@ func testAccCheckTFEPolicyAttributesUpdated( } } -func testAccCheckTFEOPAPolicyAttributesUpdated( +func testAccCheckTFEOPAPolicyAttributesUpdatedQuery( + policy *tfe.Policy) resource.TestCheckFunc { + return func(s *terraform.State) error { + if policy.Name != "policy-test" { + return fmt.Errorf("Bad name: %s", policy.Name) + } + + if policy.Enforce[0].Mode != "mandatory" { + return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) + } + + if *policy.Query != "data.example.ruler" { + return fmt.Errorf("Bad OPA query string: %s", *policy.Query) + } + + return nil + } +} + +func testAccCheckTFEOPAPolicyAttributesUpdatedAll( policy *tfe.Policy) resource.TestCheckFunc { return func(s *terraform.State) error { if policy.Name != "policy-test" { @@ -540,7 +580,20 @@ func testAccTFEPolicy_emptyEnforce(organization string) string { }`, organization) } -func testAccTFEPolicyOPA_update(organization string) string { +func testAccTFEPolicyOPA_updateQuery(organization string) string { + return fmt.Sprintf(` +resource "tfe_policy" "foobar" { + name = "policy-test" + description = "A test policy" + organization = "%s" + kind = "opa" + policy = "package example rule[\"not allowed\"] { false }" + query = "data.example.ruler" + enforce_mode = "mandatory" +}`, organization) +} + +func testAccTFEPolicyOPA_updateAll(organization string) string { return fmt.Sprintf(` resource "tfe_policy" "foobar" { name = "policy-test" From ceedcd9857d3afc85e90d8e36dbdce242ce9e884 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 29 Nov 2023 09:07:48 -0500 Subject: [PATCH 127/420] conflict --- internal/provider/provider.go | 1 + .../resource_tfe_project_oauth_client_.go | 173 +++++++++++++++++ .../resource_tfe_project_oauth_client_test.go | 176 ++++++++++++++++++ .../docs/r/project_oauth_client.html.markdown | 58 ++++++ 4 files changed, 408 insertions(+) create mode 100644 internal/provider/resource_tfe_project_oauth_client_.go create mode 100644 internal/provider/resource_tfe_project_oauth_client_test.go create mode 100644 website/docs/r/project_oauth_client.html.markdown diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c5abaac2d..6052033fc 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -112,6 +112,7 @@ func Provider() *schema.Provider { "tfe_agent_token": resourceTFEAgentToken(), "tfe_notification_configuration": resourceTFENotificationConfiguration(), "tfe_oauth_client": resourceTFEOAuthClient(), + "tfe_project_oauth_client": resourceTFEProjectOAuthClient(), "tfe_organization": resourceTFEOrganization(), "tfe_organization_default_execution_mode": resourceTFEOrganizationDefaultExecutionMode(), "tfe_organization_membership": resourceTFEOrganizationMembership(), diff --git a/internal/provider/resource_tfe_project_oauth_client_.go b/internal/provider/resource_tfe_project_oauth_client_.go new file mode 100644 index 000000000..dff338e09 --- /dev/null +++ b/internal/provider/resource_tfe_project_oauth_client_.go @@ -0,0 +1,173 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "errors" + "fmt" + "log" + "strings" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceTFEProjectOAuthClient() *schema.Resource { + return &schema.Resource{ + Create: resourceTFEProjectOauthClientCreate, + Read: resourceTFEProjectOauthClientRead, + Delete: resourceTFEProjectOauthClientDelete, + Importer: &schema.ResourceImporter{ + StateContext: resourceTFEProjectOauthClientImporter, + }, + + Schema: map[string]*schema.Schema{ + "oauth_client_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + } +} + +func resourceTFEProjectOauthClientCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + oauthClientID := d.Get("oauth_client_id").(string) + projectID := d.Get("project_id").(string) + + oauthClientAddProjectsOptions := tfe.OAuthClientAddProjectsOptions{} + oauthClientAddProjectsOptions.Projects = append(oauthClientAddProjectsOptions.Projects, &tfe.Project{ID: projectID}) + + err := config.Client.OAuthClients.AddProjects(ctx, oauthClientID, oauthClientAddProjectsOptions) + if err != nil { + return fmt.Errorf( + "error attaching oauth client id %s to project %s: %w", oauthClientID, projectID, err) + } + + d.SetId(fmt.Sprintf("%s_%s", projectID, oauthClientID)) + + return resourceTFEProjectOauthClientRead(d, meta) +} + +func resourceTFEProjectOauthClientRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + oauthClientID := d.Get("oauth_client_id").(string) + projectID := d.Get("project_id").(string) + + log.Printf("[DEBUG] Read configuration of project oauth client: %s", oauthClientID) + oauthClient, err := config.Client.OAuthClients.ReadWithOptions(ctx, oauthClientID, &tfe.OAuthClientReadOptions{ + Include: []tfe.OAuthClientIncludeOpt{tfe.OauthClientProjects}, + }) + if err != nil { + if errors.Is(err, tfe.ErrResourceNotFound) { + log.Printf("[DEBUG] Oauth client %s no longer exists", oauthClientID) + d.SetId("") + return nil + } + return fmt.Errorf("error reading configuration of oauth client %s: %w", oauthClientID, err) + } + + isProjectAttached := false + for _, project := range oauthClient.Projects { + if project.ID == projectID { + isProjectAttached = true + d.Set("project_id", projectID) + break + } + } + + if !isProjectAttached { + log.Printf("[DEBUG] Project %s not attached to oauth client %s. Removing from state.", projectID, oauthClientID) + d.SetId("") + return nil + } + + d.Set("oauth_client_id", oauthClientID) + return nil +} + +func resourceTFEProjectOauthClientDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + oauthClientID := d.Get("oauth_client_id").(string) + projectID := d.Get("project_id").(string) + + log.Printf("[DEBUG] Detaching project (%s) from oauth client (%s)", projectID, oauthClientID) + oauthClientRemoveProjectsOptions := tfe.OAuthClientRemoveProjectsOptions{} + oauthClientRemoveProjectsOptions.Projects = append(oauthClientRemoveProjectsOptions.Projects, &tfe.Project{ID: projectID}) + + err := config.Client.OAuthClients.RemoveProjects(ctx, oauthClientID, oauthClientRemoveProjectsOptions) + if err != nil { + return fmt.Errorf( + "error detaching project %s from oauth client %s: %w", projectID, oauthClientID, err) + } + + return nil +} + +func resourceTFEProjectOauthClientImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + // The format of the import ID is + splitID := strings.SplitN(d.Id(), "/", 3) + if len(splitID) != 3 { + return nil, fmt.Errorf( + "invalid project oauth client input format: %s (expected //)", + splitID, + ) + } + + organization, projectID, oauthClientName := splitID[0], splitID[1], splitID[2] + + config := meta.(ConfiguredClient) + + // Ensure the named project exists before fetching all the oauth clients in the org + _, err := config.Client.Projects.Read(ctx, projectID) + if err != nil { + return nil, fmt.Errorf("error reading configuration of project %s in organization %s: %w", projectID, organization, err) + } + + options := &tfe.OAuthClientListOptions{Include: []tfe.OAuthClientIncludeOpt{tfe.OauthClientProjects}} + for { + list, err := config.Client.OAuthClients.List(ctx, organization, options) + if err != nil { + return nil, fmt.Errorf("error retrieving organization's list of oauth clients: %w", err) + } + for _, oauthClient := range list.Items { + if *oauthClient.Name != oauthClientName { + continue + } + + for _, project := range oauthClient.Projects { + if project.ID != projectID { + continue + } + + d.Set("project_id", project.ID) + d.Set("oauth_client_id", oauthClient.ID) + d.SetId(fmt.Sprintf("%s_%s", project.ID, oauthClient.ID)) + + return []*schema.ResourceData{d}, nil + } + } + + // Exit the loop when we've seen all pages. + if list.CurrentPage >= list.TotalPages { + break + } + + // Update the page number to get the next page. + options.PageNumber = list.NextPage + } + + return nil, fmt.Errorf("project %s has not been assigned to oauth client %s", projectID, oauthClientName) +} diff --git a/internal/provider/resource_tfe_project_oauth_client_test.go b/internal/provider/resource_tfe_project_oauth_client_test.go new file mode 100644 index 000000000..98914fc9f --- /dev/null +++ b/internal/provider/resource_tfe_project_oauth_client_test.go @@ -0,0 +1,176 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "regexp" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFEProjectOAuthClient_basic(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, orgCleanup := createOrganization(t, tfeClient, tfe.OrganizationCreateOptions{ + Name: tfe.String(fmt.Sprintf("tst-terraform-%d", rInt)), + Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), + }) + t.Cleanup(orgCleanup) + + // Make a project + project := createProject(t, tfeClient, org.Name, tfe.ProjectCreateOptions{ + Name: randomString(t), + }) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEProjectOAuthClientDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEProjectOAuthClient_basic(org.Name, project.ID), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEProjectOAuthClientExists( + "tfe_project_oauth_client.test"), + ), + }, + { + ResourceName: "tfe_project_oauth_client.test", + ImportState: true, + ImportStateId: fmt.Sprintf("%s/%s/oauth_client_test", org.Name, project.ID), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, orgCleanup := createOrganization(t, tfeClient, tfe.OrganizationCreateOptions{ + Name: tfe.String(fmt.Sprintf("tst-terraform-%d", rInt)), + Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), + }) + t.Cleanup(orgCleanup) + + // Make a project + project := createProject(t, tfeClient, org.Name, tfe.ProjectCreateOptions{ + Name: randomString(t), + }) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEProjectOAuthClient_basic(org.Name, project.ID), + }, + { + ResourceName: "tfe_project_oauth_client.test", + ImportState: true, + ImportStateId: fmt.Sprintf("%s/tst-terraform-%d", org.Name, rInt), + ExpectError: regexp.MustCompile(`Error: invalid project oauth client input format`), + }, + }, + }) +} + +func testAccCheckTFEProjectOAuthClientExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("not found: %s", n) + } + + id := rs.Primary.ID + if id == "" { + return fmt.Errorf("no ID is set") + } + + oauthClientID := rs.Primary.Attributes["oauth_client_id"] + if oauthClientID == "" { + return fmt.Errorf("no oauth client id set") + } + + projectID := rs.Primary.Attributes["project_id"] + if projectID == "" { + return fmt.Errorf("no project id set") + } + + oauthClient, err := config.Client.OAuthClients.ReadWithOptions(ctx, oauthClientID, &tfe.OAuthClientReadOptions{ + Include: []tfe.OAuthClientIncludeOpt{tfe.OauthClientProjects}, + }) + if err != nil { + return fmt.Errorf("error reading oauth client %s: %w", oauthClientID, err) + } + for _, project := range oauthClient.Projects { + if project.ID == projectID { + return nil + } + } + + return fmt.Errorf("project (%s) is not attached to oauth client (%s).", projectID, oauthClientID) + } +} + +func testAccCheckTFEProjectOAuthClientDestroy(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_oauth_client" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("no instance ID is set") + } + + _, err := config.Client.OAuthClients.Read(ctx, rs.Primary.ID) + if err == nil { + return fmt.Errorf("oauth client %s still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccTFEProjectOAuthClient_base(orgName string) string { + return fmt.Sprintf(` + resource "tfe_oauth_client" "test" { + name = "oauth_client_test" + organization = "%s" + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" + } + `, orgName, envGithubToken) +} + +func testAccTFEProjectOAuthClient_basic(orgName string, prjID string) string { + return testAccTFEProjectOAuthClient_base(orgName) + fmt.Sprintf(` + resource "tfe_project_oauth_client" "test" { + oauth_client_id = tfe_oauth_client.test.id + project_id = "%s" + } + `, prjID) +} diff --git a/website/docs/r/project_oauth_client.html.markdown b/website/docs/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..7d3f395a7 --- /dev/null +++ b/website/docs/r/project_oauth_client.html.markdown @@ -0,0 +1,58 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_project" "test" { + name = "my-project-name" + organization = tfe_organization.test.name +} + +resource "tfe_oauth_client" "test" { + organization = tfe_organization.test + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "oauth_token_id" + service_provider = "github" +} + +resource "tfe_project_oauth_client" "test" { + oauth_client_id = tfe_oauth_client.test.id + project_id = tfe_project.test.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `oauth_client_id` - (Required) ID of the oauth client. +* `project_id` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` From 99e6e4fd535171c27af333303fe4cec230d9af3e Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 29 Nov 2023 09:11:18 -0500 Subject: [PATCH 128/420] conflict solved --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da6a3f18b..aca3eafcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' - +* **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) + **NOTE:** `r/tfe_project_oauth_client` resource is currently in beta and isn't generally available to all users. It is subject to change or removal. ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) From 8ee336f9bdcf77baef446a4c427b61ca37d7e6fe Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:12:34 -0500 Subject: [PATCH 129/420] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aca3eafcd..bce96e735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ FEATURES: * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) **NOTE:** `r/tfe_project_oauth_client` resource is currently in beta and isn't generally available to all users. It is subject to change or removal. + ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) From fb8fcc356cd52baf2561e593ee7b69619fdd7b08 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 29 Nov 2023 09:29:21 -0500 Subject: [PATCH 130/420] beta test --- internal/provider/resource_tfe_project_oauth_client_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/provider/resource_tfe_project_oauth_client_test.go b/internal/provider/resource_tfe_project_oauth_client_test.go index 98914fc9f..73f43c094 100644 --- a/internal/provider/resource_tfe_project_oauth_client_test.go +++ b/internal/provider/resource_tfe_project_oauth_client_test.go @@ -16,6 +16,7 @@ import ( ) func TestAccTFEProjectOAuthClient_basic(t *testing.T) { + skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -57,6 +58,7 @@ func TestAccTFEProjectOAuthClient_basic(t *testing.T) { } func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { + skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() From b2ff7cdbb3650fdbf2ad293b5e25be6eab3f1f9d Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 29 Nov 2023 11:09:40 -0500 Subject: [PATCH 131/420] organization_scoped --- CHANGELOG.md | 1 + .../provider/resource_tfe_oauth_client.go | 38 ++++++++++++++++--- .../resource_tfe_oauth_client_test.go | 3 ++ website/docs/r/oauth_client.html.markdown | 2 + 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da6a3f18b..64af38e9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' +* `r/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1142](https://github.com/hashicorp/terraform-provider-tfe/pull/1142) ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index b801242ee..f8cc060dd 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -17,6 +17,7 @@ func resourceTFEOAuthClient() *schema.Resource { Create: resourceTFEOAuthClientCreate, Read: resourceTFEOAuthClientRead, Delete: resourceTFEOAuthClientDelete, + Update: resourceTFEOAuthClientUpdate, Schema: map[string]*schema.Schema{ "name": { @@ -104,6 +105,12 @@ func resourceTFEOAuthClient() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "organization_scoped": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, }, } } @@ -131,12 +138,13 @@ func resourceTFEOAuthClientCreate(d *schema.ResourceData, meta interface{}) erro // The tfe.OAuthClientCreateOptions has omitempty for these values, so if it // is empty, then it will be ignored in the create request options := tfe.OAuthClientCreateOptions{ - Name: tfe.String(name), - APIURL: tfe.String(d.Get("api_url").(string)), - HTTPURL: tfe.String(d.Get("http_url").(string)), - OAuthToken: tfe.String(d.Get("oauth_token").(string)), - Key: tfe.String(key), - ServiceProvider: tfe.ServiceProvider(serviceProvider), + Name: tfe.String(name), + APIURL: tfe.String(d.Get("api_url").(string)), + HTTPURL: tfe.String(d.Get("http_url").(string)), + OAuthToken: tfe.String(d.Get("oauth_token").(string)), + Key: tfe.String(key), + ServiceProvider: tfe.ServiceProvider(serviceProvider), + OrganizationScoped: tfe.Bool(d.Get("organization_scoped").(bool)), } if serviceProvider == tfe.ServiceProviderAzureDevOpsServer { @@ -181,6 +189,7 @@ func resourceTFEOAuthClientRead(d *schema.ResourceData, meta interface{}) error d.Set("api_url", oc.APIURL) d.Set("http_url", oc.HTTPURL) d.Set("service_provider", string(oc.ServiceProvider)) + d.Set("organization_scoped", oc.OrganizationScoped) switch len(oc.OAuthTokens) { case 0: @@ -208,3 +217,20 @@ func resourceTFEOAuthClientDelete(d *schema.ResourceData, meta interface{}) erro return nil } + +func resourceTFEOAuthClientUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + // Create a new options struct. + options := tfe.OAuthClientUpdateOptions{ + OrganizationScoped: tfe.Bool(d.Get("organization_scoped").(bool)), + } + + log.Printf("[DEBUG] Update agent pool: %s", d.Id()) + _, err := config.Client.OAuthClients.Update(ctx, d.Id(), options) + if err != nil { + return fmt.Errorf("Error updating oauth client %s: %w", d.Id(), err) + } + + return resourceTFEOAuthClientRead(d, meta) +} diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index a74ecc811..b6dc5ee8d 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -39,6 +39,8 @@ func TestAccTFEOAuthClient_basic(t *testing.T) { "tfe_oauth_client.foobar", "http_url", "https://github.com"), resource.TestCheckResourceAttr( "tfe_oauth_client.foobar", "service_provider", "github"), + resource.TestCheckResourceAttr( + "tfe_oauth_client.foobar", "organization_scoped", "true"), ), }, }, @@ -153,6 +155,7 @@ resource "tfe_oauth_client" "foobar" { http_url = "https://github.com" oauth_token = "%s" service_provider = "github" + organization_scoped = true }`, rInt, envGithubToken) } diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index a49da1736..00aec36b0 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -24,6 +24,7 @@ resource "tfe_oauth_client" "test" { http_url = "https://github.com" oauth_token = "my-vcs-provider-token" service_provider = "github" + organization_scoped = true } ``` @@ -89,6 +90,7 @@ Link. * `service_provider` - (Required) The VCS provider being connected with. Valid options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. +* `organization_scoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference From 0e4701876f275e716d26ea589085a6e46cceb999 Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:53:50 -0500 Subject: [PATCH 132/420] Update internal/provider/resource_tfe_oauth_client.go Co-authored-by: UKEME BASSEY --- internal/provider/resource_tfe_oauth_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index f8cc060dd..fb692bc5e 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -226,7 +226,7 @@ func resourceTFEOAuthClientUpdate(d *schema.ResourceData, meta interface{}) erro OrganizationScoped: tfe.Bool(d.Get("organization_scoped").(bool)), } - log.Printf("[DEBUG] Update agent pool: %s", d.Id()) + log.Printf("[DEBUG] Update OAuth client %s", d.Id()) _, err := config.Client.OAuthClients.Update(ctx, d.Id(), options) if err != nil { return fmt.Errorf("Error updating oauth client %s: %w", d.Id(), err) From 1972dc81022c1bc8837bc8cffeac44ca6734a0f8 Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:53:57 -0500 Subject: [PATCH 133/420] Update internal/provider/resource_tfe_oauth_client.go Co-authored-by: UKEME BASSEY --- internal/provider/resource_tfe_oauth_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index fb692bc5e..21d92189e 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -229,7 +229,7 @@ func resourceTFEOAuthClientUpdate(d *schema.ResourceData, meta interface{}) erro log.Printf("[DEBUG] Update OAuth client %s", d.Id()) _, err := config.Client.OAuthClients.Update(ctx, d.Id(), options) if err != nil { - return fmt.Errorf("Error updating oauth client %s: %w", d.Id(), err) + return fmt.Errorf("Error updating OAuth client %s: %w", d.Id(), err) } return resourceTFEOAuthClientRead(d, meta) From de5045e8bdae2144863bae1b32a68b44ee4d5f9f Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 29 Nov 2023 14:40:34 -0500 Subject: [PATCH 134/420] beta test --- .../resource_tfe_oauth_client_test.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index b6dc5ee8d..94daf1ea2 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -18,6 +18,38 @@ func TestAccTFEOAuthClient_basic(t *testing.T) { oc := &tfe.OAuthClient{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + if envGithubToken == "" { + t.Skip("Please set GITHUB_TOKEN to run this test") + } + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOAuthClientDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOAuthClient_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOAuthClientExists("tfe_oauth_client.foobar", oc), + testAccCheckTFEOAuthClientAttributes(oc), + resource.TestCheckResourceAttr( + "tfe_oauth_client.foobar", "api_url", "https://api.github.com"), + resource.TestCheckResourceAttr( + "tfe_oauth_client.foobar", "http_url", "https://github.com"), + resource.TestCheckResourceAttr( + "tfe_oauth_client.foobar", "service_provider", "github"), + ), + }, + }, + }) +} + +func TestAccTFEOAuthClientWithOrganizationScoped_basic(t *testing.T) { + skipUnlessBeta(t) + oc := &tfe.OAuthClient{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) From e59b7e844479a69f9407990febfa5ce4e4665824 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 4 Dec 2023 11:37:41 -0700 Subject: [PATCH 135/420] Fix no changes detected when provider default org changes --- internal/provider/provider_custom_diffs.go | 23 +++++++++++++++++++ ...esource_tfe_admin_organization_settings.go | 2 ++ internal/provider/resource_tfe_agent_pool.go | 2 ++ .../provider/resource_tfe_no_code_module.go | 2 ++ .../provider/resource_tfe_oauth_client.go | 2 ++ ...tfe_organization_default_execution_mode.go | 5 +++- .../resource_tfe_organization_membership.go | 2 ++ ...esource_tfe_organization_module_sharing.go | 3 +++ .../resource_tfe_organization_run_task.go | 2 ++ .../resource_tfe_organization_token.go | 2 ++ internal/provider/resource_tfe_policy.go | 2 ++ internal/provider/resource_tfe_policy_set.go | 2 ++ internal/provider/resource_tfe_project.go | 2 ++ .../provider/resource_tfe_registry_module.go | 2 ++ .../provider/resource_tfe_sentinel_policy.go | 2 ++ internal/provider/resource_tfe_ssh_key.go | 2 ++ .../provider/resource_tfe_variable_set.go | 2 ++ internal/provider/resource_tfe_workspace.go | 4 ++++ 18 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 internal/provider/provider_custom_diffs.go diff --git a/internal/provider/provider_custom_diffs.go b/internal/provider/provider_custom_diffs.go new file mode 100644 index 000000000..a18ccd72a --- /dev/null +++ b/internal/provider/provider_custom_diffs.go @@ -0,0 +1,23 @@ +package provider + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func customizeDiffIfProviderDefaultOrganizationChanged(c context.Context, diff *schema.ResourceDiff, meta interface{}) error { + config := meta.(ConfiguredClient) + + configOrg := diff.GetRawConfig().GetAttr("organization") + plannedOrg := diff.Get("organization").(string) + + if configOrg.IsNull() && config.Organization != plannedOrg { + // There is no organization configured on the resource, yet it is different from + // the state organization. We must conclude that the provider default organization changed. + if err := diff.SetNew("organization", config.Organization); err != nil { + return err + } + } + return nil +} diff --git a/internal/provider/resource_tfe_admin_organization_settings.go b/internal/provider/resource_tfe_admin_organization_settings.go index e4442fa0e..c44835940 100644 --- a/internal/provider/resource_tfe_admin_organization_settings.go +++ b/internal/provider/resource_tfe_admin_organization_settings.go @@ -19,6 +19,8 @@ func resourceTFEAdminOrganizationSettings() *schema.Resource { Update: resourceTFEAdminOrganizationSettingsUpdate, Delete: resourceTFEAdminOrganizationSettingsDelete, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_agent_pool.go b/internal/provider/resource_tfe_agent_pool.go index 4e5b6f8e1..03819d876 100644 --- a/internal/provider/resource_tfe_agent_pool.go +++ b/internal/provider/resource_tfe_agent_pool.go @@ -23,6 +23,8 @@ func resourceTFEAgentPool() *schema.Resource { StateContext: resourceTFEAgentPoolImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_no_code_module.go b/internal/provider/resource_tfe_no_code_module.go index 1d0248596..ef073f155 100644 --- a/internal/provider/resource_tfe_no_code_module.go +++ b/internal/provider/resource_tfe_no_code_module.go @@ -25,6 +25,8 @@ func resourceTFENoCodeModule() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index b801242ee..1528be804 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -18,6 +18,8 @@ func resourceTFEOAuthClient() *schema.Resource { Read: resourceTFEOAuthClientRead, Delete: resourceTFEOAuthClientDelete, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_organization_default_execution_mode.go b/internal/provider/resource_tfe_organization_default_execution_mode.go index a307f1565..3fb7ccb4f 100644 --- a/internal/provider/resource_tfe_organization_default_execution_mode.go +++ b/internal/provider/resource_tfe_organization_default_execution_mode.go @@ -4,10 +4,11 @@ import ( "context" "errors" "fmt" + "log" + tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "log" ) func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { @@ -19,6 +20,8 @@ func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { StateContext: resourceTFEOrganizationDefaultExecutionModeImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_organization_membership.go b/internal/provider/resource_tfe_organization_membership.go index 97e7b26b1..be760c66a 100644 --- a/internal/provider/resource_tfe_organization_membership.go +++ b/internal/provider/resource_tfe_organization_membership.go @@ -22,6 +22,8 @@ func resourceTFEOrganizationMembership() *schema.Resource { StateContext: resourceTFEOrganizationMembershipImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "email": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_organization_module_sharing.go b/internal/provider/resource_tfe_organization_module_sharing.go index 99ac039bd..717ff6abb 100644 --- a/internal/provider/resource_tfe_organization_module_sharing.go +++ b/internal/provider/resource_tfe_organization_module_sharing.go @@ -19,6 +19,9 @@ func resourceTFEOrganizationModuleSharing() *schema.Resource { Read: resourceTFEOrganizationModuleSharingRead, Update: resourceTFEOrganizationModuleSharingUpdate, Delete: resourceTFEOrganizationModuleSharingDelete, + + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_organization_run_task.go b/internal/provider/resource_tfe_organization_run_task.go index ae600b751..89ce048c7 100644 --- a/internal/provider/resource_tfe_organization_run_task.go +++ b/internal/provider/resource_tfe_organization_run_task.go @@ -24,6 +24,8 @@ func resourceTFEOrganizationRunTask() *schema.Resource { StateContext: resourceTFEOrganizationRunTaskImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_organization_token.go b/internal/provider/resource_tfe_organization_token.go index 21ddfcb29..497448f14 100644 --- a/internal/provider/resource_tfe_organization_token.go +++ b/internal/provider/resource_tfe_organization_token.go @@ -23,6 +23,8 @@ func resourceTFEOrganizationToken() *schema.Resource { StateContext: resourceTFEOrganizationTokenImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_policy.go b/internal/provider/resource_tfe_policy.go index b5b772ab3..8b2f5ab2d 100644 --- a/internal/provider/resource_tfe_policy.go +++ b/internal/provider/resource_tfe_policy.go @@ -26,6 +26,8 @@ func resourceTFEPolicy() *schema.Resource { StateContext: resourceTFEPolicyImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Description: "The name of the policy", diff --git a/internal/provider/resource_tfe_policy_set.go b/internal/provider/resource_tfe_policy_set.go index 8b96a0a9d..4190733e5 100644 --- a/internal/provider/resource_tfe_policy_set.go +++ b/internal/provider/resource_tfe_policy_set.go @@ -23,6 +23,8 @@ func resourceTFEPolicySet() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index 5bbf64573..a56b97cb8 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -28,6 +28,8 @@ func resourceTFEProject() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 9b2f9d2bc..0c95cf0bc 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -26,6 +26,8 @@ func resourceTFERegistryModule() *schema.Resource { StateContext: resourceTFERegistryModuleImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_sentinel_policy.go b/internal/provider/resource_tfe_sentinel_policy.go index 149f74596..2bbe0c0c5 100644 --- a/internal/provider/resource_tfe_sentinel_policy.go +++ b/internal/provider/resource_tfe_sentinel_policy.go @@ -25,6 +25,8 @@ func resourceTFESentinelPolicy() *schema.Resource { StateContext: resourceTFESentinelPolicyImporter, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_ssh_key.go b/internal/provider/resource_tfe_ssh_key.go index 86fdd6209..b8f5a6ca0 100644 --- a/internal/provider/resource_tfe_ssh_key.go +++ b/internal/provider/resource_tfe_ssh_key.go @@ -18,6 +18,8 @@ func resourceTFESSHKey() *schema.Resource { Update: resourceTFESSHKeyUpdate, Delete: resourceTFESSHKeyDelete, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_variable_set.go b/internal/provider/resource_tfe_variable_set.go index 34081ec1c..4242db62f 100644 --- a/internal/provider/resource_tfe_variable_set.go +++ b/internal/provider/resource_tfe_variable_set.go @@ -24,6 +24,8 @@ func resourceTFEVariableSet() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 188384e70..bf9cb6528 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -63,6 +63,10 @@ func resourceTFEWorkspace() *schema.Resource { return err } + if err := customizeDiffIfProviderDefaultOrganizationChanged(c, d, meta); err != nil { + return err + } + return nil }, From db9af9eec82ab0bbced62bee0c90b912f074b898 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 4 Dec 2023 12:03:15 -0700 Subject: [PATCH 136/420] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da6a3f18b..28f9b4f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ BREAKING CHANGES: BUG FIXES: * `r/tfe_policy`: Fix the provider ignoring updates to the `query` field, by @skeggse [1108](https://github.com/hashicorp/terraform-provider-tfe/pull/1108) +* Fix the undetected change when modifying the `organization` default in the provider configuration by @brandonc [1152](https://github.com/hashicorp/terraform-provider-tfe/issue/1152) FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) From 6f778afdbc68dd62ab5c5201d1266394e6859cff Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 4 Dec 2023 12:07:13 -0700 Subject: [PATCH 137/420] Remove wrapcheck linter because the framework errors are good --- .golangci.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c4db4933d..f4593b7c1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,6 @@ linters: - gosec #https://github.com/securego/gosec - predeclared #https://github.com/nishanths/predeclared - unconvert #https://github.com/mdempsky/unconvert - - wrapcheck #https://github.com/tomarrell/wrapcheck issues: exclude-rules: @@ -101,19 +100,6 @@ issues: -|resource_tfe_run_trigger|resource_tfe_team_access|resource_tfe_organization_membership|resource_tfe_policy_set|resource_tfe_team_member| -|resource_tfe_workspace|resource_tfe_team_organization_member|resource_tfe_variable_set|resource_tfe_team_project_access)\.go text: "SA1019" - - linters: - - wrapcheck - path: (config_unix|data_source_slug|data_source_workspace|provider|resource_tfe_variable|resource_tfe_workspace|provider_test)\.go - text: "error returned from external package is unwrapped" - - linters: - - wrapcheck - path: (logging|plugin_provider|resource_tfe_oauth_client|resource_tfe_organization|resource_tfe_terraform_version|workspace_helpers|resource_tfe_agent_pool_test| - -|resource_tfe_agent_token_test|resource_tfe_notification_configuration_test|resource_tfe_oauth_client_test|resource_tfe_organization_membership_test| - -|resource_tfe_organization_test|resource_tfe_organization_token_test|resource_tfe_policy_set_parameter_test|resource_tfe_policy_set_test|resource_tfe_registry_module_test| - -|resource_tfe_run_trigger_test|resource_tfe_sentinel_policy_test|resource_tfe_ssh_key_test|resource_tfe_team_access_test|resource_tfe_team_member_test| - -|resource_tfe_team_member_test|resource_tfe_team_organization_member_test|resource_tfe_team_test|resource_tfe_team_token_test|resource_tfe_terraform_version_test| - -|resource_tfe_variable_set_test|resource_tfe_workspace_test|resource_tfe_team_members_test|resource_tfe_team_members_test|resource_tfe_variable_test)\.go - text: "error returned from interface method should be wrapped" linters-settings: # errcheck: # # https://github.com/kisielk/errcheck#excluding-functions From ef2cbc9a856f3556e4498612669ba0d55a7fb9cc Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 4 Dec 2023 14:23:07 -0700 Subject: [PATCH 138/420] Update resource_tfe_registry_module_test.go --- internal/provider/resource_tfe_registry_module_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index 3aa206a5e..6a1038f94 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -974,7 +974,6 @@ func testAccTFERegistryModule_vcs(rInt int) string { resource "tfe_organization" "foobar" { name = "tst-terraform-%d" email = "admin@company.com" - } resource "tfe_oauth_client" "foobar" { @@ -986,6 +985,7 @@ resource "tfe_oauth_client" "foobar" { } resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name vcs_repo { display_identifier = "%s" identifier = "%s" @@ -1055,7 +1055,7 @@ resource "tfe_registry_module" "foobar" { identifier = "%s" oauth_token_id = tfe_oauth_client.foobar.oauth_token_id branch = "main" - tags = false + tags = false } test_config { From 55ea3a836d377722896bbd5031149211c57a3b6e Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 5 Dec 2023 16:51:03 -0700 Subject: [PATCH 139/420] Update resource_tfe_workspace_test.go --- .../provider/resource_tfe_workspace_test.go | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 199a7dd73..3173c1894 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -17,6 +17,7 @@ import ( "time" tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -109,6 +110,57 @@ func TestAccTFEWorkspace_defaultOrg(t *testing.T) { }) } +func TestAccTFEWorkspaceProviderDefaultOrgChanged(t *testing.T) { + // Tests the situation when the provider default organization changes but the + // config does not change. + workspace := &tfe.Workspace{} + defaultOrgName, rInt := setupDefaultOrganization(t) + providers := providerWithDefaultOrganization(defaultOrgName) + + client, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + anotherOrg, cleanup := createOrganization(t, client, tfe.OrganizationCreateOptions{ + Name: tfe.String(fmt.Sprintf("another-organization-%d", rInt)), + Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), + }) + t.Cleanup(cleanup) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: providers, + CheckDestroy: testAccCheckTFEWorkspaceDestroyProvider(providers["tfe"]), + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_defaultOrg(), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists( + "tfe_workspace.foobar", workspace, providers["tfe"]), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "organization", defaultOrgName), + ), + }, + { + PreConfig: func() { + // Modify the provider to return a different default organization + providers["tfe"].ConfigureContextFunc = func(ctx context.Context, rd *schema.ResourceData) (interface{}, diag.Diagnostics) { + client, err := getClientUsingEnv() + return ConfiguredClient{ + Client: client, + Organization: anotherOrg.Name, + }, diag.FromErr(err) + } + }, + Config: testAccTFEWorkspace_defaultOrg(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_workspace.foobar", "organization", anotherOrg.Name), + ), + }, + }, + }) +} + func TestAccTFEWorkspace_basicReadProjectId(t *testing.T) { workspace := &tfe.Workspace{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -3701,3 +3753,10 @@ resource "tfe_workspace" "foobar" { source_name = "Example Source" }`, rInt) } + +func testAccTFEWorkspace_mismatchOrganization() string { + return `resource "tfe_workspace" "foobar" { + name = "workspace-test" + description = "My favorite workspace!" + }` +} From 9543098574ac3ea22a0dc7ea3f6982319ee2cd57 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 30 Nov 2023 12:44:42 -0700 Subject: [PATCH 140/420] Adds tfe_workspace_settings resource This resource is added for two reasons: to break the circular dependency between tfe_workspace agent_pool_id and tfe_agent_pool_allowed_workspaces, as well as create a resource symmetry between tfe_organization_default_execution_mode (will be renamed to tfe_organization_default_settings in a followup commit) --- internal/provider/provider_next.go | 11 + .../resource_tfe_workspace_settings.go | 410 ++++++++++++++++++ .../resource_tfe_workspace_settings_test.go | 241 ++++++++++ internal/provider/testing.go | 22 +- 4 files changed, 675 insertions(+), 9 deletions(-) create mode 100644 internal/provider/resource_tfe_workspace_settings.go create mode 100644 internal/provider/resource_tfe_workspace_settings_test.go diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index a8b964b4d..014bb0c4e 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -5,7 +5,9 @@ package provider import ( "context" + "fmt" "os" + "regexp" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/provider" @@ -23,6 +25,14 @@ type frameworkProvider struct{} // Compile-time interface check var _ provider.Provider = &frameworkProvider{} +// Can be used to construct ID regexp patterns +var base58Alphabet = "[1-9A-HJ-NP-Za-km-z]" + +// IDPattern constructs a regexp pattern for Terraform Cloud with the given prefix +func IDPattern(prefix string) *regexp.Regexp { + return regexp.MustCompile(fmt.Sprintf("^%s-%s{16}$", prefix, base58Alphabet)) +} + // FrameworkProviderConfig is a helper type for extracting the provider // configuration from the provider block. type FrameworkProviderConfig struct { @@ -121,5 +131,6 @@ func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Res return []func() resource.Resource{ NewResourceVariable, NewSAMLSettingsResource, + NewResourceWorkspaceSettings, } } diff --git a/internal/provider/resource_tfe_workspace_settings.go b/internal/provider/resource_tfe_workspace_settings.go new file mode 100644 index 000000000..118a19d29 --- /dev/null +++ b/internal/provider/resource_tfe_workspace_settings.go @@ -0,0 +1,410 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "errors" + "fmt" + "log" + "strings" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// tfe_workspace_settings resource +var _ resource.Resource = &workspaceSettings{} + +// overwritesElementType is the object type definition for the +// overwrites field schema. +var overwritesElementType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "execution_mode": types.BoolType, + "agent_pool": types.BoolType, + }, +} + +type workspaceSettings struct { + config ConfiguredClient +} + +type modelWorkspaceSettings struct { + ID types.String `tfsdk:"id"` + WorkspaceID types.String `tfsdk:"workspace_id"` + ExecutionMode types.String `tfsdk:"execution_mode"` + AgentPoolID types.String `tfsdk:"agent_pool_id"` + Overwrites types.List `tfsdk:"overwrites"` +} + +type modelOverwrites struct { + ExecutionMode types.Bool `tfsdk:"execution_mode"` + AgentPool types.Bool `tfsdk:"agent_pool"` +} + +// errWorkspaceNoLongerExists is returned when reading the workspace settings but +// the workspace no longer exists. +var errWorkspaceNoLongerExists = errors.New("workspace no longer exists") + +// validateAgentExecutionMode is a PlanModifier that validates that the combination +// of "execution_mode" and "agent_pool_id" is compatible. +type validateAgentExecutionMode struct{} + +// revertOverwritesIfExecutionModeUnset is a PlanModifier for "overwrites" that +// sets the values to false if execution_mode is unset. This tells the server to +// compute execution_mode and agent_pool_id if defaults are set. This +// modifier must be used in conjunction with unknownIfExecutionModeUnset plan +// modifier on the execution_mode and agent_pool_id fields. +type revertOverwritesIfExecutionModeUnset struct{} + +// unknownIfExecutionModeUnset sets the planned value to (known after apply) if +// execution_mode is unset, avoiding an inconsistent state after the apply. This +// allows the server to compute the new value based on the default. It should be +// applied to both execution_mode and agent_pool_id in conjunction with +// revertOverwritesIfExecutionModeUnset. +type unknownIfExecutionModeUnset struct{} + +var _ planmodifier.String = (*validateAgentExecutionMode)(nil) +var _ planmodifier.List = (*revertOverwritesIfExecutionModeUnset)(nil) +var _ planmodifier.String = (*unknownIfExecutionModeUnset)(nil) + +func (m validateAgentExecutionMode) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse) { + // Check if the resource is being created. + if req.State.Raw.IsNull() { + return + } + + configured := modelWorkspaceSettings{} + resp.Diagnostics.Append(req.Config.Get(ctx, &configured)...) + + if configured.ExecutionMode.ValueString() == "agent" && configured.AgentPoolID.IsNull() { + resp.Diagnostics.AddError("Invalid agent_pool_id", "If execution mode is \"agent\", \"agent_pool_id\" is required") + } + + if configured.ExecutionMode.ValueString() != "agent" && !configured.AgentPoolID.IsNull() { + resp.Diagnostics.AddError("Invalid agent_pool_id", "If execution mode is not \"agent\", \"agent_pool_id\" must not be set") + } +} + +func (m validateAgentExecutionMode) Description(_ context.Context) string { + return "Validates that configuration values for \"agent_pool_id\" and \"execution_mode\" are compatible" +} + +func (m validateAgentExecutionMode) MarkdownDescription(_ context.Context) string { + return "Validates that configuration values for \"agent_pool_id\" and \"execution_mode\" are compatible" +} + +func (m revertOverwritesIfExecutionModeUnset) PlanModifyList(ctx context.Context, req planmodifier.ListRequest, resp *planmodifier.ListResponse) { + // Check if the resource is being created. + if req.State.Raw.IsNull() { + return + } + + // Determine if configured execution_mode is being unset + state := modelWorkspaceSettings{} + configured := modelWorkspaceSettings{} + + resp.Diagnostics.Append(req.Config.Get(ctx, &configured)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + overwritesState := make([]modelOverwrites, 1) + state.Overwrites.ElementsAs(ctx, &overwritesState, true) + + if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { + overwritesState[0].AgentPool = types.BoolValue(false) + overwritesState[0].ExecutionMode = types.BoolValue(false) + + newList, diags := types.ListValueFrom(ctx, overwritesElementType, overwritesState) + resp.Diagnostics.Append(diags...) + + resp.PlanValue = newList + } +} + +func (m revertOverwritesIfExecutionModeUnset) Description(_ context.Context) string { + return "Reverts to computed defaults if settings are unset" +} + +func (m revertOverwritesIfExecutionModeUnset) MarkdownDescription(_ context.Context) string { + return "Reverts to computed defaults if settings are unset" +} + +func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse) { + // Check if the resource is being created. + if req.State.Raw.IsNull() { + return + } + + // Determine if configured execution_mode is being unset + state := modelWorkspaceSettings{} + configured := modelWorkspaceSettings{} + + resp.Diagnostics.Append(req.Config.Get(ctx, &configured)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + overwritesState := make([]modelOverwrites, 1) + state.Overwrites.ElementsAs(ctx, &overwritesState, true) + + if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { + resp.PlanValue = types.StringUnknown() + } +} + +func (m unknownIfExecutionModeUnset) Description(_ context.Context) string { + return "Resets execution_mode to \"remote\" if it is unset" +} + +func (m unknownIfExecutionModeUnset) MarkdownDescription(_ context.Context) string { + return "Resets execution_mode to \"remote\" if it is unset" +} + +func (r *workspaceSettings) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Additional Workspace settings that override organization defaults", + DeprecationMessage: "", + Version: 1, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the variable", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + + "workspace_id": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.RegexMatches( + IDPattern("ws"), + "must be a valid workspace ID (ws-)", + ), + }, + }, + + "execution_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + unknownIfExecutionModeUnset{}, + }, + Validators: []validator.String{ + stringvalidator.OneOf("agent", "local", "remote"), + }, + }, + + "agent_pool_id": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + unknownIfExecutionModeUnset{}, + validateAgentExecutionMode{}, + }, + Validators: []validator.String{ + stringvalidator.RegexMatches( + IDPattern("apool"), + "must be a valid workspace ID (apool-)", + ), + }, + }, + + // ListAttribute was required here because we are still using plugin protocol v5. + // Once compatibility is broken for v1, and we convert all + // providers to protocol v6, this can become a single nested object. + "overwrites": schema.ListAttribute{ + Computed: true, + ElementType: overwritesElementType, + PlanModifiers: []planmodifier.List{ + revertOverwritesIfExecutionModeUnset{}, + }, + }, + }, + } +} + +// workspaceSettingsModelFromTFEWorkspace builds a resource model from the TFE model +func workspaceSettingsModelFromTFEWorkspace(ws *tfe.Workspace) *modelWorkspaceSettings { + result := modelWorkspaceSettings{ + ID: types.StringValue(ws.ID), + WorkspaceID: types.StringValue(ws.ID), + ExecutionMode: types.StringValue(ws.ExecutionMode), + } + + if ws.AgentPool != nil && ws.ExecutionMode == "agent" { + result.AgentPoolID = types.StringValue(ws.AgentPool.ID) + } + + settingsModel := modelOverwrites{ + ExecutionMode: types.BoolValue(false), + AgentPool: types.BoolValue(false), + } + + if ws.SettingOverwrites != nil { + settingsModel = modelOverwrites{ + ExecutionMode: types.BoolValue(*ws.SettingOverwrites.ExecutionMode), + AgentPool: types.BoolValue(*ws.SettingOverwrites.AgentPool), + } + } + + listOverwrites, diags := types.ListValueFrom(ctx, overwritesElementType, []modelOverwrites{settingsModel}) + if diags.HasError() { + panic("Could not build list value from slice of models. This should not be possible unless the model breaks reflection rules.") + } + + result.Overwrites = listOverwrites + + return &result +} + +func (r *workspaceSettings) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data modelWorkspaceSettings + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + model, err := r.readSettings(ctx, data.WorkspaceID.ValueString()) + if errors.Is(err, errWorkspaceNoLongerExists) { + resp.State.RemoveResource(ctx) + return + } else if err != nil { + resp.Diagnostics.AddError("Error reading workspace", err.Error()) + } + + resp.Diagnostics.Append(resp.State.Set(ctx, model)...) +} + +func (r *workspaceSettings) readSettings(ctx context.Context, workspaceID string) (*modelWorkspaceSettings, error) { + ws, err := r.config.Client.Workspaces.ReadByID(ctx, workspaceID) + if err != nil { + // If it's gone: that's not an error, but we are done. + if errors.Is(err, tfe.ErrResourceNotFound) { + log.Printf("[DEBUG] Workspace %s no longer exists", workspaceID) + return nil, errWorkspaceNoLongerExists + } + return nil, fmt.Errorf("couldn't read workspace %s: %s", workspaceID, err.Error()) + } + + return workspaceSettingsModelFromTFEWorkspace(ws), nil +} + +func (r *workspaceSettings) updateSettings(ctx context.Context, data *modelWorkspaceSettings, state *tfsdk.State) error { + workspaceID := data.WorkspaceID.ValueString() + + updateOptions := tfe.WorkspaceUpdateOptions{ + SettingOverwrites: &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(false), + AgentPool: tfe.Bool(false), + }, + } + + if executionMode := data.ExecutionMode.ValueString(); executionMode != "" { + updateOptions.ExecutionMode = tfe.String(executionMode) + updateOptions.SettingOverwrites.ExecutionMode = tfe.Bool(true) + updateOptions.SettingOverwrites.AgentPool = tfe.Bool(true) + + agentPoolID := data.AgentPoolID.ValueString() // may be empty + updateOptions.AgentPoolID = tfe.String(agentPoolID) + } + + ws, err := r.config.Client.Workspaces.UpdateByID(ctx, workspaceID, updateOptions) + if err != nil { + return fmt.Errorf("couldn't update workspace %s: %w", workspaceID, err) + } + + model, err := r.readSettings(ctx, ws.ID) + if err != nil { + return fmt.Errorf("couldn't read workspace %s after update: %w", workspaceID, err) + } + state.Set(ctx, model) + return nil +} + +func (r *workspaceSettings) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data modelWorkspaceSettings + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if err := r.updateSettings(ctx, &data, &resp.State); err != nil { + resp.Diagnostics.AddError("Error updating workspace", err.Error()) + } +} + +func (r *workspaceSettings) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var data modelWorkspaceSettings + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if err := r.updateSettings(ctx, &data, &resp.State); err != nil { + resp.Diagnostics.AddError("Error updating workspace", err.Error()) + } +} + +func (r *workspaceSettings) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var data modelWorkspaceSettings + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + noneModel := modelWorkspaceSettings{ + ID: data.ID, + WorkspaceID: data.ID, + } + + if err := r.updateSettings(ctx, &noneModel, &resp.State); err == nil { + resp.State.RemoveResource(ctx) + } +} + +func (r *workspaceSettings) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = "tfe_workspace_settings" +} + +func (r *workspaceSettings) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Early exit if provider is unconfigured (i.e. we're only validating config or something) + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +func (r *workspaceSettings) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.Split(req.ID, "/") + if len(s) >= 3 { + resp.Diagnostics.AddError("Error importing workspace settings", fmt.Sprintf( + "invalid workspace input format: %s (expected / or )", + req.ID, + )) + } else if len(s) == 2 { + workspaceID, err := fetchWorkspaceExternalID(s[0]+"/"+s[1], r.config.Client) + if err != nil { + resp.Diagnostics.AddError("Error importing workspace settings", fmt.Sprintf( + "error retrieving workspace with name %s from organization %s: %s", s[1], s[0], err.Error(), + )) + } + + req.ID = workspaceID + } + + resp.State.SetAttribute(ctx, path.Root("workspace_id"), req.ID) + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +func NewResourceWorkspaceSettings() resource.Resource { + return &workspaceSettings{} +} diff --git a/internal/provider/resource_tfe_workspace_settings_test.go b/internal/provider/resource_tfe_workspace_settings_test.go new file mode 100644 index 000000000..db644c6cc --- /dev/null +++ b/internal/provider/resource_tfe_workspace_settings_test.go @@ -0,0 +1,241 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "errors" + "fmt" + "testing" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFEWorkspaceSettings(t *testing.T) { + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, cleanupOrg := createBusinessOrganization(t, tfeClient) + t.Cleanup(cleanupOrg) + + ws := createTempWorkspace(t, tfeClient, org.Name) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEWorkspaceSettingsDestroy, + Steps: []resource.TestStep{ + // Start with local execution + { + Config: testAccTFEWorkspaceSettings_basic(ws.ID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "id"), + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "workspace_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "execution_mode", "local"), + resource.TestCheckNoResourceAttr( + "tfe_workspace_settings.foobar", "agent_pool_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.execution_mode", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.agent_pool", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.#", "1"), + ), + }, + // Change to agent pool + { + Config: testAccTFEWorkspaceSettings_updateExecutionMode(org.Name, ws.ID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "id"), + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "workspace_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "execution_mode", "agent"), + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "agent_pool_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.execution_mode", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.agent_pool", "true"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.#", "1"), + ), + }, + // Unset execution mode + { + Config: testAccTFEWorkspaceSettings_unsetExecutionMode(org.Name, ws.ID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "id"), + resource.TestCheckResourceAttrSet( + "tfe_workspace_settings.foobar", "workspace_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "execution_mode", "remote"), + resource.TestCheckNoResourceAttr( + "tfe_workspace_settings.foobar", "agent_pool_id"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.execution_mode", "false"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.0.agent_pool", "false"), + resource.TestCheckResourceAttr( + "tfe_workspace_settings.foobar", "overwrites.#", "1"), + ), + }, + }, + }) +} + +func TestAccTFEWorkspaceSettingsImport(t *testing.T) { + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, cleanupOrg := createBusinessOrganization(t, tfeClient) + t.Cleanup(cleanupOrg) + + ws := createTempWorkspace(t, tfeClient, org.Name) + + _, err = tfeClient.Workspaces.UpdateByID(ctx, ws.ID, tfe.WorkspaceUpdateOptions{ + ExecutionMode: tfe.String("local"), + }) + if err != nil { + t.Fatal(err) + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEWorkspaceSettingsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspaceSettings_basic(ws.ID), + }, + { + ResourceName: "tfe_workspace_settings.foobar", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFEWorkspaceSettingsImport_ByName(t *testing.T) { + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, cleanupOrg := createBusinessOrganization(t, tfeClient) + t.Cleanup(cleanupOrg) + + ws := createTempWorkspace(t, tfeClient, org.Name) + + _, err = tfeClient.Workspaces.UpdateByID(ctx, ws.ID, tfe.WorkspaceUpdateOptions{ + ExecutionMode: tfe.String("local"), + }) + if err != nil { + t.Fatal(err) + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEOrganizationMembershipDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspaceSettings_basic(ws.ID), + }, + { + ResourceName: "tfe_workspace_settings.foobar", + ImportState: true, + ImportStateId: fmt.Sprintf("%s/%s", org.Name, ws.Name), + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckTFEWorkspaceSettingsDestroy(s *terraform.State) error { + return testAccCheckTFEWorkspaceSettingsDestroyProvider(testAccProvider)(s) +} + +func testAccCheckTFEWorkspaceSettingsDestroyProvider(p *schema.Provider) func(s *terraform.State) error { + return func(s *terraform.State) error { + tfeClient, err := getClientUsingEnv() + if err != nil { + return err + } + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_workspace_settings" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + ws, err := tfeClient.Workspaces.ReadByID(ctx, rs.Primary.ID) + if err != nil { + return fmt.Errorf("Workspace %s does not exist", rs.Primary.ID) + } + + if ws.ExecutionMode != "remote" { + return fmt.Errorf("expected execution mode to be remote after destroy, but was %s", ws.ExecutionMode) + } + + if ws.AgentPool != nil { + return errors.New("expected agent pool to be nil after destroy, but wasn't") + } + } + + return nil + } +} + +func testAccTFEWorkspaceSettings_basic(workspaceID string) string { + return fmt.Sprintf(` +resource "tfe_workspace_settings" "foobar" { + workspace_id = "%s" + execution_mode = "local" +} +`, workspaceID) +} + +func testAccTFEWorkspaceSettings_updateExecutionMode(orgName, workspaceID string) string { + return fmt.Sprintf(` +resource "tfe_agent_pool" "mypool" { + name = "test-pool-default" + organization = "%s" +} + +resource "tfe_workspace_settings" "foobar" { + workspace_id = "%s" + execution_mode = "agent" + agent_pool_id = tfe_agent_pool.mypool.id +} +`, orgName, workspaceID) +} + +func testAccTFEWorkspaceSettings_unsetExecutionMode(orgName, workspaceID string) string { + return fmt.Sprintf(` +resource "tfe_agent_pool" "mypool" { + name = "test-pool-default" + organization = "%s" +} + +resource "tfe_workspace_settings" "foobar" { + workspace_id = "%s" +} +`, orgName, workspaceID) +} diff --git a/internal/provider/testing.go b/internal/provider/testing.go index ae4510774..0302cb495 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -164,22 +164,26 @@ func createOrganization(t *testing.T, client *tfe.Client, options tfe.Organizati } } -func createAgentPool(t *testing.T, client *tfe.Client, org *tfe.Organization) (*tfe.AgentPool, func()) { +func createTempWorkspace(t *testing.T, client *tfe.Client, orgName string) *tfe.Workspace { + t.Helper() + ctx := context.Background() - pool, err := client.AgentPools.Create(ctx, org.Name, tfe.AgentPoolCreateOptions{ - Name: tfe.String(randomString(t)), + ws, err := client.Workspaces.Create(ctx, orgName, tfe.WorkspaceCreateOptions{ + Name: tfe.String(fmt.Sprintf("tst-workspace-%s", randomString(t))), }) if err != nil { t.Fatal(err) } - return pool, func() { - if err := client.AgentPools.Delete(ctx, pool.ID); err != nil { - t.Logf("Error destroying agent pool! WARNING: Dangling resources "+ - "may exist! The full error is shown below.\n\n"+ - "Agent pool ID: %s\nError: %s", pool.ID, err) + t.Cleanup(func() { + if err := client.Workspaces.DeleteByID(ctx, ws.ID); err != nil { + t.Errorf("Error destroying workspace! WARNING: Dangling resources\n"+ + "may exist! The full error is show below:\n\n"+ + "Workspace:%s\nError: %s", ws.ID, err) } - } + }) + + return ws } func createOrganizationMembership(t *testing.T, client *tfe.Client, orgName string, options tfe.OrganizationMembershipCreateOptions) *tfe.OrganizationMembership { From dd50c7c0c3cc4584190ec7c26fdc7223a8d3e94f Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 30 Nov 2023 16:23:11 -0700 Subject: [PATCH 141/420] Remove setting_overwrites from tfe_workspace --- internal/provider/resource_tfe_workspace.go | 203 +----------------- .../provider/resource_tfe_workspace_test.go | 105 --------- internal/provider/testing.go | 19 -- 3 files changed, 11 insertions(+), 316 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index bf9cb6528..ea9df5acb 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -41,16 +41,6 @@ func resourceTFEWorkspace() *schema.Resource { }, CustomizeDiff: func(c context.Context, d *schema.ResourceDiff, meta interface{}) error { - // NOTE: execution mode and agent_pool_id must be set to default first before calling - // the validation functions - if err := setComputedDefaults(c, d); err != nil { - return err - } - - if err := overwriteDefaultExecutionMode(c, d); err != nil { - return err - } - if err := validateAgentExecution(c, d); err != nil { return err } @@ -128,24 +118,6 @@ func resourceTFEWorkspace() *schema.Resource { ), }, - "setting_overwrites": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "execution_mode": { - Type: schema.TypeBool, - Required: true, - }, - - "agent_pool": { - Type: schema.TypeBool, - Required: true, - }, - }, - }, - }, - "file_triggers_enabled": { Type: schema.TypeBool, Optional: true, @@ -519,18 +491,6 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { d.Set("organization", workspace.Organization.Name) d.Set("resource_count", workspace.ResourceCount) - var settingOverwrites []interface{} - if workspace.SettingOverwrites != nil { - settingOverwrites = append(settingOverwrites, map[string]interface{}{ - "execution_mode": workspace.SettingOverwrites.ExecutionMode, - "agent_pool": workspace.SettingOverwrites.AgentPool, - }) - } - err = d.Set("setting_overwrites", settingOverwrites) - if err != nil { - return err - } - if workspace.Links["self-html"] != nil { baseAPI := config.Client.BaseURL() htmlURL := url.URL{ @@ -600,18 +560,15 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error config := meta.(ConfiguredClient) id := d.Id() - workspaceControlsAgentPool := isSettingOverwritten("agent_pool", d) - workspaceControlsExecutionMode := isSettingOverwritten("execution_mode", d) - if d.HasChange("name") || d.HasChange("auto_apply") || d.HasChange("auto_apply_run_trigger") || d.HasChange("queue_all_runs") || d.HasChange("terraform_version") || d.HasChange("working_directory") || d.HasChange("vcs_repo") || d.HasChange("file_triggers_enabled") || d.HasChange("trigger_prefixes") || d.HasChange("trigger_patterns") || d.HasChange("allow_destroy_plan") || d.HasChange("speculative_enabled") || - d.HasChange("operations") || (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || - d.HasChange("description") || (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || + d.HasChange("operations") || d.HasChange("execution_mode") || + d.HasChange("description") || d.HasChange("agent_pool_id") || d.HasChange("global_remote_state") || d.HasChange("structured_run_output_enabled") || - d.HasChange("assessments_enabled") || d.HasChange("project_id") || d.HasChange("setting_overwrites") { + d.HasChange("assessments_enabled") || d.HasChange("project_id") { // Create a new options struct. options := tfe.WorkspaceUpdateOptions{ Name: tfe.String(d.Get("name").(string)), @@ -639,7 +596,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if (d.HasChange("agent_pool_id") && workspaceControlsAgentPool) || d.HasChange("setting_overwrites") { + if d.HasChange("agent_pool_id") { // Need the raw configuration value of the agent_pool_id because when the workspace's execution mode is set // to default, we can't know for certain what the default value of the agent pool will be. This means we can // only set the agent_pool_id as "NewComputed", meaning that the value returned by the ResourceData will be @@ -650,6 +607,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error // be sufficient if !agentPoolID.IsNull() { options.AgentPoolID = tfe.String(agentPoolID.AsString()) + // set setting overwrites options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ AgentPool: tfe.Bool(true), @@ -657,33 +615,13 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if (d.HasChange("execution_mode") && workspaceControlsExecutionMode) || d.HasChange("setting_overwrites") { - executionMode := d.GetRawConfig().GetAttr("execution_mode") - - // if the TFE instance knows about setting-overwrites - if _, ok := d.GetOk("setting_overwrites"); ok { - if options.SettingOverwrites == nil { - // initialize setting-overwrites if it has not been initialized already - options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{} - } - - // if execution mode is currently unset... - operations := d.GetRawConfig().GetAttr("operations") - if executionMode.IsNull() && operations.IsNull() { - // set execution mode to default (inherit from the parent organization/project) - options.SettingOverwrites.ExecutionMode = tfe.Bool(false) - } + if d.HasChange("execution_mode") { + if v, ok := d.GetOk("execution_mode"); ok { + options.ExecutionMode = tfe.String(v.(string)) - // if execution has been set... - if !executionMode.IsNull() { - // set the execution mode to be "overwritten" - options.SettingOverwrites.ExecutionMode = tfe.Bool(true) - options.ExecutionMode = tfe.String(executionMode.AsString()) - } - } else { - // since the TFE instance doesn't know about setting-overwrites, set the execution mode as normal - if v, ok := d.GetOk("execution_mode"); ok { - options.ExecutionMode = tfe.String(v.(string)) + // set setting overwrites + options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ + ExecutionMode: tfe.Bool(true), } } } @@ -942,105 +880,6 @@ func resourceTFEWorkspaceDelete(d *schema.ResourceData, meta interface{}) error return nil } -// since execution_mode and agent_pool_id are marked as Optional: true, and -// Computed: true, unsetting the execution_mode/agent_pool_id in the config -// after it's been set to a valid value is not detected by ResourceDiff so -// we need to read the value from RawConfig instead -func setComputedDefaults(_ context.Context, d *schema.ResourceDiff) error { - configMap := d.GetRawConfig().AsValueMap() - operations, operationsReadOk := configMap["operations"] - executionMode, executionModeReadOk := configMap["execution_mode"] - executionModeState := d.Get("execution_mode") - agentPoolID, agentPoolIDReadOk := configMap["agent_pool_id"] - agentPoolIDState := d.Get("agent_pool_id") - - // forcefully setting the defaults is only necessary when an existing workspace is being updated - isRecordPersisted := d.Id() != "" - if isRecordPersisted != true { - return nil - } - - if !operationsReadOk || !executionModeReadOk || !agentPoolIDReadOk { - return nil - } - - // find out if the current TFE version supports setting-overwrites - currentTfeSupportsSettingOverwrites := false - if v, ok := d.GetOkExists("setting_overwrites"); ok { - settingOverwrites := v.([]interface{}) - currentTfeSupportsSettingOverwrites = len(settingOverwrites) != 0 - } - executionModeWasUnset := executionModeState != "remote" && operations.IsNull() && executionMode.IsNull() - agentPoolWasUnset := (agentPoolID.IsNull() || !agentPoolIDReadOk) && agentPoolIDState != "" - - // if current version of TFE does not support setting-overwrites, update the computed values if either of - // them have been set to a nil value - if !currentTfeSupportsSettingOverwrites { - if executionModeWasUnset { - err := d.SetNew("execution_mode", "remote") - if err != nil { - return fmt.Errorf("failed to set execution_mode: %w", err) - } - } - - if agentPoolWasUnset { - err := d.SetNew("agent_pool_id", nil) - if err != nil { - return fmt.Errorf("failed to clear agent_pool_id: %w", err) - } - } - return nil - } - - return nil -} - -func overwriteDefaultExecutionMode(_ context.Context, d *schema.ResourceDiff) error { - configMap := d.GetRawConfig().AsValueMap() - executionMode, executionModeReadOk := configMap["execution_mode"] - operations, operationsReadOk := configMap["operations"] - - // if the execution mode was previously overwritten, but being set to default in the current config, make sure that - // the setting overwrites will be set to false and the execution_mode and agent_pool_id are set to computed as we - // are not able to tell what the default execution mode is until after we update the workspace - if executionMode.IsNull() && operations.IsNull() { - if v, ok := d.GetOk("setting_overwrites"); ok { - settingOverwrites := v.([]interface{})[0].(map[string]interface{}) - if settingOverwrites["execution_mode"] == true { - newSettingOverwrites := map[string]interface{}{ - "execution_mode": false, - "agent_pool": false, - } - d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) - d.SetNewComputed("execution_mode") - d.SetNewComputed("agent_pool_id") - } - return nil - } - } - - if (executionMode.IsNull() || !executionModeReadOk) && (operations.IsNull() || !operationsReadOk) { - return nil - } - - // if the default execution mode and the execution_mode in the config matches, nothing will happen - // unless we inform TFE that the new execution_mode is meant to overwrite the current execution mode - if v, ok := d.GetOk("setting_overwrites"); ok { - settingOverwrites := v.([]interface{})[0].(map[string]interface{}) - if settingOverwrites["execution_mode"] == false { - agentPoolID, agentPoolReadOk := configMap["agent_pool_id"] - - newSettingOverwrites := map[string]interface{}{ - "execution_mode": true, - "agent_pool": agentPoolID.IsKnown() && agentPoolReadOk, - } - d.SetNew("setting_overwrites", []interface{}{newSettingOverwrites}) - } - } - - return nil -} - // An agent pool can only be specified when execution_mode is set to "agent". You currently cannot specify a // schema validation based on a different argument's value, so we do so here at plan time instead. func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { @@ -1157,23 +996,3 @@ func errWorkspaceResourceCountCheck(workspaceID string, resourceCount int) error } return nil } - -// isSettingOverwritten checks if the value of a setting is being overwritten by the workspace or not. in other words, -// if the value of the setting is determined by the workspace, this function will return true for that setting -func isSettingOverwritten(setting string, d *schema.ResourceData) bool { - if v, ok := d.GetOk("setting_overwrites"); ok { - settingOverwrites := v.([]interface{}) - if len(settingOverwrites) != 1 { - // current TFE version does not support setting-overwrites, so all settings are set at workspace-level - return true - } - - // check the value of the setting - settingOverwritesValue := settingOverwrites[0].(map[string]interface{}) - executionModeOverwritten := settingOverwritesValue[setting] - - return executionModeOverwritten.(bool) - } - - return true -} diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 3173c1894..81cfef2d1 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -1927,111 +1927,6 @@ func TestAccTFEWorkspace_operationsAndExecutionModeInteroperability(t *testing.T }) } -func TestAccTFEWorkspace_unsetExecutionMode(t *testing.T) { - skipIfEnterprise(t) - - tfeClient, err := getClientUsingEnv() - if err != nil { - t.Fatal(err) - } - - org, orgCleanup := createBusinessOrganization(t, tfeClient) - t.Cleanup(orgCleanup) - - workspace := &tfe.Workspace{} - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEWorkspaceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFEWorkspace_executionModeAgent(org.Name), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEWorkspaceExists( - "tfe_workspace.foobar", workspace, testAccProvider), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "operations", "true"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "execution_mode", "agent"), - resource.TestCheckResourceAttrSet( - "tfe_workspace.foobar", "agent_pool_id"), - ), - }, - { - Config: testAccTFEWorkspace_executionModeNull(org.Name), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEWorkspaceExists( - "tfe_workspace.foobar", workspace, testAccProvider), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "operations", "true"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "execution_mode", "remote"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "agent_pool_id", ""), - ), - }, - }, - }) -} - -func TestAccTFEWorkspace_unsetExecutionModeWithOrgLevelDefault(t *testing.T) { - skipIfEnterprise(t) - - tfeClient, err := getClientUsingEnv() - if err != nil { - t.Fatal(err) - } - - org, agentPool, orgCleanup := createBusinessOrganizationWithAgentDefaultExecutionMode(t, tfeClient) - t.Cleanup(orgCleanup) - - workspace := &tfe.Workspace{} - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEWorkspaceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFEWorkspace_executionModeAgent(org.Name), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEWorkspaceExists( - "tfe_workspace.foobar", workspace, testAccProvider), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "operations", "true"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "execution_mode", "agent"), - resource.TestCheckResourceAttrSet( - "tfe_workspace.foobar", "agent_pool_id"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "setting_overwrites.0.execution_mode", "true"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "setting_overwrites.0.agent_pool", "true"), - ), - }, - { - Config: testAccTFEWorkspace_executionModeNull(org.Name), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEWorkspaceExists( - "tfe_workspace.foobar", workspace, testAccProvider), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "operations", "true"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "execution_mode", "agent"), - // workspace should now be using the organization default agent pool - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "agent_pool_id", agentPool.ID), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "setting_overwrites.0.execution_mode", "false"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "setting_overwrites.0.agent_pool", "false"), - ), - }, - }, - }) -} - func TestAccTFEWorkspace_globalRemoteState(t *testing.T) { workspace := &tfe.Workspace{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() diff --git a/internal/provider/testing.go b/internal/provider/testing.go index 0302cb495..8c428510f 100644 --- a/internal/provider/testing.go +++ b/internal/provider/testing.go @@ -129,25 +129,6 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza return org, orgCleanup } -func createBusinessOrganizationWithAgentDefaultExecutionMode(t *testing.T, tfeClient *tfe.Client) (*tfe.Organization, *tfe.AgentPool, func()) { - org, orgCleanup := createBusinessOrganization(t, tfeClient) - - agentPool, _ := createAgentPool(t, tfeClient, org) - - // update organization to use default execution mode of "agent" - org, err := tfeClient.Organizations.Update(context.Background(), org.Name, tfe.OrganizationUpdateOptions{ - DefaultExecutionMode: tfe.String("agent"), - DefaultAgentPool: agentPool, - }) - if err != nil { - t.Fatal(err) - } - - return org, agentPool, func() { - orgCleanup() - } -} - func createOrganization(t *testing.T, client *tfe.Client, options tfe.OrganizationCreateOptions) (*tfe.Organization, func()) { ctx := context.Background() org, err := client.Organizations.Create(ctx, options) From 730c8560c861fa19b215130c8204d74f4e2830be Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 30 Nov 2023 16:28:30 -0700 Subject: [PATCH 142/420] Deprecate execution_mode and agent_pool_id on tfe_workspace --- internal/provider/resource_tfe_workspace.go | 4 ++- website/docs/r/workspace.html.markdown | 39 ++++++++++----------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index ea9df5acb..b19513c04 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -83,6 +83,7 @@ func resourceTFEWorkspace() *schema.Resource { Optional: true, Computed: true, ConflictsWith: []string{"operations"}, + Deprecated: "Use resource tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.", }, "allow_destroy_plan": { @@ -108,6 +109,7 @@ func resourceTFEWorkspace() *schema.Resource { Optional: true, Computed: true, ConflictsWith: []string{"operations"}, + Deprecated: "Use resource tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.", ValidateFunc: validation.StringInSlice( []string{ "agent", @@ -146,7 +148,7 @@ func resourceTFEWorkspace() *schema.Resource { Type: schema.TypeBool, Optional: true, Computed: true, - Deprecated: "Use execution_mode instead.", + Deprecated: "Use tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.", ConflictsWith: []string{"execution_mode", "agent_pool_id"}, }, diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index ee78ad65e..b5e8e5358 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -28,7 +28,7 @@ resource "tfe_workspace" "test" { } ``` -With `execution_mode` of `agent`: +Usage with vcs_repo: ```hcl resource "tfe_organization" "test-organization" { @@ -36,25 +36,31 @@ resource "tfe_organization" "test-organization" { email = "admin@company.com" } -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name +resource "tfe_oauth_client" "test" { + organization = tfe_organization.test-organization + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "oauth_token_id" + service_provider = "github" } -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name - agent_pool_id = tfe_agent_pool.test-agent-pool.id - execution_mode = "agent" +resource "tfe_workspace" "parent" { + name = "parent-ws" + organization = tfe_organization.test-organization + queue_all_runs = false + vcs_repo { + branch = "main" + identifier = "my-org-name/vcs-repository" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + } } -``` ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` +* `agent_pool_id` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is provided. * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. @@ -62,12 +68,8 @@ The following arguments are supported: * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. -* `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. - Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` - execution modes are valid. When set to `local`, the workspace will be used - for state storage only. This value _must not_ be provided if `operations` - is provided. +* `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -146,9 +148,6 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resource_count` - The number of resources managed by the workspace. * `html_url` - The URL to the browsable HTML overview of the workspace. -* `setting_overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import From 71766e51efcc02e5f3d01d65b898e89d0da2432d Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 30 Nov 2023 18:27:02 -0700 Subject: [PATCH 143/420] Rename tfe_organization_default_execution_mode -> tfe_organization_default_settings Even though the diff is large, there are no code changes and some minor documentation repairs. --- internal/provider/provider.go | 78 +++++++++---------- ...urce_tfe_organization_default_settings.go} | 20 ++--- ...tfe_organization_default_settings_test.go} | 57 +++++++------- ...ganization_default_settings.html.markdown} | 28 ++++--- 4 files changed, 94 insertions(+), 89 deletions(-) rename internal/provider/{resource_tfe_organization_default_execution_mode.go => resource_tfe_organization_default_settings.go} (82%) rename internal/provider/{resource_tfe_organization_default_execution_mode_test.go => resource_tfe_organization_default_settings_test.go} (68%) rename website/docs/r/{tfe_organization_default_execution_mode.html.markdown => organization_default_settings.html.markdown} (50%) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c5abaac2d..a37f68b6c 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -106,45 +106,45 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), - "tfe_agent_pool": resourceTFEAgentPool(), - "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), - "tfe_agent_token": resourceTFEAgentToken(), - "tfe_notification_configuration": resourceTFENotificationConfiguration(), - "tfe_oauth_client": resourceTFEOAuthClient(), - "tfe_organization": resourceTFEOrganization(), - "tfe_organization_default_execution_mode": resourceTFEOrganizationDefaultExecutionMode(), - "tfe_organization_membership": resourceTFEOrganizationMembership(), - "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), - "tfe_organization_run_task": resourceTFEOrganizationRunTask(), - "tfe_organization_token": resourceTFEOrganizationToken(), - "tfe_policy": resourceTFEPolicy(), - "tfe_policy_set": resourceTFEPolicySet(), - "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), - "tfe_project": resourceTFEProject(), - "tfe_project_policy_set": resourceTFEProjectPolicySet(), - "tfe_project_variable_set": resourceTFEProjectVariableSet(), - "tfe_registry_module": resourceTFERegistryModule(), - "tfe_no_code_module": resourceTFENoCodeModule(), - "tfe_run_trigger": resourceTFERunTrigger(), - "tfe_sentinel_policy": resourceTFESentinelPolicy(), - "tfe_ssh_key": resourceTFESSHKey(), - "tfe_team": resourceTFETeam(), - "tfe_team_access": resourceTFETeamAccess(), - "tfe_team_organization_member": resourceTFETeamOrganizationMember(), - "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), - "tfe_team_project_access": resourceTFETeamProjectAccess(), - "tfe_team_member": resourceTFETeamMember(), - "tfe_team_members": resourceTFETeamMembers(), - "tfe_team_token": resourceTFETeamToken(), - "tfe_terraform_version": resourceTFETerraformVersion(), - "tfe_workspace": resourceTFEWorkspace(), - "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), - "tfe_variable_set": resourceTFEVariableSet(), - "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), - "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), - "tfe_workspace_run": resourceTFEWorkspaceRun(), - "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), + "tfe_admin_organization_settings": resourceTFEAdminOrganizationSettings(), + "tfe_agent_pool": resourceTFEAgentPool(), + "tfe_agent_pool_allowed_workspaces": resourceTFEAgentPoolAllowedWorkspaces(), + "tfe_agent_token": resourceTFEAgentToken(), + "tfe_notification_configuration": resourceTFENotificationConfiguration(), + "tfe_oauth_client": resourceTFEOAuthClient(), + "tfe_organization": resourceTFEOrganization(), + "tfe_organization_default_settings": resourceTFEOrganizationDefaultSettings(), + "tfe_organization_membership": resourceTFEOrganizationMembership(), + "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), + "tfe_organization_run_task": resourceTFEOrganizationRunTask(), + "tfe_organization_token": resourceTFEOrganizationToken(), + "tfe_policy": resourceTFEPolicy(), + "tfe_policy_set": resourceTFEPolicySet(), + "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), + "tfe_project": resourceTFEProject(), + "tfe_project_policy_set": resourceTFEProjectPolicySet(), + "tfe_project_variable_set": resourceTFEProjectVariableSet(), + "tfe_registry_module": resourceTFERegistryModule(), + "tfe_no_code_module": resourceTFENoCodeModule(), + "tfe_run_trigger": resourceTFERunTrigger(), + "tfe_sentinel_policy": resourceTFESentinelPolicy(), + "tfe_ssh_key": resourceTFESSHKey(), + "tfe_team": resourceTFETeam(), + "tfe_team_access": resourceTFETeamAccess(), + "tfe_team_organization_member": resourceTFETeamOrganizationMember(), + "tfe_team_organization_members": resourceTFETeamOrganizationMembers(), + "tfe_team_project_access": resourceTFETeamProjectAccess(), + "tfe_team_member": resourceTFETeamMember(), + "tfe_team_members": resourceTFETeamMembers(), + "tfe_team_token": resourceTFETeamToken(), + "tfe_terraform_version": resourceTFETerraformVersion(), + "tfe_workspace": resourceTFEWorkspace(), + "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), + "tfe_variable_set": resourceTFEVariableSet(), + "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), + "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), + "tfe_workspace_run": resourceTFEWorkspaceRun(), + "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), }, ConfigureContextFunc: configure(), } diff --git a/internal/provider/resource_tfe_organization_default_execution_mode.go b/internal/provider/resource_tfe_organization_default_settings.go similarity index 82% rename from internal/provider/resource_tfe_organization_default_execution_mode.go rename to internal/provider/resource_tfe_organization_default_settings.go index 3fb7ccb4f..9a9c6cc95 100644 --- a/internal/provider/resource_tfe_organization_default_execution_mode.go +++ b/internal/provider/resource_tfe_organization_default_settings.go @@ -11,13 +11,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { +func resourceTFEOrganizationDefaultSettings() *schema.Resource { return &schema.Resource{ - Create: resourceTFEOrganizationDefaultExecutionModeCreate, - Read: resourceTFEOrganizationDefaultExecutionModeRead, - Delete: resourceTFEOrganizationDefaultExecutionModeDelete, + Create: resourceTFEOrganizationDefaultSettingsCreate, + Read: resourceTFEOrganizationDefaultSettingsRead, + Delete: resourceTFEOrganizationDefaultSettingsDelete, Importer: &schema.ResourceImporter{ - StateContext: resourceTFEOrganizationDefaultExecutionModeImporter, + StateContext: resourceTFEOrganizationDefaultSettingsImporter, }, CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, @@ -53,7 +53,7 @@ func resourceTFEOrganizationDefaultExecutionMode() *schema.Resource { } } -func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, meta interface{}) error { +func resourceTFEOrganizationDefaultSettingsCreate(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) // Get the organization name. @@ -88,10 +88,10 @@ func resourceTFEOrganizationDefaultExecutionModeCreate(d *schema.ResourceData, m d.SetId(organization) - return resourceTFEOrganizationDefaultExecutionModeRead(d, meta) + return resourceTFEOrganizationDefaultSettingsRead(d, meta) } -func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, meta interface{}) error { +func resourceTFEOrganizationDefaultSettingsRead(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) log.Printf("[DEBUG] Read the organization: %s", d.Id()) @@ -119,7 +119,7 @@ func resourceTFEOrganizationDefaultExecutionModeRead(d *schema.ResourceData, met return nil } -func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, meta interface{}) error { +func resourceTFEOrganizationDefaultSettingsDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) // Get the organization name. @@ -141,7 +141,7 @@ func resourceTFEOrganizationDefaultExecutionModeDelete(d *schema.ResourceData, m return nil } -func resourceTFEOrganizationDefaultExecutionModeImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func resourceTFEOrganizationDefaultSettingsImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(ConfiguredClient) log.Printf("[DEBUG] Read the organization: %s", d.Id()) diff --git a/internal/provider/resource_tfe_organization_default_execution_mode_test.go b/internal/provider/resource_tfe_organization_default_settings_test.go similarity index 68% rename from internal/provider/resource_tfe_organization_default_execution_mode_test.go rename to internal/provider/resource_tfe_organization_default_settings_test.go index 77cc4c11e..c7beb2891 100644 --- a/internal/provider/resource_tfe_organization_default_execution_mode_test.go +++ b/internal/provider/resource_tfe_organization_default_settings_test.go @@ -7,12 +7,13 @@ import ( "time" "errors" + tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) { +func TestAccTFEOrganizationDefaultSettings_remote(t *testing.T) { org := &tfe.Organization{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -22,18 +23,18 @@ func TestAccTFEOrganizationDefaultExecutionMode_remote(t *testing.T) { CheckDestroy: testAccCheckTFEOrganizationDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Config: testAccTFEOrganizationDefaultSettings_remote(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + testAccCheckTFEOrganizationDefaultSettings(org, "remote"), ), }, }, }) } -func TestAccTFEOrganizationDefaultExecutionMode_local(t *testing.T) { +func TestAccTFEOrganizationDefaultSettings_local(t *testing.T) { org := &tfe.Organization{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -43,18 +44,18 @@ func TestAccTFEOrganizationDefaultExecutionMode_local(t *testing.T) { CheckDestroy: testAccCheckTFEOrganizationDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt), + Config: testAccTFEOrganizationDefaultSettings_local(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"), + testAccCheckTFEOrganizationDefaultSettings(org, "local"), ), }, }, }) } -func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) { +func TestAccTFEOrganizationDefaultSettings_agent(t *testing.T) { org := &tfe.Organization{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -64,11 +65,11 @@ func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) { CheckDestroy: testAccCheckTFEOrganizationDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt), + Config: testAccTFEOrganizationDefaultSettings_agent(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), + testAccCheckTFEOrganizationDefaultSettings(org, "agent"), testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org), ), }, @@ -76,7 +77,7 @@ func TestAccTFEOrganizationDefaultExecutionMode_agent(t *testing.T) { }) } -func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) { +func TestAccTFEOrganizationDefaultSettings_update(t *testing.T) { org := &tfe.Organization{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -86,43 +87,43 @@ func TestAccTFEOrganizationDefaultExecutionMode_update(t *testing.T) { CheckDestroy: testAccCheckTFEOrganizationDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Config: testAccTFEOrganizationDefaultSettings_remote(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + testAccCheckTFEOrganizationDefaultSettings(org, "remote"), ), }, { - Config: testAccTFEOrganizationDefaultExecutionMode_agent(rInt), + Config: testAccTFEOrganizationDefaultSettings_agent(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "agent"), + testAccCheckTFEOrganizationDefaultSettings(org, "agent"), testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org), ), }, { - Config: testAccTFEOrganizationDefaultExecutionMode_local(rInt), + Config: testAccTFEOrganizationDefaultSettings_local(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "local"), + testAccCheckTFEOrganizationDefaultSettings(org, "local"), ), }, { - Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Config: testAccTFEOrganizationDefaultSettings_remote(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationExists( "tfe_organization.foobar", org), - testAccCheckTFEOrganizationDefaultExecutionMode(org, "remote"), + testAccCheckTFEOrganizationDefaultSettings(org, "remote"), ), }, }, }) } -func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) { +func TestAccTFEOrganizationDefaultSettings_import(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -131,11 +132,11 @@ func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) { CheckDestroy: testAccCheckTFEOrganizationDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationDefaultExecutionMode_remote(rInt), + Config: testAccTFEOrganizationDefaultSettings_remote(rInt), }, { - ResourceName: "tfe_organization_default_execution_mode.foobar", + ResourceName: "tfe_organization_default_settings.foobar", ImportState: true, ImportStateVerify: true, }, @@ -143,7 +144,7 @@ func TestAccTFEOrganizationDefaultExecutionMode_import(t *testing.T) { }) } -func testAccCheckTFEOrganizationDefaultExecutionMode(org *tfe.Organization, expectedExecutionMode string) resource.TestCheckFunc { +func testAccCheckTFEOrganizationDefaultSettings(org *tfe.Organization, expectedExecutionMode string) resource.TestCheckFunc { return func(s *terraform.State) error { if org.DefaultExecutionMode != expectedExecutionMode { return fmt.Errorf("default Execution Mode did not match, expected: %s, but was: %s", expectedExecutionMode, org.DefaultExecutionMode) @@ -163,33 +164,33 @@ func testAccCheckTFEOrganizationDefaultAgentPoolIDExists(org *tfe.Organization) } } -func testAccTFEOrganizationDefaultExecutionMode_remote(rInt int) string { +func testAccTFEOrganizationDefaultSettings_remote(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" email = "admin@company.com" } -resource "tfe_organization_default_execution_mode" "foobar" { +resource "tfe_organization_default_settings" "foobar" { organization = tfe_organization.foobar.name default_execution_mode = "remote" }`, rInt) } -func testAccTFEOrganizationDefaultExecutionMode_local(rInt int) string { +func testAccTFEOrganizationDefaultSettings_local(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" email = "admin@company.com" } -resource "tfe_organization_default_execution_mode" "foobar" { +resource "tfe_organization_default_settings" "foobar" { organization = tfe_organization.foobar.name default_execution_mode = "local" }`, rInt) } -func testAccTFEOrganizationDefaultExecutionMode_agent(rInt int) string { +func testAccTFEOrganizationDefaultSettings_agent(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -201,7 +202,7 @@ resource "tfe_agent_pool" "foobar" { organization = tfe_organization.foobar.name } -resource "tfe_organization_default_execution_mode" "foobar" { +resource "tfe_organization_default_settings" "foobar" { organization = tfe_organization.foobar.name default_execution_mode = "agent" default_agent_pool_id = tfe_agent_pool.foobar.id diff --git a/website/docs/r/tfe_organization_default_execution_mode.html.markdown b/website/docs/r/organization_default_settings.html.markdown similarity index 50% rename from website/docs/r/tfe_organization_default_execution_mode.html.markdown rename to website/docs/r/organization_default_settings.html.markdown index 88448c323..b6e8754d6 100644 --- a/website/docs/r/tfe_organization_default_execution_mode.html.markdown +++ b/website/docs/r/organization_default_settings.html.markdown @@ -1,13 +1,13 @@ --- layout: "tfe" -page_title: "Terraform Enterprise: tfe_organization_default_execution_mode" +page_title: "Terraform Enterprise: tfe_organization_default_settings description: |- - Sets the default execution mode of an organization + Sets the workspace defaults for an organization --- -# tfe_organization_default_execution_mode +# tfe_organization_default_settings -Sets the default execution mode of an organization. This default execution mode will be used as the default execution mode for all workspaces in the organization. +Primarily, this is used to set the default execution mode of an organization. This setting will be used as the default for all workspaces in the organization. ## Example Usage @@ -20,14 +20,20 @@ resource "tfe_organization" "test" { } resource "tfe_agent_pool" "my_agents" { - name = "agent_smiths" + name = "agent_smiths" organization = tfe_organization.test.name } -resource "tfe_organization_default_execution_mode" "org_default" { - organization = tfe_organization.test.name +resource "tfe_organization_default_settings" "org_default" { + organization = tfe_organization.test.name default_execution_mode = "agent" - default_agent_pool_id = tfe_agent_pool.my_agents.id + default_agent_pool_id = tfe_agent_pool.my_agents.id +} + +resource "tfe_workspace" "my_workspace" { + name = "my-workspace" + # Ensures this workspace will inherit the org defaults + depends_on = [tfe_organization_default_settings.org_default] } ``` @@ -37,9 +43,7 @@ The following arguments are supported: * `default_execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. -* `agent_pool_id` - (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 or if `operations` is - provided. +* `default_agent_pool_id` - (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. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -49,4 +53,4 @@ Organization default execution mode can be imported; use `` a ```shell terraform import tfe_organization_default_execution_mode.test my-org-name -``` \ No newline at end of file +``` From 04182e5abb98c81eeeb7d6e4dd0adcdbc6604139 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 1 Dec 2023 15:19:22 -0700 Subject: [PATCH 144/420] Update CHANGELOG --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f9b4f13..41b9f5209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,18 @@ -BREAKING CHANGES: -* `r/tfe_workspace`: Default value of the `execution_mode` field now uses the organization's `default_execution_mode`. If no `default_execution_mode` has been set, the default `execution_mode` will be unchanged (i.e. `remote`). +DEPRECATIONS and BREAKING CHANGES: +* `r/tfe_workspace`: `execution_mode` and `agent_pool_id` attributes have been deprecated in favor of a new resource, `tfe_workspace_settings`. Note that these fields no longer compute defaults which is consistent with using a new resource to manage these same settings. What this means in practice is that if you unset `execution_mode` or `agent_pool_id` without also creating a `tfe_workspace_settings`, the setting will no longer revert to the default "remote" mode. To migrate, relocate the `execution_mode` and `agent_pool_id` arguments to `tfe_workspace_settings`. BUG FIXES: * `r/tfe_policy`: Fix the provider ignoring updates to the `query` field, by @skeggse [1108](https://github.com/hashicorp/terraform-provider-tfe/pull/1108) * Fix the undetected change when modifying the `organization` default in the provider configuration by @brandonc [1152](https://github.com/hashicorp/terraform-provider-tfe/issue/1152) +* New resource `r/tfe_workspace_settings`: Can be used to break any circular dependency between `tfe_workspace` and `tfe_agent_pool_allowed_workspaces` by managing the `agent_pool_id` for a Workspace by @brandonc [1159](https://github.com/hashicorp/terraform-provider-tfe/pull/1159) FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) -* **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' -* `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' +* **New Resource**: `r/tfe_organization_default_settings` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' +* **New Resource**: `r/tfe_workspace_settings` Uses the `tfe_organization_default_settings` `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode` by @brandonc [1159](https://github.com/hashicorp/terraform-provider-tfe/pull/1159) ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) From 8363b465140eb02aeca56001f5bbc0b385dbd199 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 1 Dec 2023 15:47:58 -0700 Subject: [PATCH 145/420] Document tfe_workspace_settings --- website/docs/d/workspace.html.markdown | 2 +- website/docs/r/workspace.html.markdown | 10 +- website/docs/r/workspace_settings.markdown | 113 +++++++++++++++++++++ 3 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 website/docs/r/workspace_settings.markdown diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index 9bfe672d1..2c1740d1f 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -60,7 +60,7 @@ In addition to all arguments above, the following attributes are exported: * `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcs_repo` - Settings for the workspace's VCS repository. * `working_directory` - A relative path that Terraform will execute within. -* `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `remote`, `local`, or `agent`. +* `execution_mode` - **Deprecated** Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Use the `tfe_workspace_settings` resource instead. * `html_url` - The URL to the browsable HTML overview of the workspace diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index b5e8e5358..22c6d9da7 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -9,6 +9,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace has been deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings). Use caution when unsetting `execution_mode` because the default value `"remote"` is no longer applied when the `execution_mode` is unset. + ~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -54,22 +56,20 @@ resource "tfe_workspace" "parent" { oauth_token_id = tfe_oauth_client.test.oauth_token_id } } +``` ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agent_pool_id` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Requires `execution_mode` - to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is - provided. +* `agent_pool_id` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. -* `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. +* `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a diff --git a/website/docs/r/workspace_settings.markdown b/website/docs/r/workspace_settings.markdown new file mode 100644 index 000000000..880e3ef90 --- /dev/null +++ b/website/docs/r/workspace_settings.markdown @@ -0,0 +1,113 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. If [tfe_organization_default_settings](organization_default_settings.html) are used, those settings may be read using a combination of the read-only `overwrites` argument and the setting itself. + +## Example Usage + +Basic usage: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_workspace" "test" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_workspace_settings" "test-settings" { + workspace_id = tfe_workspace.test.id + execution_mode = "local" +} +``` + +With `execution_mode` of `agent`: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool_allowed_workspaces" "test" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [tfe_workspace.test.id] +} + +resource "tfe_workspace" "test" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_workspace_settings" "test-settings" { + workspace_id = tfe_workspace.test.id + agent_pool_id = tfe_agent_pool.test-agent-pool.id + execution_mode = "agent" +} +``` + +This resource may be used as a data source when no optional arguments are defined: + +```hcl +data "tfe_workspace" "test" { + name = "my-workspace-name" + organization = "my-org-name" +} + +resource "tfe_workspace_settings" "test" { + workspace_id = data.tfe_workspace.test.id +} + +output "workspace-explicit-local-execution" { + value = alltrue([ + tfe_workspace_settings.test.execution_mode == "local", + tfe_workspace_settings.test.overwrites[0]["execution_mode"] + ]) +} +``` + +## Argument Reference + +The following arguments are supported: + +* `workspace_id` - (Required) ID of the workspace. +* `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` + to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. +* `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The workspace ID. +* `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` From bab158be6e0e092509e5a36ba19841d2172ae056 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 5 Dec 2023 15:17:15 -0700 Subject: [PATCH 146/420] Ensure support for TFE when unsetting execution_mode Because organization defaults do not apply to older versions of TFE, the client needs to set this value to the previous default, "remote" --- .../resource_tfe_workspace_settings.go | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/internal/provider/resource_tfe_workspace_settings.go b/internal/provider/resource_tfe_workspace_settings.go index 118a19d29..f8ab6653b 100644 --- a/internal/provider/resource_tfe_workspace_settings.go +++ b/internal/provider/resource_tfe_workspace_settings.go @@ -36,7 +36,8 @@ var overwritesElementType = types.ObjectType{ } type workspaceSettings struct { - config ConfiguredClient + config ConfiguredClient + supportsOverwrites bool } type modelWorkspaceSettings struct { @@ -117,6 +118,11 @@ func (m revertOverwritesIfExecutionModeUnset) PlanModifyList(ctx context.Context resp.Diagnostics.Append(req.Config.Get(ctx, &configured)...) resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + // Check if overwrites are supported by the platform + if state.Overwrites.IsNull() { + return + } + overwritesState := make([]modelOverwrites, 1) state.Overwrites.ElementsAs(ctx, &overwritesState, true) @@ -152,20 +158,26 @@ func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req p resp.Diagnostics.Append(req.Config.Get(ctx, &configured)...) resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - overwritesState := make([]modelOverwrites, 1) - state.Overwrites.ElementsAs(ctx, &overwritesState, true) + if !state.Overwrites.IsNull() { + // Normal operation + overwritesState := make([]modelOverwrites, 1) + state.Overwrites.ElementsAs(ctx, &overwritesState, true) - if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { - resp.PlanValue = types.StringUnknown() + if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { + resp.PlanValue = types.StringUnknown() + } + } else if req.Path.Equal(path.Root("execution_mode")) { + // TFE does not support overwrites so default the execution mode to "remote" + resp.PlanValue = types.StringValue("remote") } } func (m unknownIfExecutionModeUnset) Description(_ context.Context) string { - return "Resets execution_mode to \"remote\" if it is unset" + return "Resets execution_mode to an unknown value if it is unset" } func (m unknownIfExecutionModeUnset) MarkdownDescription(_ context.Context) string { - return "Resets execution_mode to \"remote\" if it is unset" + return "Resets execution_mode to an unknown value if it is unset" } func (r *workspaceSettings) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -237,7 +249,7 @@ func (r *workspaceSettings) Schema(ctx context.Context, req resource.SchemaReque } // workspaceSettingsModelFromTFEWorkspace builds a resource model from the TFE model -func workspaceSettingsModelFromTFEWorkspace(ws *tfe.Workspace) *modelWorkspaceSettings { +func (r *workspaceSettings) workspaceSettingsModelFromTFEWorkspace(ws *tfe.Workspace) *modelWorkspaceSettings { result := modelWorkspaceSettings{ ID: types.StringValue(ws.ID), WorkspaceID: types.StringValue(ws.ID), @@ -248,24 +260,20 @@ func workspaceSettingsModelFromTFEWorkspace(ws *tfe.Workspace) *modelWorkspaceSe result.AgentPoolID = types.StringValue(ws.AgentPool.ID) } - settingsModel := modelOverwrites{ - ExecutionMode: types.BoolValue(false), - AgentPool: types.BoolValue(false), - } - - if ws.SettingOverwrites != nil { - settingsModel = modelOverwrites{ + result.Overwrites = types.ListNull(overwritesElementType) + if r.supportsOverwrites = ws.SettingOverwrites != nil; r.supportsOverwrites { + settingsModel := modelOverwrites{ ExecutionMode: types.BoolValue(*ws.SettingOverwrites.ExecutionMode), AgentPool: types.BoolValue(*ws.SettingOverwrites.AgentPool), } - } - listOverwrites, diags := types.ListValueFrom(ctx, overwritesElementType, []modelOverwrites{settingsModel}) - if diags.HasError() { - panic("Could not build list value from slice of models. This should not be possible unless the model breaks reflection rules.") - } + listOverwrites, diags := types.ListValueFrom(ctx, overwritesElementType, []modelOverwrites{settingsModel}) + if diags.HasError() { + panic("Could not build list value from slice of models. This should not be possible unless the model breaks reflection rules.") + } - result.Overwrites = listOverwrites + result.Overwrites = listOverwrites + } return &result } @@ -296,7 +304,7 @@ func (r *workspaceSettings) readSettings(ctx context.Context, workspaceID string return nil, fmt.Errorf("couldn't read workspace %s: %s", workspaceID, err.Error()) } - return workspaceSettingsModelFromTFEWorkspace(ws), nil + return r.workspaceSettingsModelFromTFEWorkspace(ws), nil } func (r *workspaceSettings) updateSettings(ctx context.Context, data *modelWorkspaceSettings, state *tfsdk.State) error { @@ -309,13 +317,17 @@ func (r *workspaceSettings) updateSettings(ctx context.Context, data *modelWorks }, } - if executionMode := data.ExecutionMode.ValueString(); executionMode != "" { + executionMode := data.ExecutionMode.ValueString() + if executionMode != "" { updateOptions.ExecutionMode = tfe.String(executionMode) updateOptions.SettingOverwrites.ExecutionMode = tfe.Bool(true) updateOptions.SettingOverwrites.AgentPool = tfe.Bool(true) agentPoolID := data.AgentPoolID.ValueString() // may be empty updateOptions.AgentPoolID = tfe.String(agentPoolID) + } else if executionMode == "" && data.Overwrites.IsNull() { + // Not supported by TFE + updateOptions.ExecutionMode = tfe.String("remote") } ws, err := r.config.Client.Workspaces.UpdateByID(ctx, workspaceID, updateOptions) From 843759294ce47e81769b75f66b87d094b5d6e0fc Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 5 Dec 2023 15:18:05 -0700 Subject: [PATCH 147/420] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b9f5209..f5b710331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ BUG FIXES: FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_settings` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' -* **New Resource**: `r/tfe_workspace_settings` Uses the `tfe_organization_default_settings` `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode` by @brandonc [1159](https://github.com/hashicorp/terraform-provider-tfe/pull/1159) +* **New Resource**: `r/tfe_workspace_settings` Uses the `tfe_organization_default_settings` `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode` by @brandonc and @laurenolivia [1159](https://github.com/hashicorp/terraform-provider-tfe/pull/1159) ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) From 10b51eefdf19bce6c9f0207b042f87af7bcfe818 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:17:54 +0000 Subject: [PATCH 148/420] Build(deps): Bump actions/setup-go from 4.1.0 to 5.0.0 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.1.0 to 5.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/93397bea11091df50f3d7e59dc26a7711a8bcfbe...0c52d547c9bc32b1aa3301fd7a9cb496313a4491) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 22fe2e85c..a59b1470c 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -35,7 +35,7 @@ jobs: steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Set up Go - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: go.mod cache: true diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 7673458d7..37d68d384 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -99,7 +99,7 @@ jobs: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Set up Go - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: go.mod check-latest: true From 2ac26bdf22a557603a15b532770ff9f8f481f76e Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Sat, 2 Dec 2023 18:04:23 +0200 Subject: [PATCH 149/420] Add `tfe_registry_gpg_key` resource Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. --- CHANGELOG.md | 1 + internal/provider/attribute_helpers.go | 41 +++ internal/provider/gpg_key.go | 33 +++ internal/provider/provider_next.go | 1 + .../provider/resource_tfe_registry_gpg_key.go | 249 ++++++++++++++++++ .../resource_tfe_registry_gpg_key_test.go | 108 ++++++++ internal/provider/resource_tfe_variable.go | 7 - website/docs/r/registry_gpg_key.html.markdown | 44 ++++ 8 files changed, 477 insertions(+), 7 deletions(-) create mode 100644 internal/provider/attribute_helpers.go create mode 100644 internal/provider/gpg_key.go create mode 100644 internal/provider/resource_tfe_registry_gpg_key.go create mode 100644 internal/provider/resource_tfe_registry_gpg_key_test.go create mode 100644 website/docs/r/registry_gpg_key.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f9b4f13..986fba354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' +* **New Resource**: `r/tfe_registry_gpg_key` is a new resource for managing private registry GPG keys, by @tmatilai ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) diff --git a/internal/provider/attribute_helpers.go b/internal/provider/attribute_helpers.go new file mode 100644 index 000000000..0e424e68c --- /dev/null +++ b/internal/provider/attribute_helpers.go @@ -0,0 +1,41 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// AttrGettable is a small enabler for helper functions that need to read one +// attribute of a Configuration, Plan, or State. +type AttrGettable interface { + GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics +} + +// dataOrDefaultOrganization returns the value of the "organization" attribute +// from the Config/Plan/State data, defaulting to the provier configuration. +// If neither is set, an error is returned. +func (c *ConfiguredClient) dataOrDefaultOrganization(ctx context.Context, data AttrGettable, target *string) diag.Diagnostics { + schemaPath := path.Root("organization") + + var organization types.String + diags := data.GetAttribute(ctx, schemaPath, &organization) + if diags.HasError() { + return diags + } + + if !organization.IsNull() && !organization.IsUnknown() { + *target = organization.ValueString() + } else if c.Organization == "" { + diags.AddAttributeError(schemaPath, "No organization was specified on the resource or provider", "") + } else { + *target = c.Organization + } + + return diags +} diff --git a/internal/provider/gpg_key.go b/internal/provider/gpg_key.go new file mode 100644 index 000000000..ee25671e5 --- /dev/null +++ b/internal/provider/gpg_key.go @@ -0,0 +1,33 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "time" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// modelTFERegistryGPGKey maps the resource or data source schema data to a +// struct. +type modelTFERegistryGPGKey struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + AsciiArmor types.String `tfsdk:"ascii_armor"` + CreatedAt types.String `tfsdk:"created_at"` + UpdatedAt types.String `tfsdk:"updated_at"` +} + +// modelFromTFEVGPGKey builds a modelTFERegistryGPGKey struct from a +// tfe.GPGKey value. +func modelFromTFEVGPGKey(v *tfe.GPGKey) modelTFERegistryGPGKey { + return modelTFERegistryGPGKey{ + ID: types.StringValue(v.KeyID), + Organization: types.StringValue(v.Namespace), + AsciiArmor: types.StringValue(v.AsciiArmor), + CreatedAt: types.StringValue(v.CreatedAt.Format(time.RFC3339)), + UpdatedAt: types.StringValue(v.UpdatedAt.Format(time.RFC3339)), + } +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index a8b964b4d..d79c6993b 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -119,6 +119,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ + NewRegistryGPGKeyResource, NewResourceVariable, NewSAMLSettingsResource, } diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go new file mode 100644 index 000000000..8d1b49e0b --- /dev/null +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -0,0 +1,249 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + "strings" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ resource.Resource = &resourceTFERegistryGPGKey{} +var _ resource.ResourceWithConfigure = &resourceTFERegistryGPGKey{} +var _ resource.ResourceWithImportState = &resourceTFERegistryGPGKey{} + +func NewRegistryGPGKeyResource() resource.Resource { + return &resourceTFERegistryGPGKey{} +} + +// resourceTFERegistryGPGKey implements the tfe_registry_gpg_key resource type +type resourceTFERegistryGPGKey struct { + config ConfiguredClient +} + +func (r *resourceTFERegistryGPGKey) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_gpg_key" +} + +func (r *resourceTFERegistryGPGKey) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Manages a public key of the GPG key pair used to sign releases of private providers in the private registry.", + Version: 1, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "ID of the GPG key.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "ascii_armor": schema.StringAttribute{ + Description: "ASCII-armored representation of the GPG key.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "created_at": schema.StringAttribute{ + Description: "The time when the GPG key was created.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "updated_at": schema.StringAttribute{ + Description: "The time when the GPG key was last updated.", + Computed: true, + }, + }, + } +} + +// Configure implements resource.ResourceWithConfigure +func (r *resourceTFERegistryGPGKey) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +func (r *resourceTFERegistryGPGKey) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan modelTFERegistryGPGKey + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.Plan, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + options := tfe.GPGKeyCreateOptions{ + Type: "gpg-keys", + Namespace: organization, + AsciiArmor: plan.AsciiArmor.ValueString(), + } + + tflog.Debug(ctx, "Creating private registry GPG key") + key, err := r.config.Client.GPGKeys.Create(ctx, "private", options) + if err != nil { + resp.Diagnostics.AddError("Unable to create private registry GPG key", err.Error()) + return + } + + result := modelFromTFEVGPGKey(key) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFERegistryGPGKey) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelTFERegistryGPGKey + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.State, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + keyID := tfe.GPGKeyID{ + RegistryName: "private", + Namespace: organization, + KeyID: state.ID.ValueString(), + } + + tflog.Debug(ctx, "Reading private registry GPG key") + key, err := r.config.Client.GPGKeys.Read(ctx, keyID) + if err != nil { + resp.Diagnostics.AddError("Unable to read private registry GPG key", err.Error()) + return + } + + result := modelFromTFEVGPGKey(key) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFERegistryGPGKey) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan modelTFERegistryGPGKey + var state modelTFERegistryGPGKey + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + keyID := tfe.GPGKeyID{ + RegistryName: "private", + Namespace: state.Organization.ValueString(), // The old namespace + KeyID: plan.ID.ValueString(), + } + options := tfe.GPGKeyUpdateOptions{ + Type: "gpg-keys", + Namespace: plan.Organization.ValueString(), // The new namespace + } + + tflog.Debug(ctx, "Updating private registry GPG key") + key, err := r.config.Client.GPGKeys.Update(ctx, keyID, options) + if err != nil { + resp.Diagnostics.AddError("Unable to update private registry GPG key", err.Error()) + return + } + + result := modelFromTFEVGPGKey(key) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFERegistryGPGKey) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state modelTFERegistryGPGKey + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + keyID := tfe.GPGKeyID{ + RegistryName: "private", + Namespace: state.Organization.ValueString(), + KeyID: state.ID.ValueString(), + } + + tflog.Debug(ctx, "Deleting private registry GPG key") + err := r.config.Client.GPGKeys.Delete(ctx, keyID) + if err != nil { + resp.Diagnostics.AddError("Unable to delete private registry GPG key", err.Error()) + return + } +} + +func (r *resourceTFERegistryGPGKey) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 2) + if len(s) != 2 { + resp.Diagnostics.AddError( + "Error importing variable", + fmt.Sprintf("Invalid variable import format: %s (expected /)", req.ID), + ) + return + } + org := s[0] + id := s[1] + + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), org)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), id)...) +} diff --git a/internal/provider/resource_tfe_registry_gpg_key_test.go b/internal/provider/resource_tfe_registry_gpg_key_test.go new file mode 100644 index 000000000..ba0ab5e9d --- /dev/null +++ b/internal/provider/resource_tfe_registry_gpg_key_test.go @@ -0,0 +1,108 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFERegistryGPGKeyResource_basic(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryGPGKeyResourceConfig(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_gpg_key.foobar", "id", testGPGKeyID), + resource.TestCheckResourceAttr("tfe_registry_gpg_key.foobar", "organization", orgName), + resource.TestCheckResourceAttr("tfe_registry_gpg_key.foobar", "ascii_armor", testGPGKeyArmor+"\n"), + resource.TestCheckResourceAttrSet("tfe_registry_gpg_key.foobar", "created_at"), + resource.TestCheckResourceAttrSet("tfe_registry_gpg_key.foobar", "updated_at"), + ), + }, + }, + }) +} + +func testAccTFERegistryGPGKeyResourceConfig(orgName string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "%s" + email = "admin@tfe.local" +} + +resource "tfe_registry_gpg_key" "foobar" { + organization = tfe_organization.foobar.name + + ascii_armor = </` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` From 7121fd5e611b15a775c8c734d2f1821c12e27c08 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Sat, 2 Dec 2023 18:06:24 +0200 Subject: [PATCH 150/420] Add `tfe_registry_gpg_key` data source Retrieves a private registry GPG key. --- CHANGELOG.md | 1 + .../provider/data_source_registry_gpg_key.go | 119 ++++++++++++++++++ .../data_source_registry_gpg_key_test.go | 46 +++++++ internal/provider/provider_next.go | 1 + website/docs/d/registry_gpg_key.html.markdown | 32 +++++ 5 files changed, 199 insertions(+) create mode 100644 internal/provider/data_source_registry_gpg_key.go create mode 100644 internal/provider/data_source_registry_gpg_key_test.go create mode 100644 website/docs/d/registry_gpg_key.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 986fba354..1816e1520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ FEATURES: * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * **New Resource**: `r/tfe_registry_gpg_key` is a new resource for managing private registry GPG keys, by @tmatilai +* **New Data Source**: `d/tfe_registry_gpg_key` is a new data source to retrieve a private registry GPG key, by @tmatilai ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) diff --git a/internal/provider/data_source_registry_gpg_key.go b/internal/provider/data_source_registry_gpg_key.go new file mode 100644 index 000000000..a86e9835c --- /dev/null +++ b/internal/provider/data_source_registry_gpg_key.go @@ -0,0 +1,119 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceTFERegistryGPGKey{} + _ datasource.DataSourceWithConfigure = &dataSourceTFERegistryGPGKey{} +) + +// NewRegistryGPGKeyDataSource is a helper function to simplify the provider implementation. +func NewRegistryGPGKeyDataSource() datasource.DataSource { + return &dataSourceTFERegistryGPGKey{} +} + +// dataSourceTFERegistryGPGKey is the data source implementation. +type dataSourceTFERegistryGPGKey struct { + config ConfiguredClient +} + +// Metadata returns the data source type name. +func (d *dataSourceTFERegistryGPGKey) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_gpg_key" +} + +// Schema defines the schema for the data source. +func (d *dataSourceTFERegistryGPGKey) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "This data source can be used to retrieve a private registry GPG key.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Required: true, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + }, + "ascii_armor": schema.StringAttribute{ + Description: "ASCII-armored representation of the GPG key.", + Computed: true, + }, + "created_at": schema.StringAttribute{ + Description: "The time when the GPG key was created.", + Computed: true, + }, + "updated_at": schema.StringAttribute{ + Description: "The time when the GPG key was last updated.", + Computed: true, + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *dataSourceTFERegistryGPGKey) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceTFERegistryGPGKey) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelTFERegistryGPGKey + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(d.config.dataOrDefaultOrganization(ctx, req.Config, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + keyID := tfe.GPGKeyID{ + RegistryName: "private", + Namespace: organization, + KeyID: data.ID.ValueString(), + } + + tflog.Debug(ctx, "Reading private registry GPG key") + key, err := d.config.Client.GPGKeys.Read(ctx, keyID) + if err != nil { + resp.Diagnostics.AddError("Unable to read private registry GPG key", err.Error()) + return + } + + data = modelFromTFEVGPGKey(key) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/data_source_registry_gpg_key_test.go b/internal/provider/data_source_registry_gpg_key_test.go new file mode 100644 index 000000000..f7b88a615 --- /dev/null +++ b/internal/provider/data_source_registry_gpg_key_test.go @@ -0,0 +1,46 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFERegistryGPGKeyDataSource_basic(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryGPGKeyDataSourceConfig(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.tfe_registry_gpg_key.foobar", "organization", orgName), + resource.TestCheckResourceAttrSet("data.tfe_registry_gpg_key.foobar", "id"), + resource.TestCheckResourceAttrSet("data.tfe_registry_gpg_key.foobar", "ascii_armor"), + resource.TestCheckResourceAttrSet("data.tfe_registry_gpg_key.foobar", "created_at"), + resource.TestCheckResourceAttrSet("data.tfe_registry_gpg_key.foobar", "updated_at")), + }, + }, + }) +} + +func testAccTFERegistryGPGKeyDataSourceConfig(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_gpg_key" "foobar" { + organization = tfe_organization.foobar.name + + id = tfe_registry_gpg_key.foobar.id +} +`, testAccTFERegistryGPGKeyResourceConfig(orgName)) +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index d79c6993b..816d60af4 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -113,6 +113,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ + NewRegistryGPGKeyDataSource, NewSAMLSettingsDataSource, } } diff --git a/website/docs/d/registry_gpg_key.html.markdown b/website/docs/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..434bcc7af --- /dev/null +++ b/website/docs/d/registry_gpg_key.html.markdown @@ -0,0 +1,32 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```hcl +data "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + id = "13DFECCA3B58CE4A" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `ascii_armor` - ASCII-armored representation of the GPG key. +* `created_at` - The time when the GPG key was created. +* `updated_at` - The time when the GPG key was last updated. From c951fbd22a2ba59a05fb8349824c7c6cdf485ea4 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Sat, 2 Dec 2023 18:07:49 +0200 Subject: [PATCH 151/420] Add `tfe_registry_gpg_keys` data source Retrieves all private registry GPG keys of an organization. --- CHANGELOG.md | 1 + .../provider/data_source_registry_gpg_keys.go | 146 ++++++++++++++++++ .../data_source_registry_gpg_keys_test.go | 86 +++++++++++ internal/provider/provider_next.go | 1 + .../docs/d/registry_gpg_keys.html.markdown | 33 ++++ 5 files changed, 267 insertions(+) create mode 100644 internal/provider/data_source_registry_gpg_keys.go create mode 100644 internal/provider/data_source_registry_gpg_keys_test.go create mode 100644 website/docs/d/registry_gpg_keys.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 1816e1520..6772601c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ FEATURES: * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * **New Resource**: `r/tfe_registry_gpg_key` is a new resource for managing private registry GPG keys, by @tmatilai * **New Data Source**: `d/tfe_registry_gpg_key` is a new data source to retrieve a private registry GPG key, by @tmatilai +* **New Data Source**: `d/tfe_registry_gpg_keys` is a new data source to retrieve all private registry GPG keys of an organization, by @tmatilai ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) diff --git a/internal/provider/data_source_registry_gpg_keys.go b/internal/provider/data_source_registry_gpg_keys.go new file mode 100644 index 000000000..dc8b15f53 --- /dev/null +++ b/internal/provider/data_source_registry_gpg_keys.go @@ -0,0 +1,146 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceTFERegistryGPGKeys{} + _ datasource.DataSourceWithConfigure = &dataSourceTFERegistryGPGKeys{} +) + +// NewRegistryGPGKeysDataSource is a helper function to simplify the provider implementation. +func NewRegistryGPGKeysDataSource() datasource.DataSource { + return &dataSourceTFERegistryGPGKeys{} +} + +// dataSourceTFERegistryGPGKeys is the data source implementation. +type dataSourceTFERegistryGPGKeys struct { + config ConfiguredClient +} + +// modelTFERegistryGPGKeys maps the data source schema data. +type modelTFERegistryGPGKeys struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + Keys []modelTFERegistryGPGKey `tfsdk:"keys"` +} + +// Metadata returns the data source type name. +func (d *dataSourceTFERegistryGPGKeys) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_gpg_keys" +} + +// Schema defines the schema for the data source. +func (d *dataSourceTFERegistryGPGKeys) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "This data source can be used to retrieve all private registry GPG keys of an organization.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + }, + "keys": schema.ListAttribute{ + Description: "List of GPG keys in the organization.", + Computed: true, + ElementType: types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "id": types.StringType, + "organization": types.StringType, + "ascii_armor": types.StringType, + "created_at": types.StringType, + "updated_at": types.StringType, + }, + }, + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *dataSourceTFERegistryGPGKeys) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceTFERegistryGPGKeys) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelTFERegistryGPGKeys + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(d.config.dataOrDefaultOrganization(ctx, req.Config, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + options := tfe.GPGKeyListOptions{ + Namespaces: []string{organization}, + } + tflog.Debug(ctx, "Listing private registry GPG keys") + keyList, err := d.config.Client.GPGKeys.ListPrivate(ctx, options) + if err != nil { + resp.Diagnostics.AddError("Unable to list private registry GPG keys", err.Error()) + return + } + + data.ID = types.StringValue(organization) + data.Organization = types.StringValue(organization) + data.Keys = []modelTFERegistryGPGKey{} + + for { + for _, key := range keyList.Items { + data.Keys = append(data.Keys, modelFromTFEVGPGKey(key)) + } + + if keyList.CurrentPage >= keyList.TotalPages { + break + } + options.PageNumber = keyList.NextPage + + tflog.Debug(ctx, "Listing private registry GPG keys") + keyList, err = d.config.Client.GPGKeys.ListPrivate(ctx, options) + if err != nil { + resp.Diagnostics.AddError("Unable to list private registry GPG keys", err.Error()) + return + } + } + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/data_source_registry_gpg_keys_test.go b/internal/provider/data_source_registry_gpg_keys_test.go new file mode 100644 index 000000000..b885be7f3 --- /dev/null +++ b/internal/provider/data_source_registry_gpg_keys_test.go @@ -0,0 +1,86 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFERegistryGPGKeysDataSource_basic(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryGPGKeysDataSourceConfig(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_gpg_keys.all", "organization", orgName), + resource.TestCheckResourceAttr( + "data.tfe_registry_gpg_keys.all", "keys.#", "1"), + resource.TestCheckResourceAttrSet( + "data.tfe_registry_gpg_keys.all", "keys.0.id"), + resource.TestCheckResourceAttr( + "data.tfe_registry_gpg_keys.all", "keys.0.organization", orgName), + resource.TestCheckResourceAttrSet( + "data.tfe_registry_gpg_keys.all", "keys.0.ascii_armor"), + ), + }, + }, + }) +} + +func TestAccTFERegistryGPGKeysDataSource_basicNoKeys(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryGPGKeysDataSourceConfig_noKeys(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_gpg_keys.all", "organization", orgName), + resource.TestCheckResourceAttr( + "data.tfe_registry_gpg_keys.all", "keys.#", "0"), + ), + }, + }, + }) +} + +func testAccTFERegistryGPGKeysDataSourceConfig(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_gpg_keys" "all" { + organization = tfe_organization.foobar.name + + depends_on = [tfe_registry_gpg_key.foobar] +} +`, testAccTFERegistryGPGKeyResourceConfig(orgName)) +} + +func testAccTFERegistryGPGKeysDataSourceConfig_noKeys(orgName string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "%s" + email = "admin@tfe.local" +} + +data "tfe_registry_gpg_keys" "all" { + organization = tfe_organization.foobar.name +} +`, orgName) +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 816d60af4..847becb30 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -114,6 +114,7 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ NewRegistryGPGKeyDataSource, + NewRegistryGPGKeysDataSource, NewSAMLSettingsDataSource, } } diff --git a/website/docs/d/registry_gpg_keys.html.markdown b/website/docs/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..7f4276c43 --- /dev/null +++ b/website/docs/d/registry_gpg_keys.html.markdown @@ -0,0 +1,33 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```hcl +data "tfe_registry_gpg_keys" "all" { + organization = "my-org-name" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `id` - ID of the GPG key. + * `organization` - Name of the organization. + * `ascii_armor` - ASCII-armored representation of the GPG key. + * `created_at` - The time when the GPG key was created. + * `updated_at` - The time when the GPG key was last updated. From 44a0d49605edc728640f4540b215cf3d0d00cb8a Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Sat, 2 Dec 2023 18:12:15 +0200 Subject: [PATCH 152/420] Add PR links to the changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6772601c1..5b762785f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,9 @@ FEATURES: * `d/tfe_registry_module`: Add `vcs_repo.tags` and `vcs_repo.branch` attributes to allow configuration of `publishing_mechanism`. Add `test_config` to support running tests on `branch`-based registry modules, by @hashimoon [1096](https://github.com/hashicorp/terraform-provider-tfe/pull/1096) * **New Resource**: `r/tfe_organization_default_execution_mode` is a new resource to set the `default_execution_mode` and `default_agent_pool_id` for an organization, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' * `r/tfe_workspace`: Now uses the organization's `default_execution_mode` and `default_agent_pool_id` as the default `execution_mode`, by @SwiftEngineer [1137](https://github.com/hashicorp/terraform-provider-tfe/pull/1137)' -* **New Resource**: `r/tfe_registry_gpg_key` is a new resource for managing private registry GPG keys, by @tmatilai -* **New Data Source**: `d/tfe_registry_gpg_key` is a new data source to retrieve a private registry GPG key, by @tmatilai -* **New Data Source**: `d/tfe_registry_gpg_keys` is a new data source to retrieve all private registry GPG keys of an organization, by @tmatilai +* **New Resource**: `r/tfe_registry_gpg_key` is a new resource for managing private registry GPG keys, by @tmatilai [1160](https://github.com/hashicorp/terraform-provider-tfe/pull/1160) +* **New Data Source**: `d/tfe_registry_gpg_key` is a new data source to retrieve a private registry GPG key, by @tmatilai [1160](https://github.com/hashicorp/terraform-provider-tfe/pull/1160) +* **New Data Source**: `d/tfe_registry_gpg_keys` is a new data source to retrieve all private registry GPG keys of an organization, by @tmatilai [1160](https://github.com/hashicorp/terraform-provider-tfe/pull/1160) ENHANCEMENTS: * `d/tfe_organization`: Make `name` argument optional if configured for the provider, by @tmatilai [1133](https://github.com/hashicorp/terraform-provider-tfe/pull/1133) From 233580a5ae3b60ed000f4501569de26a0f6ccb9d Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 6 Dec 2023 10:10:31 -0700 Subject: [PATCH 153/420] Update "Ascii" -> "ASCII" --- internal/provider/gpg_key.go | 4 ++-- internal/provider/resource_tfe_registry_gpg_key.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/provider/gpg_key.go b/internal/provider/gpg_key.go index ee25671e5..f0dc3e24f 100644 --- a/internal/provider/gpg_key.go +++ b/internal/provider/gpg_key.go @@ -15,7 +15,7 @@ import ( type modelTFERegistryGPGKey struct { ID types.String `tfsdk:"id"` Organization types.String `tfsdk:"organization"` - AsciiArmor types.String `tfsdk:"ascii_armor"` + ASCIIArmor types.String `tfsdk:"ascii_armor"` CreatedAt types.String `tfsdk:"created_at"` UpdatedAt types.String `tfsdk:"updated_at"` } @@ -26,7 +26,7 @@ func modelFromTFEVGPGKey(v *tfe.GPGKey) modelTFERegistryGPGKey { return modelTFERegistryGPGKey{ ID: types.StringValue(v.KeyID), Organization: types.StringValue(v.Namespace), - AsciiArmor: types.StringValue(v.AsciiArmor), + ASCIIArmor: types.StringValue(v.AsciiArmor), CreatedAt: types.StringValue(v.CreatedAt.Format(time.RFC3339)), UpdatedAt: types.StringValue(v.UpdatedAt.Format(time.RFC3339)), } diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go index 8d1b49e0b..bcf583c0f 100644 --- a/internal/provider/resource_tfe_registry_gpg_key.go +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -117,7 +117,7 @@ func (r *resourceTFERegistryGPGKey) Create(ctx context.Context, req resource.Cre options := tfe.GPGKeyCreateOptions{ Type: "gpg-keys", Namespace: organization, - AsciiArmor: plan.AsciiArmor.ValueString(), + AsciiArmor: plan.ASCIIArmor.ValueString(), } tflog.Debug(ctx, "Creating private registry GPG key") From dfab5d733e8f73553610f6f0e069f3effb6a155a Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 6 Dec 2023 14:33:46 -0700 Subject: [PATCH 154/420] registry_gpg_key: Add plan mod for provider org default changes --- internal/provider/provider_custom_diffs.go | 26 +++++++++++++++++-- .../provider/resource_tfe_registry_gpg_key.go | 11 +++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/internal/provider/provider_custom_diffs.go b/internal/provider/provider_custom_diffs.go index a18ccd72a..f2cd82c69 100644 --- a/internal/provider/provider_custom_diffs.go +++ b/internal/provider/provider_custom_diffs.go @@ -3,6 +3,9 @@ package provider import ( "context" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -13,11 +16,30 @@ func customizeDiffIfProviderDefaultOrganizationChanged(c context.Context, diff * plannedOrg := diff.Get("organization").(string) if configOrg.IsNull() && config.Organization != plannedOrg { - // There is no organization configured on the resource, yet it is different from - // the state organization. We must conclude that the provider default organization changed. + // There is no organization configured on the resource, yet the provider org is different from + // the planned organization. We must conclude that the provider default organization changed. if err := diff.SetNew("organization", config.Organization); err != nil { return err } } return nil } + +func modifyPlanForDefaultOrganizationChange(ctx context.Context, providerDefaultOrg string, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + if req.State.Raw.IsNull() { + return + } + + orgPath := path.Root("organization") + + var configOrg, plannedOrg *string + resp.Diagnostics.Append(req.Config.GetAttribute(ctx, orgPath, &configOrg)...) + resp.Diagnostics.Append(req.Plan.GetAttribute(ctx, orgPath, &plannedOrg)...) + + if configOrg == nil && plannedOrg != nil && providerDefaultOrg != *plannedOrg { + // There is no organization configured on the resource, yet the provider org is different from + // the planned organization value. We must conclude that the provider default organization changed. + resp.Plan.SetAttribute(ctx, orgPath, types.StringValue(providerDefaultOrg)) + resp.RequiresReplace.Append(orgPath) + } +} diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go index bcf583c0f..98d8cbd44 100644 --- a/internal/provider/resource_tfe_registry_gpg_key.go +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -37,6 +37,10 @@ func (r *resourceTFERegistryGPGKey) Metadata(ctx context.Context, req resource.M resp.TypeName = req.ProviderTypeName + "_registry_gpg_key" } +func (r *resourceTFERegistryGPGKey) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req, resp) +} + func (r *resourceTFERegistryGPGKey) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Description: "Manages a public key of the GPG key pair used to sign releases of private providers in the private registry.", @@ -57,6 +61,9 @@ func (r *resourceTFERegistryGPGKey) Schema(ctx context.Context, req resource.Sch Validators: []validator.String{ stringvalidator.LengthAtLeast(1), }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, "ascii_armor": schema.StringAttribute{ Description: "ASCII-armored representation of the GPG key.", @@ -175,12 +182,10 @@ func (r *resourceTFERegistryGPGKey) Update(ctx context.Context, req resource.Upd // Read Terraform plan data into the model resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) - if resp.Diagnostics.HasError() { - return - } // Read Terraform prior state data into the model resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { return } From 66550acf342385fee1fa9d07cf1d583f8ed3ce82 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 7 Dec 2023 11:58:02 -0700 Subject: [PATCH 155/420] Remove Update logic from tfe_registry_gpg_key --- .../provider/resource_tfe_registry_gpg_key.go | 39 +++---------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go index 98d8cbd44..b3b7cda49 100644 --- a/internal/provider/resource_tfe_registry_gpg_key.go +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -177,40 +177,11 @@ func (r *resourceTFERegistryGPGKey) Read(ctx context.Context, req resource.ReadR } func (r *resourceTFERegistryGPGKey) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan modelTFERegistryGPGKey - var state modelTFERegistryGPGKey - - // Read Terraform plan data into the model - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) - - // Read Terraform prior state data into the model - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - - if resp.Diagnostics.HasError() { - return - } - - keyID := tfe.GPGKeyID{ - RegistryName: "private", - Namespace: state.Organization.ValueString(), // The old namespace - KeyID: plan.ID.ValueString(), - } - options := tfe.GPGKeyUpdateOptions{ - Type: "gpg-keys", - Namespace: plan.Organization.ValueString(), // The new namespace - } - - tflog.Debug(ctx, "Updating private registry GPG key") - key, err := r.config.Client.GPGKeys.Update(ctx, keyID, options) - if err != nil { - resp.Diagnostics.AddError("Unable to update private registry GPG key", err.Error()) - return - } - - result := modelFromTFEVGPGKey(key) - - // Save updated data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + // If the resource does not support modification and should always be recreated on + // configuration value updates, the Update logic can be left empty and ensure all + // configurable schema attributes implement the resource.RequiresReplace() + // attribute plan modifier. + resp.Diagnostics.AddError("Update not supported", "The update operation is not supported on this resource. This is a bug in the provider.") } func (r *resourceTFERegistryGPGKey) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { From fbd15fd42e0b296fd7d2642fbd246925050b2e0d Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 7 Dec 2023 13:14:33 -0700 Subject: [PATCH 156/420] Add additional interface proof to resourceTFERegistryGPGKey --- internal/provider/resource_tfe_registry_gpg_key.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go index b3b7cda49..0a72ecbec 100644 --- a/internal/provider/resource_tfe_registry_gpg_key.go +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -23,6 +23,7 @@ import ( var _ resource.Resource = &resourceTFERegistryGPGKey{} var _ resource.ResourceWithConfigure = &resourceTFERegistryGPGKey{} var _ resource.ResourceWithImportState = &resourceTFERegistryGPGKey{} +var _ resource.ResourceWithModifyPlan = &resourceTFERegistryGPGKey{} func NewRegistryGPGKeyResource() resource.Resource { return &resourceTFERegistryGPGKey{} From d902196a8107c8281d95e947c8eba6d0a81bcec5 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Dec 2023 00:14:33 +0000 Subject: [PATCH 157/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/tfe_organization_default_execution_mode.html.markdown --- ...ation_default_execution_mode.html.markdown | 66 ++++++++++++++++++ .../cdktf/python/r/workspace.html.markdown | 11 +-- ...ation_default_execution_mode.html.markdown | 69 +++++++++++++++++++ .../typescript/r/workspace.html.markdown | 11 +-- 4 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 website/docs/cdktf/python/r/tfe_organization_default_execution_mode.html.markdown create mode 100644 website/docs/cdktf/typescript/r/tfe_organization_default_execution_mode.html.markdown diff --git a/website/docs/cdktf/python/r/tfe_organization_default_execution_mode.html.markdown b/website/docs/cdktf/python/r/tfe_organization_default_execution_mode.html.markdown new file mode 100644 index 000000000..187014677 --- /dev/null +++ b/website/docs/cdktf/python/r/tfe_organization_default_execution_mode.html.markdown @@ -0,0 +1,66 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_execution_mode" +description: |- + Sets the default execution mode of an organization +--- + + + +# tfe_organization_default_execution_mode + +Sets the default execution mode of an organization. This default execution mode will be used as the default execution mode for all workspaces in the organization. + +## Example Usage + +Basic usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import OrganizationDefaultExecutionMode +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + my_agents = AgentPool(self, "my_agents", + name="agent_smiths", + organization=test.name + ) + OrganizationDefaultExecutionMode(self, "org_default", + default_agent_pool_id=my_agents.id, + default_execution_mode="agent", + organization=test.name + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `default_execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `agent_pool_id` - (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 or if `operations` is + provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 1a53aff00..ec0918bdf 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -87,8 +87,8 @@ The following arguments are supported: * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. - Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. + Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. @@ -169,7 +169,10 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resource_count` - The number of resources managed by the workspace. -* `html_url` - The URL to the browsable HTML overview of the workspace +* `html_url` - The URL to the browsable HTML overview of the workspace. +* `setting_overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -184,4 +187,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/tfe_organization_default_execution_mode.html.markdown b/website/docs/cdktf/typescript/r/tfe_organization_default_execution_mode.html.markdown new file mode 100644 index 000000000..09d1f3e2e --- /dev/null +++ b/website/docs/cdktf/typescript/r/tfe_organization_default_execution_mode.html.markdown @@ -0,0 +1,69 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_execution_mode" +description: |- + Sets the default execution mode of an organization +--- + + + +# tfe_organization_default_execution_mode + +Sets the default execution mode of an organization. This default execution mode will be used as the default execution mode for all workspaces in the organization. + +## Example Usage + +Basic usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationDefaultExecutionMode } from "./.gen/providers/tfe/"; +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const myAgents = new AgentPool(this, "my_agents", { + name: "agent_smiths", + organization: test.name, + }); + new OrganizationDefaultExecutionMode(this, "org_default", { + default_agent_pool_id: myAgents.id, + default_execution_mode: "agent", + organization: test.name, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `defaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `agentPoolId` - (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 or if `operations` is + provided. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 0c338f0cb..6c367efab 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -93,8 +93,8 @@ The following arguments are supported: * `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. - Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. + Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided. @@ -175,7 +175,10 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resourceCount` - The number of resources managed by the workspace. -* `htmlUrl` - The URL to the browsable HTML overview of the workspace +* `htmlUrl` - The URL to the browsable HTML overview of the workspace. +* `settingOverwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -190,4 +193,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file From 17b9ebc0bdd28109398cc20d6cac12f92eb01f15 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Dec 2023 00:15:00 +0000 Subject: [PATCH 158/420] cdktf: update r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown --- .../python/r/registry_gpg_key.html.markdown | 59 ++++++++++++++++++ .../r/registry_gpg_key.html.markdown | 62 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 website/docs/cdktf/python/r/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown new file mode 100644 index 000000000..ca0f62560 --- /dev/null +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -0,0 +1,59 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Manages private registry GPG keys. +--- + + + +# tfe_registry_gpg_key + +Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. + +The provided GPG key must be ASCII-armored, i.e. starting with: +"`-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n...`". + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import RegistryGpgKey +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + RegistryGpgKey(self, "example", + ascii_armor=Fn.file("my-public-key.asc"), + organization="my-org-name" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `ascii_armor` - (Required) ASCII-armored representation of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `id` - ID of the GPG key. +* `created_at` - The time when the GPG key was created. +* `updated_at` - The time when the GPG key was last updated. + +## Import + +Keys can be imported; use `/` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown new file mode 100644 index 000000000..03550caec --- /dev/null +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -0,0 +1,62 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Manages private registry GPG keys. +--- + + + +# tfe_registry_gpg_key + +Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. + +The provided GPG key must be ASCII-armored, i.e. starting with: +"`-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n...`". + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryGpgKey } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new RegistryGpgKey(this, "example", { + ascii_armor: Fn.file("my-public-key.asc"), + organization: "my-org-name", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `asciiArmor` - (Required) ASCII-armored representation of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `id` - ID of the GPG key. +* `createdAt` - The time when the GPG key was created. +* `updatedAt` - The time when the GPG key was last updated. + +## Import + +Keys can be imported; use `/` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` + + \ No newline at end of file From 7d45da9190cbdc52accadc8b9b5212272963d0bb Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Dec 2023 00:15:22 +0000 Subject: [PATCH 159/420] cdktf: update d/team_access.html.markdown,d/team.html.markdown,d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/registry_gpg_keys.html.markdown,d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown --- .../python/d/registry_gpg_key.html.markdown | 47 +++++++++++++++++ .../python/d/registry_gpg_keys.html.markdown | 48 +++++++++++++++++ .../d/registry_gpg_key.html.markdown | 50 ++++++++++++++++++ .../d/registry_gpg_keys.html.markdown | 51 +++++++++++++++++++ 4 files changed, 196 insertions(+) create mode 100644 website/docs/cdktf/python/d/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/python/d/registry_gpg_keys.html.markdown create mode 100644 website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..131a5e50f --- /dev/null +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import DataTfeRegistryGpgKey +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataTfeRegistryGpgKey(self, "example", + id="13DFECCA3B58CE4A", + organization="my-org-name" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `ascii_armor` - ASCII-armored representation of the GPG key. +* `created_at` - The time when the GPG key was created. +* `updated_at` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..f8e45f86b --- /dev/null +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import DataTfeRegistryGpgKeys +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataTfeRegistryGpgKeys(self, "all", + organization="my-org-name" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `id` - ID of the GPG key. + * `organization` - Name of the organization. + * `ascii_armor` - ASCII-armored representation of the GPG key. + * `created_at` - The time when the GPG key was created. + * `updated_at` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..c802b8872 --- /dev/null +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -0,0 +1,50 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataTfeRegistryGpgKey(this, "example", { + id: "13DFECCA3B58CE4A", + organization: "my-org-name", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `asciiArmor` - ASCII-armored representation of the GPG key. +* `createdAt` - The time when the GPG key was created. +* `updatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..e44814c0a --- /dev/null +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -0,0 +1,51 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataTfeRegistryGpgKeys(this, "all", { + organization: "my-org-name", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `id` - ID of the GPG key. + * `organization` - Name of the organization. + * `ascii_armor` - ASCII-armored representation of the GPG key. + * `created_at` - The time when the GPG key was created. + * `updated_at` - The time when the GPG key was last updated. + + \ No newline at end of file From 30ef66248f4ba1dcf1524282d5233033f67b3d84 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Wed, 13 Dec 2023 18:49:04 -0800 Subject: [PATCH 160/420] Docs tweaks for tfe_workspace_settings and friends Updating several things I found unclear as a user, plus one thing I found unclear as a fellow maintainer. Also, an important adjustment to some messaging: `r/tfe_workspace_settings` _cannot_ safely be used as a data source, because it interprets absence of each optional argument to explicitly set the workspace's corresponding overwrite to false. This makes me believe we need an overwrites object attribute added to `d/workspace`, but this PR defers that for later. --- internal/provider/resource_tfe_workspace.go | 6 ++++++ website/docs/d/workspace.html.markdown | 2 +- website/docs/r/organization_default_settings.html.markdown | 6 ++++-- website/docs/r/workspace.html.markdown | 2 +- website/docs/r/workspace_settings.markdown | 4 ++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index b19513c04..435d15ed4 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -598,6 +598,12 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } + // NOTE: since agent_pool_id and execution_mode are both deprecated on + // tfe_workspace and we want tfe_workspace_settings to be authoritative, + // we must not set the overwrites values to false in the checks below. + // (Actually, I think we don't need to set them to true here either, + // since the API understands an explicit value in an update request to + // also result in an implicit overwrite = true.) if d.HasChange("agent_pool_id") { // Need the raw configuration value of the agent_pool_id because when the workspace's execution mode is set // to default, we can't know for certain what the default value of the agent pool will be. This means we can diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index 2c1740d1f..c05287009 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -60,7 +60,7 @@ In addition to all arguments above, the following attributes are exported: * `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcs_repo` - Settings for the workspace's VCS repository. * `working_directory` - A relative path that Terraform will execute within. -* `execution_mode` - **Deprecated** Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Use the `tfe_workspace_settings` resource instead. +* `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. * `html_url` - The URL to the browsable HTML overview of the workspace diff --git a/website/docs/r/organization_default_settings.html.markdown b/website/docs/r/organization_default_settings.html.markdown index b6e8754d6..72f4c3882 100644 --- a/website/docs/r/organization_default_settings.html.markdown +++ b/website/docs/r/organization_default_settings.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_organization_default_settings -Primarily, this is used to set the default execution mode of an organization. This setting will be used as the default for all workspaces in the organization. +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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). ## Example Usage @@ -32,7 +32,9 @@ resource "tfe_organization_default_settings" "org_default" { resource "tfe_workspace" "my_workspace" { name = "my-workspace" - # Ensures this workspace will inherit the org defaults + # This workspace will use the org defaults, and will report those defaults as + # the values of its corresponding attributes. Use depends_on to get accurate + # values immediately, and to ensure reliable behavior of tfe_workspace_run. depends_on = [tfe_organization_default_settings.org_default] } ``` diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 22c6d9da7..e314fe4ce 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -9,7 +9,7 @@ description: |- Provides a workspace resource. -~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace has been deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings). Use caution when unsetting `execution_mode` because the default value `"remote"` is no longer applied when the `execution_mode` is unset. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `execution_mode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. ~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. diff --git a/website/docs/r/workspace_settings.markdown b/website/docs/r/workspace_settings.markdown index 880e3ef90..8fa1e6e5d 100644 --- a/website/docs/r/workspace_settings.markdown +++ b/website/docs/r/workspace_settings.markdown @@ -7,7 +7,7 @@ description: |- # tfe_workspace_settings -Manages or reads execution mode and agent pool settings for a workspace. If [tfe_organization_default_settings](organization_default_settings.html) are used, those settings may be read using a combination of the read-only `overwrites` argument and the setting itself. +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument. ## Example Usage @@ -88,7 +88,7 @@ The following arguments are supported: * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference From 4da8ce23eb122434f04dcc7d3507fb675c719c92 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:14:13 +0000 Subject: [PATCH 161/420] [COMPLIANCE] Add Copyright and License Headers --- internal/provider/provider_custom_diffs.go | 3 +++ .../provider/resource_tfe_organization_default_settings.go | 3 +++ .../resource_tfe_organization_default_settings_test.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/internal/provider/provider_custom_diffs.go b/internal/provider/provider_custom_diffs.go index f2cd82c69..6a6c6cc63 100644 --- a/internal/provider/provider_custom_diffs.go +++ b/internal/provider/provider_custom_diffs.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_tfe_organization_default_settings.go b/internal/provider/resource_tfe_organization_default_settings.go index 9a9c6cc95..c6fe9c3af 100644 --- a/internal/provider/resource_tfe_organization_default_settings.go +++ b/internal/provider/resource_tfe_organization_default_settings.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_tfe_organization_default_settings_test.go b/internal/provider/resource_tfe_organization_default_settings_test.go index c7beb2891..62616e2af 100644 --- a/internal/provider/resource_tfe_organization_default_settings_test.go +++ b/internal/provider/resource_tfe_organization_default_settings_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( From 30a361fd3fffda6ba05e663ebaa4226f5c574174 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:14:06 +0000 Subject: [PATCH 162/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.29.0 to 2.30.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.29.0...v2.30.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 18 +++++++++--------- go.sum | 43 ++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 44c589ff4..0fa30b9f0 100644 --- a/go.mod +++ b/go.mod @@ -15,21 +15,21 @@ require ( github.com/hashicorp/go-tfe v1.40.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 - github.com/hashicorp/hcl/v2 v2.18.0 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.19.0 github.com/hashicorp/terraform-plugin-mux v0.12.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/zclconf/go-cty v1.14.0 - golang.org/x/crypto v0.14.0 // indirect + github.com/zclconf/go-cty v1.14.1 + golang.org/x/crypto v0.15.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.9.0 // indirect golang.org/x/sys v0.14.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.4.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) @@ -56,7 +56,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/grpc v1.57.0 // indirect + google.golang.org/grpc v1.57.1 // indirect ) require ( @@ -65,17 +65,17 @@ require ( ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect - github.com/hashicorp/hc-install v0.6.0 // indirect + github.com/hashicorp/hc-install v0.6.1 // indirect github.com/hashicorp/terraform-registry-address v0.2.2 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/mod v0.12.0 // indirect + golang.org/x/mod v0.13.0 // indirect golang.org/x/sync v0.5.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index e65732311..e62aa36bf 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -13,6 +13,7 @@ github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7N github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -21,8 +22,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= @@ -67,12 +68,12 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.6.0 h1:fDHnU7JNFNSQebVKYhHZ0va1bC6SrPQ8fpebsvNr2w4= -github.com/hashicorp/hc-install v0.6.0/go.mod h1:10I912u3nntx9Umo1VAeYPUUuehk0aRQJYpMwbX5wQA= +github.com/hashicorp/hc-install v0.6.1 h1:IGxShH7AVhPaSuSJpKtVi/EFORNjO+OYVJJrAtGG2mY= +github.com/hashicorp/hc-install v0.6.1/go.mod h1:0fW3jpg+wraYSnFDJ6Rlie3RvLf1bIqVIkzoon4KoVE= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8= -github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 h1:w/i7859FOgNZETHpR7nHNVZzipCypYBNqW5sRZXLFjc= github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= @@ -91,8 +92,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gSNgvMEng2Rn9z3WZY= github.com/hashicorp/terraform-plugin-mux v0.12.0/go.mod h1:8MR0AgmV+Q03DIjyrAKxXyYlq2EUnYBQP8gxAAA0zeM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 h1:wcOKYwPI9IorAJEBLzgclh3xVolO7ZorYd6U1vnok14= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0/go.mod h1:qH/34G25Ugdj5FcM95cSoXzUgIbgfhVLXCcEcYaMwq8= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFAsndeqJ7bZFOGbVO+0Cc= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -152,20 +153,20 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc= -github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -218,16 +219,16 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -237,8 +238,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= +google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= From 57b2edb062736251029751ddfc8de63eb7c359db Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 14 Dec 2023 11:25:26 -0800 Subject: [PATCH 163/420] Upgrade github.com/hashicorp/terraform-plugin-go to v0.20.0 Came out just today, superseding a previous dependabot PR that was waiting around. --- go.mod | 16 ++++++++-------- go.sum | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0fa30b9f0..4c7b9ab63 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.19.0 + github.com/hashicorp/terraform-plugin-go v0.20.0 github.com/hashicorp/terraform-plugin-mux v0.12.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 github.com/hashicorp/terraform-svchost v0.1.1 @@ -27,7 +27,7 @@ require ( github.com/zclconf/go-cty v1.14.1 golang.org/x/crypto v0.15.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.9.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.4.0 // indirect @@ -41,7 +41,7 @@ require ( github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-plugin v1.5.1 // indirect + github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 // indirect github.com/hashicorp/logutils v1.0.0 // indirect @@ -55,8 +55,8 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/grpc v1.57.1 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/grpc v1.60.0 // indirect ) require ( @@ -69,15 +69,15 @@ require ( github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/hashicorp/hc-install v0.6.1 // indirect - github.com/hashicorp/terraform-registry-address v0.2.2 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.13.0 // indirect golang.org/x/sync v0.5.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e62aa36bf..9b6767673 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,7 @@ github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+Licev github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -57,6 +58,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= +github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= +github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.2 h1:ArlarJ8w1Rinx4P1N6Sr00t+GmjJWtYZuSEDYPQBErA= @@ -88,6 +91,8 @@ github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEz github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec= +github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= +github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gSNgvMEng2Rn9z3WZY= @@ -96,6 +101,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFA github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= @@ -148,6 +155,8 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= @@ -180,6 +189,7 @@ golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -216,6 +226,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= @@ -236,10 +247,16 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= +google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= From 8d0a028f73137a5c131dd637e88305f8dc6fd11f Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 14 Dec 2023 11:27:10 -0800 Subject: [PATCH 164/420] go mod tidy --- go.sum | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/go.sum b/go.sum index 9b6767673..0476dcf9b 100644 --- a/go.sum +++ b/go.sum @@ -29,7 +29,6 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -56,8 +55,6 @@ github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBYo+6k= -github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= @@ -89,8 +86,6 @@ github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5O github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU= -github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec= github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= @@ -99,8 +94,6 @@ github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gS github.com/hashicorp/terraform-plugin-mux v0.12.0/go.mod h1:8MR0AgmV+Q03DIjyrAKxXyYlq2EUnYBQP8gxAAA0zeM= github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFAsndeqJ7bZFOGbVO+0Cc= github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= -github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno= -github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -146,15 +139,12 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -177,7 +167,6 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -187,8 +176,7 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= -golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -245,16 +233,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= -google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -266,6 +248,5 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From b4856cf8632ad2710af3580f5ec301a929a73755 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 14 Dec 2023 11:30:19 -0800 Subject: [PATCH 165/420] Bump go version --- go.mod | 2 +- go.sum | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4c7b9ab63..0e53f61e2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-provider-tfe -go 1.19 +go 1.21 require ( github.com/agext/levenshtein v1.2.3 // indirect diff --git a/go.sum b/go.sum index 0476dcf9b..2fa7b2b75 100644 --- a/go.sum +++ b/go.sum @@ -1,31 +1,42 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= +github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -101,8 +112,11 @@ github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv2 github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -111,6 +125,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -133,10 +148,13 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= +github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -150,6 +168,7 @@ github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21 github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= @@ -228,6 +247,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -248,5 +268,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 2f0bf08bf0e829ba46f6e28d94499501822c7f0f Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 14 Dec 2023 11:47:34 -0800 Subject: [PATCH 166/420] Change TF_ACC to string in test-provider-tfe action as per the schema (vscode was yelling at me about it) --- .github/actions/test-provider-tfe/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index c55f26da9..9a10d5cac 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -100,7 +100,7 @@ runs: TFE_ADMIN_VERSION_MAINTENANCE_TOKEN: ${{ inputs.admin_version_maintenance_token }} TFE_USER1: tfe-provider-user1 TFE_USER2: tfe-provider-user2 - TF_ACC: 1 + TF_ACC: "1" ENABLE_TFE: "${{ inputs.enterprise }}" TFC_RUN_TASK_URL: "https://httpstat.us/200" GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" From 07b28d224db317731cc648febcd82c1e58aebcb8 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Thu, 14 Dec 2023 11:48:22 -0800 Subject: [PATCH 167/420] Bump golangci-lint version --- .github/actions/lint-provider-tfe/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/lint-provider-tfe/action.yml b/.github/actions/lint-provider-tfe/action.yml index 06cbc8444..041b1f99f 100644 --- a/.github/actions/lint-provider-tfe/action.yml +++ b/.github/actions/lint-provider-tfe/action.yml @@ -24,7 +24,7 @@ runs: run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/0b5709648c8ba9780e821faf16c5c2bb3262ce3e/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCILINT_VERSION shell: bash env: - GOLANGCILINT_VERSION: v1.52.2 + GOLANGCILINT_VERSION: v1.55.2 - run: make lint shell: bash From a5c9ff0822cb1682e2b3f18411e8659f1113d758 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 14 Dec 2023 15:43:02 -0700 Subject: [PATCH 168/420] Update CHANGELOG.md --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f26d3b59..0f73a314e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,7 @@ -# UNRELEASED - - +# v0.51.0 DEPRECATIONS and BREAKING CHANGES: -* `r/tfe_workspace`: `execution_mode` and `agent_pool_id` attributes have been deprecated in favor of a new resource, `tfe_workspace_settings`. Note that these fields no longer compute defaults which is consistent with using a new resource to manage these same settings. What this means in practice is that if you unset `execution_mode` or `agent_pool_id` without also creating a `tfe_workspace_settings`, the setting will no longer revert to the default "remote" mode. To migrate, relocate the `execution_mode` and `agent_pool_id` arguments to `tfe_workspace_settings`. +* `r/tfe_workspace`: `execution_mode` and `agent_pool_id` attributes have been deprecated in favor of a new resource, `tfe_workspace_settings`. Note that these fields no longer compute defaults which is consistent with using a new resource to manage these same settings. In practice, this means that if you unset `execution_mode` or `agent_pool_id` without also creating a `tfe_workspace_settings`, the setting will no longer revert to the default "remote" mode. To migrate, relocate the `execution_mode` and `agent_pool_id` arguments to `tfe_workspace_settings`. BUG FIXES: * `r/tfe_policy`: Fix the provider ignoring updates to the `query` field, by @skeggse [1108](https://github.com/hashicorp/terraform-provider-tfe/pull/1108) From 194f3d7f52ac3e4d0cff5b3c76e498dacf71f38e Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 18 Dec 2023 12:01:33 -0700 Subject: [PATCH 169/420] organization schema should be computed --- internal/provider/resource_tfe_admin_organization_settings.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/provider/resource_tfe_admin_organization_settings.go b/internal/provider/resource_tfe_admin_organization_settings.go index c44835940..faa7fc5d2 100644 --- a/internal/provider/resource_tfe_admin_organization_settings.go +++ b/internal/provider/resource_tfe_admin_organization_settings.go @@ -26,6 +26,7 @@ func resourceTFEAdminOrganizationSettings() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + Computed: true, }, "access_beta_tools": { Type: schema.TypeBool, From ccac4c5ebe9a7a19088f42f8ecbf153a505f70a1 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 18 Dec 2023 12:05:55 -0700 Subject: [PATCH 170/420] Update CHANGELOG / import docs --- CHANGELOG.md | 5 +++++ website/docs/r/admin_organization_settings.markdown | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f73a314e..a9b3f2d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# UNRELEASED + +BUG FIXES: +* Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) + # v0.51.0 DEPRECATIONS and BREAKING CHANGES: diff --git a/website/docs/r/admin_organization_settings.markdown b/website/docs/r/admin_organization_settings.markdown index 81ba2714e..f6c68e30f 100644 --- a/website/docs/r/admin_organization_settings.markdown +++ b/website/docs/r/admin_organization_settings.markdown @@ -63,7 +63,3 @@ The following arguments are supported: ## Attributes Reference * `sso_enabled` - True if SSO is enabled in this organization - -## Import - -This resource does not manage the creation of an organization and there is no need to import it. From 0fa7da727199de2919cc8359cc171b483e31128c Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Mon, 18 Dec 2023 23:59:49 -0300 Subject: [PATCH 171/420] Add `tfe_registry_provider` resource Add `tfe_registry_provider` resource for managing public and private providers in the private registry. --- CHANGELOG.md | 7 + internal/provider/provider_next.go | 1 + .../resource_tfe_registry_provider.go | 317 ++++++++++++++++++ .../resource_tfe_registry_provider_test.go | 93 +++++ .../docs/r/registry_provider.html.markdown | 75 +++++ 5 files changed, 493 insertions(+) create mode 100644 internal/provider/resource_tfe_registry_provider.go create mode 100644 internal/provider/resource_tfe_registry_provider_test.go create mode 100644 website/docs/r/registry_provider.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f73a314e..2ebc6f8a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# UNRELEASED + + + +FEATURES: +* **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) + # v0.51.0 DEPRECATIONS and BREAKING CHANGES: diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 62dda0daa..45066baac 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -132,6 +132,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ NewRegistryGPGKeyResource, + NewRegistryProviderResource, NewResourceVariable, NewSAMLSettingsResource, NewResourceWorkspaceSettings, diff --git a/internal/provider/resource_tfe_registry_provider.go b/internal/provider/resource_tfe_registry_provider.go new file mode 100644 index 000000000..a2c6dee67 --- /dev/null +++ b/internal/provider/resource_tfe_registry_provider.go @@ -0,0 +1,317 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + "strings" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ resource.Resource = &resourceTFERegistryProvider{} +var _ resource.ResourceWithConfigure = &resourceTFERegistryProvider{} +var _ resource.ResourceWithImportState = &resourceTFERegistryProvider{} +var _ resource.ResourceWithModifyPlan = &resourceTFERegistryProvider{} +var _ resource.ResourceWithValidateConfig = &resourceTFERegistryProvider{} + +func NewRegistryProviderResource() resource.Resource { + return &resourceTFERegistryProvider{} +} + +// resourceTFERegistryProvider implements the tfe_registry_provider resource type +type resourceTFERegistryProvider struct { + config ConfiguredClient +} + +type modelTFERegistryProvider struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + RegistryName types.String `tfsdk:"registry_name"` + Namespace types.String `tfsdk:"namespace"` + Name types.String `tfsdk:"name"` + CreatedAt types.String `tfsdk:"created_at"` + UpdatedAt types.String `tfsdk:"updated_at"` +} + +func modelFromTFERegistryProvider(v *tfe.RegistryProvider) modelTFERegistryProvider { + return modelTFERegistryProvider{ + ID: types.StringValue(v.ID), + Organization: types.StringValue(v.Organization.Name), + RegistryName: types.StringValue(string(v.RegistryName)), + Namespace: types.StringValue(v.Namespace), + Name: types.StringValue(v.Name), + CreatedAt: types.StringValue(v.CreatedAt), + UpdatedAt: types.StringValue(v.UpdatedAt), + } +} + +func (r *resourceTFERegistryProvider) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_provider" +} + +func (r *resourceTFERegistryProvider) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Manages public and private providers in the private registry.", + Version: 1, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "ID of the provider.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "registry_name": schema.StringAttribute{ + Description: "Whether this is a publicly maintained provider or private. Must be either `public` or `private`.", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("private"), + Validators: []validator.String{ + stringvalidator.OneOf( + string(tfe.PrivateRegistry), + string(tfe.PublicRegistry), + ), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "namespace": schema.StringAttribute{ + Description: "The namespace of the provider. For private providers this is the same as the oraganization.", + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "name": schema.StringAttribute{ + Description: "Name of the provider.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "created_at": schema.StringAttribute{ + Description: "The time when the provider was created.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "updated_at": schema.StringAttribute{ + Description: "The time when the provider was last updated.", + Computed: true, + }, + }, + } +} + +// Configure implements resource.ResourceWithConfigure +func (r *resourceTFERegistryProvider) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +func (r *resourceTFERegistryProvider) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse) { + var config modelTFERegistryProvider + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + + if resp.Diagnostics.HasError() { + return + } + + if config.RegistryName.ValueString() == "public" && (config.Namespace.IsNull() || config.Namespace.IsUnknown()) { + resp.Diagnostics.AddAttributeError( + path.Root("namespace"), + "Missing Attribute Configuration", + "Expected namespace to be configured when registry_name is \"public\".", + ) + } else if (config.RegistryName.IsNull() || config.RegistryName.ValueString() == "private") && !config.Namespace.IsNull() && !config.Namespace.IsUnknown() { + resp.Diagnostics.AddAttributeError( + path.Root("namespace"), + "Invalid Attribute Combination", + "The namespace attribute cannot be configured when registry_name is \"private\".", + ) + } +} + +func (r *resourceTFERegistryProvider) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req, resp) +} + +func (r *resourceTFERegistryProvider) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan modelTFERegistryProvider + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.Plan, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + registryName := plan.RegistryName.ValueString() + + var namespace string + if registryName == "private" { + namespace = organization + } else { + namespace = plan.Namespace.ValueString() + } + + options := tfe.RegistryProviderCreateOptions{ + Type: "registry-providers", + Name: plan.Name.ValueString(), + Namespace: namespace, + RegistryName: tfe.RegistryName(registryName), + } + + tflog.Debug(ctx, "Creating private registry provider") + provider, err := r.config.Client.RegistryProviders.Create(ctx, organization, options) + if err != nil { + resp.Diagnostics.AddError("Unable to create private registry provider", err.Error()) + return + } + + result := modelFromTFERegistryProvider(provider) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFERegistryProvider) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelTFERegistryProvider + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.State, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + registryName := state.RegistryName.ValueString() + + providerID := tfe.RegistryProviderID{ + OrganizationName: organization, + RegistryName: tfe.RegistryName(registryName), + Namespace: state.Namespace.ValueString(), + Name: state.Name.ValueString(), + } + + options := tfe.RegistryProviderReadOptions{} + + tflog.Debug(ctx, "Reading private registry provider") + provider, err := r.config.Client.RegistryProviders.Read(ctx, providerID, &options) + if err != nil { + resp.Diagnostics.AddError("Unable to read private registry provider", err.Error()) + return + } + + result := modelFromTFERegistryProvider(provider) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFERegistryProvider) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // If the resource does not support modification and should always be recreated on + // configuration value updates, the Update logic can be left empty and ensure all + // configurable schema attributes implement the resource.RequiresReplace() + // attribute plan modifier. + resp.Diagnostics.AddError("Update not supported", "The update operation is not supported on this resource. This is a bug in the provider.") +} + +func (r *resourceTFERegistryProvider) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state modelTFERegistryProvider + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + registryName := state.RegistryName.ValueString() + + providerID := tfe.RegistryProviderID{ + OrganizationName: state.Organization.ValueString(), + RegistryName: tfe.RegistryName(registryName), + Namespace: state.Namespace.ValueString(), + Name: state.Name.ValueString(), + } + + tflog.Debug(ctx, "Deleting private registry provider") + err := r.config.Client.RegistryProviders.Delete(ctx, providerID) + if err != nil { + resp.Diagnostics.AddError("Unable to delete private registry provider", err.Error()) + return + } +} + +func (r *resourceTFERegistryProvider) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 4) + if len(s) != 4 { + resp.Diagnostics.AddError( + "Error importing variable", + fmt.Sprintf("Invalid variable import format: %s (expected ///)", req.ID), + ) + return + } + + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("registry_name"), s[1])...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("namespace"), s[2])...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("name"), s[3])...) +} diff --git a/internal/provider/resource_tfe_registry_provider_test.go b/internal/provider/resource_tfe_registry_provider_test.go new file mode 100644 index 000000000..37dc10ee8 --- /dev/null +++ b/internal/provider/resource_tfe_registry_provider_test.go @@ -0,0 +1,93 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFERegistryProviderResource_public(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProviderResourceConfig_public(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "id"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "organization", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "registry_name", "public"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "namespace", "hashicorp"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "name", "aws"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "created_at"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "updated_at"), + ), + }, + }, + }) +} + +func TestAccTFERegistryProviderResource_private(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProviderResourceConfig_private(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "id"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "organization", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "registry_name", "private"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "namespace", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "name", "example"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "created_at"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "updated_at"), + ), + }, + }, + }) +} + +func testAccTFERegistryProviderResourceConfig_public(orgName string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "%s" + email = "admin@tfe.local" +} + +resource "tfe_registry_provider" "foobar" { + organization = tfe_organization.foobar.name + + registry_name = "public" + namespace = "hashicorp" + name = "aws" +} +`, orgName) +} + +func testAccTFERegistryProviderResourceConfig_private(orgName string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "%s" + email = "admin@tfe.local" +} + +resource "tfe_registry_provider" "foobar" { + organization = tfe_organization.foobar.name + + name = "example" +} +`, orgName) +} diff --git a/website/docs/r/registry_provider.html.markdown b/website/docs/r/registry_provider.html.markdown new file mode 100644 index 000000000..3f3631670 --- /dev/null +++ b/website/docs/r/registry_provider.html.markdown @@ -0,0 +1,75 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```hcl +resource "tfe_organization" "example" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_registry_provider" "example" { + organization = tfe_organization.example.name + + name = "my-provider" +} +``` + +Create public provider: + +```hcl +resource "tfe_organization" "example" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_registry_provider" "example" { + organization = tfe_organization.example.name + + registry_name = "public" + namespace = "hashicorp" + name = "aws" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registry_name` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `created_at` - The time when the provider was created. +* `updated_at` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` From a6350e8055017a2b3151290a0ec6d4376bc1b5db Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 20 Dec 2023 08:41:03 +0000 Subject: [PATCH 172/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown --- .../cdktf/python/r/workspace.html.markdown | 45 +++-- .../python/r/workspace_settings.markdown | 155 ++++++++++++++++ .../typescript/r/workspace.html.markdown | 45 +++-- .../typescript/r/workspace_settings.markdown | 171 ++++++++++++++++++ 4 files changed, 370 insertions(+), 46 deletions(-) create mode 100644 website/docs/cdktf/python/r/workspace_settings.markdown create mode 100644 website/docs/cdktf/typescript/r/workspace_settings.markdown diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index ec0918bdf..f82ec0174 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -11,6 +11,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `execution_mode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -41,7 +43,7 @@ class MyConvertedCode(TerraformStack): ) ``` -With `execution_mode` of `agent`: +Usage with vcs_repo: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -51,7 +53,7 @@ from cdktf import TerraformStack # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.tfe.agent_pool import AgentPool +from imports.tfe.oauth_client import OauthClient from imports.tfe.organization import Organization from imports.tfe.workspace import Workspace class MyConvertedCode(TerraformStack): @@ -61,15 +63,22 @@ class MyConvertedCode(TerraformStack): email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", - name="my-agent-pool-name", - organization=test_organization.name + test = OauthClient(self, "test", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token="oauth_token_id", + organization=test_organization, + service_provider="github" ) - Workspace(self, "test", - agent_pool_id=test_agent_pool.id, - execution_mode="agent", - name="my-workspace-name", - organization=test_organization.name + Workspace(self, "parent", + name="parent-ws", + organization=test_organization, + queue_all_runs=False, + vcs_repo=WorkspaceVcsRepo( + branch="main", + identifier="my-org-name/vcs-repository", + oauth_token_id=test.oauth_token_id + ) ) ``` @@ -78,20 +87,13 @@ class MyConvertedCode(TerraformStack): The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` - to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is - provided. +* `agent_pool_id` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. -* `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. - Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` - execution modes are valid. When set to `local`, the workspace will be used - for state storage only. This value _must not_ be provided if `operations` - is provided. +* `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -170,9 +172,6 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resource_count` - The number of resources managed by the workspace. * `html_url` - The URL to the browsable HTML overview of the workspace. -* `setting_overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -187,4 +186,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown new file mode 100644 index 000000000..c478e7282 --- /dev/null +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -0,0 +1,155 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + + + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument. + +## Example Usage + +Basic usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test_organization = Organization(self, "test-organization", + email="admin@company.com", + name="my-org-name" + ) + test = Workspace(self, "test", + name="my-workspace-name", + organization=test_organization.name + ) + WorkspaceSettings(self, "test-settings", + execution_mode="local", + workspace_id=test.id + ) +``` + +With `execution_mode` of `agent`: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test_organization = Organization(self, "test-organization", + email="admin@company.com", + name="my-org-name" + ) + test = Workspace(self, "test", + name="my-workspace-name", + organization=test_organization.name + ) + test_agent_pool = AgentPool(self, "test-agent-pool", + name="my-agent-pool-name", + organization=test_organization.name + ) + tfe_agent_pool_allowed_workspaces_test = AgentPoolAllowedWorkspaces(self, "test_3", + agent_pool_id=test_agent_pool.id, + allowed_workspace_ids=[test.id] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_agent_pool_allowed_workspaces_test.override_logical_id("test") + WorkspaceSettings(self, "test-settings", + agent_pool_id=test_agent_pool.id, + execution_mode="agent", + workspace_id=test.id + ) +``` + +This resource may be used as a data source when no optional arguments are defined: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformOutput, Op, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataTfeWorkspace(self, "test", + name="my-workspace-name", + organization="my-org-name" + ) + tfe_workspace_settings_test = WorkspaceSettings(self, "test_1", + workspace_id=Token.as_string(test.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_workspace_settings_test.override_logical_id("test") + TerraformOutput(self, "workspace-explicit-local-execution", + value=Fn.alltrue( + Token.as_any([ + Op.eq(tfe_workspace_settings_test.execution_mode, "local"), + Fn.lookup_nested(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" + ]) + ])) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `workspace_id` - (Required) ID of the workspace. +* `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` + to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. +* `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The workspace ID. +* `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 6c367efab..726e96f3a 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -11,6 +11,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `executionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -44,7 +46,7 @@ class MyConvertedCode extends TerraformStack { ``` -With `executionMode` of `agent`: +Usage with vcs_repo: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -54,7 +56,7 @@ import { TerraformStack } from "cdktf"; * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; import { Organization } from "./.gen/providers/tfe/organization"; import { Workspace } from "./.gen/providers/tfe/workspace"; class MyConvertedCode extends TerraformStack { @@ -64,15 +66,22 @@ class MyConvertedCode extends TerraformStack { email: "admin@company.com", name: "my-org-name", }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, + const test = new OauthClient(this, "test", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "oauth_token_id", + organization: testOrganization, + serviceProvider: "github", }); - new Workspace(this, "test", { - agentPoolId: testAgentPool.id, - executionMode: "agent", - name: "my-workspace-name", - organization: testOrganization.name, + new Workspace(this, "parent", { + name: "parent-ws", + organization: testOrganization, + queueAllRuns: false, + vcsRepo: { + branch: "main", + identifier: "my-org-name/vcs-repository", + oauthTokenId: test.oauthTokenId, + }, }); } } @@ -84,20 +93,13 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` - to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is - provided. +* `agentPoolId` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. -* `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. - Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local` - execution modes are valid. When set to `local`, the workspace will be used - for state storage only. This value _must not_ be provided if `operations` - is provided. +* `executionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -176,9 +178,6 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resourceCount` - The number of resources managed by the workspace. * `htmlUrl` - The URL to the browsable HTML overview of the workspace. -* `settingOverwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -193,4 +192,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown new file mode 100644 index 000000000..665fea87b --- /dev/null +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -0,0 +1,171 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + + + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument. + +## Example Usage + +Basic usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new Workspace(this, "test", { + name: "my-workspace-name", + organization: testOrganization.name, + }); + new WorkspaceSettings(this, "test-settings", { + executionMode: "local", + workspaceId: test.id, + }); + } +} + +``` + +With `executionMode` of `agent`: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new Workspace(this, "test", { + name: "my-workspace-name", + organization: testOrganization.name, + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + }); + const tfeAgentPoolAllowedWorkspacesTest = new AgentPoolAllowedWorkspaces( + this, + "test_3", + { + agentPoolId: testAgentPool.id, + allowedWorkspaceIds: [test.id], + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); + new WorkspaceSettings(this, "test-settings", { + agentPoolId: testAgentPool.id, + executionMode: "agent", + workspaceId: test.id, + }); + } +} + +``` + +This resource may be used as a data source when no optional arguments are defined: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformOutput, Op, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataTfeWorkspace(this, "test", { + name: "my-workspace-name", + organization: "my-org-name", + }); + const tfeWorkspaceSettingsTest = new WorkspaceSettings(this, "test_1", { + workspaceId: Token.asString(test.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceSettingsTest.overrideLogicalId("test"); + new TerraformOutput(this, "workspace-explicit-local-execution", { + value: Fn.alltrue( + Token.asAny([ + Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), + Fn.lookupNested(tfeWorkspaceSettingsTest.overwrites, [ + "0", + '"execution_mode"', + ]), + ]) + ), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `workspaceId` - (Required) ID of the workspace. +* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` + to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. +* `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The workspace ID. +* `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` + + \ No newline at end of file From 33ff04c8c075525154620b42deefb49cee96e542 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 20 Dec 2023 08:41:31 +0000 Subject: [PATCH 173/420] cdktf: update r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown,r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown,d/teams.html.markdown --- website/docs/cdktf/python/d/workspace.html.markdown | 4 ++-- website/docs/cdktf/typescript/d/workspace.html.markdown | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index de8ddff14..333524a94 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -73,7 +73,7 @@ In addition to all arguments above, the following attributes are exported: * `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcs_repo` - Settings for the workspace's VCS repository. * `working_directory` - A relative path that Terraform will execute within. -* `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `remote`, `local`, or `agent`. +* `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. * `html_url` - The URL to the browsable HTML overview of the workspace @@ -88,4 +88,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index fac92fae9..e00956d27 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -76,7 +76,7 @@ In addition to all arguments above, the following attributes are exported: * `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. -* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `remote`, `local`, or `agent`. +* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. * `htmlUrl` - The URL to the browsable HTML overview of the workspace @@ -91,4 +91,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file From f7d2a8f8637f43e02f75c392805e65f2e06b27f5 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 20 Dec 2023 08:41:41 +0000 Subject: [PATCH 174/420] cdktf: update r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown,r/no_code_module.html.markdown --- ...rganization_default_settings.html.markdown | 70 ++++++++++++++++++ ...rganization_default_settings.html.markdown | 73 +++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 website/docs/cdktf/python/r/organization_default_settings.html.markdown create mode 100644 website/docs/cdktf/typescript/r/organization_default_settings.html.markdown diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown new file mode 100644 index 000000000..3d81b5007 --- /dev/null +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -0,0 +1,70 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_settings +description: |- + Sets the workspace defaults for an organization +--- + + + +# tfe_organization_default_settings + +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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). + +## Example Usage + +Basic usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +from imports.tfe.organization_default_settings import OrganizationDefaultSettings +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + my_agents = AgentPool(self, "my_agents", + name="agent_smiths", + organization=test.name + ) + org_default = OrganizationDefaultSettings(self, "org_default", + default_agent_pool_id=my_agents.id, + default_execution_mode="agent", + organization=test.name + ) + Workspace(self, "my_workspace", + depends_on=[org_default], + name="my-workspace" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `default_execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `default_agent_pool_id` - (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. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown new file mode 100644 index 000000000..5c41a0a0b --- /dev/null +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -0,0 +1,73 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_settings +description: |- + Sets the workspace defaults for an organization +--- + + + +# tfe_organization_default_settings + +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). + +## Example Usage + +Basic usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationDefaultSettings } from "./.gen/providers/tfe/organization-default-settings"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const myAgents = new AgentPool(this, "my_agents", { + name: "agent_smiths", + organization: test.name, + }); + const orgDefault = new OrganizationDefaultSettings(this, "org_default", { + defaultAgentPoolId: myAgents.id, + defaultExecutionMode: "agent", + organization: test.name, + }); + new Workspace(this, "my_workspace", { + dependsOn: [orgDefault], + name: "my-workspace", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `defaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `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. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + + \ No newline at end of file From 6f678798c107bc6370a8be91b567e7fc5f7a0a08 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 21 Dec 2023 09:57:41 -0700 Subject: [PATCH 175/420] Improve agent_pool_allowed_workspaces docs --- ...gent_pool_allowed_workspaces.html.markdown | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/website/docs/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/r/agent_pool_allowed_workspaces.html.markdown index 1161ed459..6f533db42 100644 --- a/website/docs/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/r/agent_pool_allowed_workspaces.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -15,7 +15,7 @@ for Business account. ## Example Usage -Basic usage: +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. ```hcl resource "tfe_organization" "test-organization" { @@ -23,6 +23,7 @@ resource "tfe_organization" "test-organization" { email = "admin@company.com" } +// Ensure workspace and agent pool are create first resource "tfe_workspace" "test-workspace" { name = "my-workspace-name" organization = tfe_organization.test-organization.name @@ -34,9 +35,18 @@ resource "tfe_agent_pool" "test-agent-pool" { organization_scoped = false } -resource "tfe_agent_pool_allowed_workspaces" "test-allowed-workspaces" { +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [tfe_workspace.test-workspace.id] + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -55,4 +65,3 @@ A resource can be imported; use `` as the import ID. For example: ```shell terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - From d902d859abf5194d9421830f22d3df004823263e Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 21 Dec 2023 16:51:33 -0500 Subject: [PATCH 176/420] Clarify GHA installation arguments --- website/docs/d/github_installation.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/d/github_installation.html.markdown b/website/docs/d/github_installation.html.markdown index 23fcbb855..cf505ff6e 100644 --- a/website/docs/d/github_installation.html.markdown +++ b/website/docs/d/github_installation.html.markdown @@ -15,7 +15,7 @@ Use this data source to get information about the Github App Installation. ```hcl data "tfe_github_app_installation" "gha_installation" { - installation_id = 12345 + installation_id = 12345678 } ``` @@ -23,21 +23,21 @@ data "tfe_github_app_installation" "gha_installation" { ```hcl data "tfe_github_app_installation" "gha_installation" { - name = "installation_name" + name = "github_username_or_organization" } ``` ## Argument Reference -The following arguments are supported. At least one of `name`, `installation_id` must be set. +The following arguments are supported. At least one of `name`, `installation_id` must be set. + +* `installation_id` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. +* `name` - (Optional) Name of the Github user or organization account that installed the app. -* `installation_id` - (Optional) ID of the Github Installation as shown in Github. -* `name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `installation_id` or `name`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `id` - The internal ID of the Github Installation. This is different from the `installation_id`. \ No newline at end of file +* `id` - The internal ID of the Github Installation. This is different from the `installation_id`. From 88c1610dd4158f37857bb24d07562a49029d03bb Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Dec 2023 11:14:50 -0700 Subject: [PATCH 177/420] Fixes older tfe, ws_settings always unsets execution_mode --- internal/provider/resource_tfe_workspace_settings.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_workspace_settings.go b/internal/provider/resource_tfe_workspace_settings.go index f8ab6653b..f6fabaff6 100644 --- a/internal/provider/resource_tfe_workspace_settings.go +++ b/internal/provider/resource_tfe_workspace_settings.go @@ -166,9 +166,11 @@ func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req p if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { resp.PlanValue = types.StringUnknown() } - } else if req.Path.Equal(path.Root("execution_mode")) { + } else if configured.ExecutionMode.IsNull() && req.Path.Equal(path.Root("execution_mode")) { // TFE does not support overwrites so default the execution mode to "remote" resp.PlanValue = types.StringValue("remote") + } else if configured.AgentPoolID.IsNull() && req.Path.Equal(path.Root("agent_pool_id")) { + resp.PlanValue = types.StringNull() } } From e0061914f590a4324212dc9ea1c04a6ff8fc1839 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Dec 2023 11:22:55 -0700 Subject: [PATCH 178/420] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b3f2d72..a4a281eb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ BUG FIXES: * Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) +* `/r/tfe_workspace_settings`: Fix compatibility with older versions Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193) # v0.51.0 From 21a610ecba9518aa970fad0f64c7a490451029e0 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 20 Dec 2023 13:01:57 -0700 Subject: [PATCH 179/420] Fix plan modification error when updating tfe_registry_gpg_key --- internal/provider/provider_custom_diffs.go | 13 +- .../provider/provider_custom_diffs_test.go | 115 ++++++++++++++++++ .../provider/resource_tfe_registry_gpg_key.go | 2 +- 3 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 internal/provider/provider_custom_diffs_test.go diff --git a/internal/provider/provider_custom_diffs.go b/internal/provider/provider_custom_diffs.go index 6a6c6cc63..f9b65fc50 100644 --- a/internal/provider/provider_custom_diffs.go +++ b/internal/provider/provider_custom_diffs.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -28,18 +29,18 @@ func customizeDiffIfProviderDefaultOrganizationChanged(c context.Context, diff * return nil } -func modifyPlanForDefaultOrganizationChange(ctx context.Context, providerDefaultOrg string, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - if req.State.Raw.IsNull() { +func modifyPlanForDefaultOrganizationChange(ctx context.Context, providerDefaultOrg string, state tfsdk.State, configAttributes, planAttributes AttrGettable, resp *resource.ModifyPlanResponse) { + if state.Raw.IsNull() { return } orgPath := path.Root("organization") - var configOrg, plannedOrg *string - resp.Diagnostics.Append(req.Config.GetAttribute(ctx, orgPath, &configOrg)...) - resp.Diagnostics.Append(req.Plan.GetAttribute(ctx, orgPath, &plannedOrg)...) + var configOrg, plannedOrg types.String + resp.Diagnostics.Append(configAttributes.GetAttribute(ctx, orgPath, &configOrg)...) + resp.Diagnostics.Append(planAttributes.GetAttribute(ctx, orgPath, &plannedOrg)...) - if configOrg == nil && plannedOrg != nil && providerDefaultOrg != *plannedOrg { + if configOrg.IsNull() && !plannedOrg.IsNull() && providerDefaultOrg != plannedOrg.ValueString() { // There is no organization configured on the resource, yet the provider org is different from // the planned organization value. We must conclude that the provider default organization changed. resp.Plan.SetAttribute(ctx, orgPath, types.StringValue(providerDefaultOrg)) diff --git a/internal/provider/provider_custom_diffs_test.go b/internal/provider/provider_custom_diffs_test.go new file mode 100644 index 000000000..30dfe764b --- /dev/null +++ b/internal/provider/provider_custom_diffs_test.go @@ -0,0 +1,115 @@ +package provider + +import ( + "context" + "testing" + + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +type getter struct { + val types.String +} + +func (g *getter) GetAttribute(_ context.Context, _ path.Path, target interface{}) diag.Diagnostics { + *(target.(*basetypes.StringValue)) = g.val + return diag.Diagnostics{} +} + +func TestModifyPlanForDefaultOrganizationChange(t *testing.T) { + // if configOrg.IsNull() && !plannedOrg.IsNull() && providerDefaultOrg != plannedOrg.ValueString() { + testCases := map[string]struct { + providerDefaultOrg string + planValue types.String + configValue types.String + expectedPlanValue string + expectedRequiresReplace bool + }{ + "No change in provider org": { + providerDefaultOrg: "foo", + planValue: types.StringValue("foo"), + configValue: types.StringNull(), + expectedPlanValue: "foo", + expectedRequiresReplace: false, + }, + "Change in provider org": { + providerDefaultOrg: "bar", + planValue: types.StringValue("foo"), + configValue: types.StringNull(), + expectedPlanValue: "bar", + expectedRequiresReplace: true, + }, + "Config org changed": { + providerDefaultOrg: "foo", + planValue: types.StringValue("bar"), + configValue: types.StringValue("bar"), + expectedPlanValue: "bar", + }, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + fakeState := tftypes.NewValue(tftypes.Object{}, make(map[string]tftypes.Value)) + + fakeSchema := schema.Schema{ + Attributes: map[string]schema.Attribute{ + "organization": schema.StringAttribute{ + Computed: true, + Optional: true, + Description: "Test organization", + }, + }, + } + + fakePlan := tftypes.NewValue( + tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{ + "organization": tftypes.String, + }, + }, + map[string]tftypes.Value{ + "organization": tftypes.NewValue(tftypes.String, tc.planValue.ValueString()), + }, + ) + + fakeResponse := &resource.ModifyPlanResponse{ + Plan: tfsdk.Plan{Schema: fakeSchema, Raw: fakePlan}, + RequiresReplace: make(path.Paths, 0), + Diagnostics: diag.Diagnostics{}, + } + + c := context.TODO() + + modifyPlanForDefaultOrganizationChange( + c, + tc.providerDefaultOrg, + tfsdk.State{Raw: fakeState}, + &getter{val: tc.configValue}, + &getter{val: tc.planValue}, + fakeResponse, + ) + + orgPath := path.Root("organization") + var value types.String + fakeResponse.Plan.GetAttribute(c, orgPath, &value) + if fakeResponse.Diagnostics.HasError() { + t.Fatalf("Expected no errors, got %v", fakeResponse.Diagnostics) + } + + if value.ValueString() != tc.expectedPlanValue { + t.Fatalf("Expected plan value to be %q, got %q", tc.expectedPlanValue, value.ValueString()) + } + + if tc.expectedRequiresReplace && len(fakeResponse.RequiresReplace) == 0 { + t.Fatal("Expected RequiresReplace to be set, but it was not") + } + }) + } +} diff --git a/internal/provider/resource_tfe_registry_gpg_key.go b/internal/provider/resource_tfe_registry_gpg_key.go index 0a72ecbec..216a19903 100644 --- a/internal/provider/resource_tfe_registry_gpg_key.go +++ b/internal/provider/resource_tfe_registry_gpg_key.go @@ -39,7 +39,7 @@ func (r *resourceTFERegistryGPGKey) Metadata(ctx context.Context, req resource.M } func (r *resourceTFERegistryGPGKey) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req, resp) + modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req.State, req.Config, req.Plan, resp) } func (r *resourceTFERegistryGPGKey) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { From 39c3fbab4a1fdaad41740112694164e24fa574a9 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Dec 2023 13:00:09 -0700 Subject: [PATCH 180/420] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b3f2d72..cfc28967d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # UNRELEASED BUG FIXES: -* Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) +* `r/tfe_admin_organization_settings`: Fixed default provider organization usage, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) +* `r/tfe_registry_gpg_key`: Fixed update plans when using default organization, by @brandonc [1190](https://github.com/hashicorp/terraform-provider-tfe/pull/1190) # v0.51.0 From d8e2c878d8bf46caa5928e2ecb05748cb8136318 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Dec 2023 13:00:45 -0700 Subject: [PATCH 181/420] Update CHANGELOG.md Co-authored-by: Sebastian Rivera --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a281eb2..de8084a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ BUG FIXES: * Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) -* `/r/tfe_workspace_settings`: Fix compatibility with older versions Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193) +* `/r/tfe_workspace_settings`: Fix compatibility with older versions of Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193) # v0.51.0 From a8b8f42b93387e7d551bb6c39b8f9ca6c1fc7410 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 22 Dec 2023 14:09:57 -0700 Subject: [PATCH 182/420] Update CHANGELOG for release --- CHANGELOG.md | 4 ++-- website/docs/cdktf/csharp/index.html.markdown | 8 ++++---- website/docs/cdktf/go/index.html.markdown | 8 ++++---- website/docs/cdktf/java/index.html.markdown | 8 ++++---- website/docs/cdktf/python/index.html.markdown | 4 ++-- website/docs/cdktf/typescript/index.html.markdown | 4 ++-- website/docs/index.html.markdown | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb3d7023..506c74233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ -# UNRELEASED +## v0.51.1 BUG FIXES: * `r/tfe_admin_organization_settings`: Fixed default provider organization usage, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) * `r/tfe_registry_gpg_key`: Fixed update plans when using default organization, by @brandonc [1190](https://github.com/hashicorp/terraform-provider-tfe/pull/1190) * `/r/tfe_workspace_settings`: Fix compatibility with older versions of Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193) -# v0.51.0 +## v0.51.0 DEPRECATIONS and BREAKING CHANGES: * `r/tfe_workspace`: `execution_mode` and `agent_pool_id` attributes have been deprecated in favor of a new resource, `tfe_workspace_settings`. Note that these fields no longer compute defaults which is consistent with using a new resource to manage these same settings. In practice, this means that if you unset `execution_mode` or `agent_pool_id` without also creating a `tfe_workspace_settings`, the setting will no longer revert to the default "remote" mode. To migrate, relocate the `execution_mode` and `agent_pool_id` arguments to `tfe_workspace_settings`. diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index 4f9356bba..cea2a6a1c 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.51.1" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.50.0" + version = "~> 0.51.1" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index 4f9356bba..cea2a6a1c 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.51.1" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.50.0" + version = "~> 0.51.1" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index a6579445d..43998b27c 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.51.1" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` token = var.token - version = "~> 0.50.0" + version = "~> 0.51.1" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 6262f883f..0a489d502 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -89,7 +89,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -138,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index b2f3505e3..b5beb6ad5 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -92,7 +92,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -148,4 +148,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index fff59410d..c6a35bcd8 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.51.1" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.50.0" + version = "~> 0.51.1" } # Create an organization From 1be81099f547d709f833d8c1ec632f9c1286a655 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:12:56 +0000 Subject: [PATCH 183/420] [COMPLIANCE] Add Copyright and License Headers --- internal/provider/provider_custom_diffs_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/provider_custom_diffs_test.go b/internal/provider/provider_custom_diffs_test.go index 30dfe764b..7392b7bac 100644 --- a/internal/provider/provider_custom_diffs_test.go +++ b/internal/provider/provider_custom_diffs_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( From d04db24d2f211c4e19fad764573ea53dc2806349 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Thu, 28 Dec 2023 19:49:51 -0300 Subject: [PATCH 184/420] Add `tfe_registry_provider` data source --- CHANGELOG.md | 1 + .../provider/data_source_registry_provider.go | 182 ++++++++++++++++++ .../data_source_registry_provider_test.go | 87 +++++++++ internal/provider/provider_next.go | 1 + .../docs/d/registry_provider.html.markdown | 47 +++++ 5 files changed, 318 insertions(+) create mode 100644 internal/provider/data_source_registry_provider.go create mode 100644 internal/provider/data_source_registry_provider_test.go create mode 100644 website/docs/d/registry_provider.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index a857b8f4e..ebcf7ed20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) +* **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) ## v0.51.1 diff --git a/internal/provider/data_source_registry_provider.go b/internal/provider/data_source_registry_provider.go new file mode 100644 index 000000000..2de329b4a --- /dev/null +++ b/internal/provider/data_source_registry_provider.go @@ -0,0 +1,182 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceTFERegistryProvider{} + _ datasource.DataSourceWithConfigure = &dataSourceTFERegistryProvider{} + _ datasource.DataSourceWithValidateConfig = &dataSourceTFERegistryProvider{} +) + +// NewRegistryProviderDataSource is a helper function to simplify the provider implementation. +func NewRegistryProviderDataSource() datasource.DataSource { + return &dataSourceTFERegistryProvider{} +} + +// dataSourceTFERegistryProvider is the data source implementation. +type dataSourceTFERegistryProvider struct { + config ConfiguredClient +} + +// Metadata returns the data source type name. +func (d *dataSourceTFERegistryProvider) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_provider" +} + +// Schema defines the schema for the data source. +func (d *dataSourceTFERegistryProvider) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "This data source can be used to retrieve a public or private provider from the private registry.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "ID of the provider.", + Computed: true, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + }, + "registry_name": schema.StringAttribute{ + Description: "Whether this is a publicly maintained provider or private. Must be either `public` or `private`.", + Optional: true, + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOf( + string(tfe.PrivateRegistry), + string(tfe.PublicRegistry), + ), + }, + }, + "namespace": schema.StringAttribute{ + Description: "The namespace of the provider. For private providers this is the same as the oraganization.", + Optional: true, + Computed: true, + }, + "name": schema.StringAttribute{ + Description: "Name of the provider.", + Required: true, + }, + "created_at": schema.StringAttribute{ + Description: "The time when the provider was created.", + Computed: true, + }, + "updated_at": schema.StringAttribute{ + Description: "The time when the provider was last updated.", + Computed: true, + }, + }, + } +} + +func (r *dataSourceTFERegistryProvider) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse) { + var config modelTFERegistryProvider + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + + if resp.Diagnostics.HasError() { + return + } + + if config.RegistryName.ValueString() == "public" && config.Namespace.IsNull() { + resp.Diagnostics.AddAttributeError( + path.Root("namespace"), + "Missing Attribute Configuration", + "Expected namespace to be configured when registry_name is \"public\".", + ) + } else if (config.RegistryName.IsNull() || config.RegistryName.ValueString() == "private") && !config.Namespace.IsNull() && !config.Namespace.IsUnknown() { + resp.Diagnostics.AddAttributeError( + path.Root("namespace"), + "Invalid Attribute Combination", + "The namespace attribute cannot be configured when registry_name is \"private\".", + ) + } +} + +// Configure adds the provider configured client to the data source. +func (d *dataSourceTFERegistryProvider) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceTFERegistryProvider) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelTFERegistryProvider + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(d.config.dataOrDefaultOrganization(ctx, req.Config, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + var registryName string + if data.RegistryName.IsNull() { + registryName = "private" + } else { + registryName = data.RegistryName.ValueString() + } + + var namespace string + if registryName == "private" { + namespace = organization + } else { + namespace = data.Namespace.ValueString() + } + + providerID := tfe.RegistryProviderID{ + OrganizationName: organization, + RegistryName: tfe.RegistryName(registryName), + Namespace: namespace, + Name: data.Name.ValueString(), + } + + options := tfe.RegistryProviderReadOptions{} + + tflog.Debug(ctx, "Reading private registry provider") + provider, err := d.config.Client.RegistryProviders.Read(ctx, providerID, &options) + if err != nil { + resp.Diagnostics.AddError("Unable to read private registry provider", err.Error()) + return + } + + data = modelFromTFERegistryProvider(provider) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/data_source_registry_provider_test.go b/internal/provider/data_source_registry_provider_test.go new file mode 100644 index 000000000..5c39c18ef --- /dev/null +++ b/internal/provider/data_source_registry_provider_test.go @@ -0,0 +1,87 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFERegistryProviderDataSource_public(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProviderDataSourceConfig_public(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "id"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "organization", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "registry_name", "public"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "namespace", "hashicorp"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "name", "aws"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "created_at"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "updated_at"), + ), + }, + }, + }) +} + +func TestAccTFERegistryProviderDataSource_private(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProviderDataSourceConfig_private(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "id"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "organization", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "registry_name", "private"), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "namespace", orgName), + resource.TestCheckResourceAttr("tfe_registry_provider.foobar", "name", "example"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "created_at"), + resource.TestCheckResourceAttrSet("tfe_registry_provider.foobar", "updated_at"), + ), + }, + }, + }) +} + +func testAccTFERegistryProviderDataSourceConfig_public(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_provider" "foobar" { + organization = tfe_organization.foobar.name + + registry_name = "public" + namespace = tfe_registry_provider.foobar.namespace + name = tfe_registry_provider.foobar.name +} +`, testAccTFERegistryProviderResourceConfig_public(orgName)) +} + +func testAccTFERegistryProviderDataSourceConfig_private(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_provider" "foobar" { + organization = tfe_organization.foobar.name + + name = tfe_registry_provider.foobar.name +} +`, testAccTFERegistryProviderResourceConfig_private(orgName)) +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 45066baac..478260fc9 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -125,6 +125,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource return []func() datasource.DataSource{ NewRegistryGPGKeyDataSource, NewRegistryGPGKeysDataSource, + NewRegistryProviderDataSource, NewSAMLSettingsDataSource, } } diff --git a/website/docs/d/registry_provider.html.markdown b/website/docs/d/registry_provider.html.markdown new file mode 100644 index 000000000..28e5e14b6 --- /dev/null +++ b/website/docs/d/registry_provider.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```hcl +resource "tfe_registry_provider" "example" { + organization = "my-org-name" + name = "my-provider" +} +``` + +A public provider: + +```hcl +resource "tfe_registry_provider" "example" { + organization = "my-org-name" + registry_name = "public" + namespace = "hashicorp" + name = "aws" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registry_name` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `created_at` - The time when the provider was created. +* `updated_at` - The time when the provider was last updated. From ef42d43963786d63caf0780ade367b11e527fd5a Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Fri, 29 Dec 2023 19:31:50 -0300 Subject: [PATCH 185/420] Add `tfe_registry_providers` data source --- CHANGELOG.md | 1 + .../data_source_registry_providers.go | 172 +++++++++++++++ .../data_source_registry_providers_test.go | 207 ++++++++++++++++++ internal/provider/provider_next.go | 1 + .../docs/d/registry_providers.html.markdown | 57 +++++ 5 files changed, 438 insertions(+) create mode 100644 internal/provider/data_source_registry_providers.go create mode 100644 internal/provider/data_source_registry_providers_test.go create mode 100644 website/docs/d/registry_providers.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index ebcf7ed20..6c2a8d41a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) +* **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) ## v0.51.1 diff --git a/internal/provider/data_source_registry_providers.go b/internal/provider/data_source_registry_providers.go new file mode 100644 index 000000000..f22ca736c --- /dev/null +++ b/internal/provider/data_source_registry_providers.go @@ -0,0 +1,172 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceTFERegistryProviders{} + _ datasource.DataSourceWithConfigure = &dataSourceTFERegistryProviders{} +) + +// NewRegistryProvidersDataSource is a helper function to simplify the provider implementation. +func NewRegistryProvidersDataSource() datasource.DataSource { + return &dataSourceTFERegistryProviders{} +} + +// dataSourceTFERegistryProviders is the data source implementation. +type dataSourceTFERegistryProviders struct { + config ConfiguredClient +} + +// modelTFERegistryProviders maps the data source schema data. +type modelTFERegistryProviders struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + RegistryName types.String `tfsdk:"registry_name"` + Search types.String `tfsdk:"search"` + Providers []modelTFERegistryProvider `tfsdk:"providers"` +} + +// Metadata returns the data source type name. +func (d *dataSourceTFERegistryProviders) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_registry_providers" +} + +// Schema defines the schema for the data source. +func (d *dataSourceTFERegistryProviders) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "This data source can be used to retrieve public and private providers from the private registry of an organization.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + Computed: true, + }, + "registry_name": schema.StringAttribute{ + Description: "Whether to list only public or private providers. Must be either `public` or `private`.", + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf( + string(tfe.PrivateRegistry), + string(tfe.PublicRegistry), + ), + }, + }, + "search": schema.StringAttribute{ + Description: "A query string to do a fuzzy search on provider name and namespace.", + Optional: true, + }, + "providers": schema.ListAttribute{ + Description: "List of providers in the organization.", + Computed: true, + ElementType: types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "id": types.StringType, + "organization": types.StringType, + "registry_name": types.StringType, + "namespace": types.StringType, + "name": types.StringType, + "created_at": types.StringType, + "updated_at": types.StringType, + }, + }, + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *dataSourceTFERegistryProviders) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceTFERegistryProviders) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelTFERegistryProviders + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(d.config.dataOrDefaultOrganization(ctx, req.Config, &organization)...) + + if resp.Diagnostics.HasError() { + return + } + + var registryName tfe.RegistryName + if !data.RegistryName.IsNull() { + registryName = tfe.RegistryName(data.RegistryName.ValueString()) + } + + options := tfe.RegistryProviderListOptions{ + RegistryName: registryName, + Search: data.Search.ValueString(), + } + + tflog.Debug(ctx, "Listing private registry providers") + providerList, err := d.config.Client.RegistryProviders.List(ctx, organization, &options) + if err != nil { + resp.Diagnostics.AddError("Unable to list private registry providers", err.Error()) + return + } + + data.ID = types.StringValue(organization) + data.Organization = types.StringValue(organization) + data.Providers = []modelTFERegistryProvider{} + + for { + for _, provider := range providerList.Items { + data.Providers = append(data.Providers, modelFromTFERegistryProvider(provider)) + } + + if providerList.CurrentPage >= providerList.TotalPages { + break + } + options.PageNumber = providerList.NextPage + + tflog.Debug(ctx, "Listing private registry providers") + providerList, err = d.config.Client.RegistryProviders.List(ctx, organization, &options) + if err != nil { + resp.Diagnostics.AddError("Unable to list private registry providers", err.Error()) + return + } + } + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/provider/data_source_registry_providers_test.go b/internal/provider/data_source_registry_providers_test.go new file mode 100644 index 000000000..594607be9 --- /dev/null +++ b/internal/provider/data_source_registry_providers_test.go @@ -0,0 +1,207 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFERegistryProvidersDataSource_all(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProvidersDataSourceConfig_all(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_providers.foobar", "organization", orgName), + testAccTFERegistryProvidersDataSourceEntries("data.tfe_registry_providers.foobar", []string{ + "hashicorp/tfe", + fmt.Sprintf("%s/foobar", orgName), + }), + ), + }, + }, + }) +} + +func TestAccTFERegistryProvidersDataSource_public(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProvidersDataSourceConfig_public(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_providers.foobar", "organization", orgName), + testAccTFERegistryProvidersDataSourceEntries("data.tfe_registry_providers.foobar", []string{ + "hashicorp/tfe", + }), + ), + }, + }, + }) +} + +func TestAccTFERegistryProvidersDataSource_private(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProvidersDataSourceConfig_private(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_providers.foobar", "organization", orgName), + testAccTFERegistryProvidersDataSourceEntries("data.tfe_registry_providers.foobar", []string{ + fmt.Sprintf("%s/foobar", orgName), + }), + ), + }, + }, + }) +} + +func TestAccTFERegistryProvidersDataSource_filtered(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryProvidersDataSourceConfig_filtered(orgName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "data.tfe_registry_providers.foobar", "organization", orgName), + testAccTFERegistryProvidersDataSourceEntries("data.tfe_registry_providers.foobar", []string{ + fmt.Sprintf("%s/foobar", orgName), + }), + ), + }, + }, + }) +} + +func testAccTFERegistryProvidersDataSourceEntries(resourceName string, providers []string) resource.TestCheckFunc { + return func(s *terraform.State) error { + providerDataSource, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("data source '%s' not found.", resourceName) + } + numProvidersStr := providerDataSource.Primary.Attributes["providers.#"] + numProviders, _ := strconv.Atoi(numProvidersStr) + + if numProviders != len(providers) { + return fmt.Errorf("expected %d providers, but found %d.", len(providers), numProviders) + } + + allProvidersMap := map[string]struct{}{} + for i := 0; i < numProviders; i++ { + providerNamespace := providerDataSource.Primary.Attributes[fmt.Sprintf("providers.%d.namespace", i)] + providerName := providerDataSource.Primary.Attributes[fmt.Sprintf("providers.%d.name", i)] + allProvidersMap[fmt.Sprintf("%s/%s", providerNamespace, providerName)] = struct{}{} + } + + for _, provider := range providers { + if _, ok := allProvidersMap[provider]; !ok { + return fmt.Errorf("expected provider '%s' not found.", provider) + } + } + + return nil + } +} + +func testAccTFERegistryProvidersDataSourceConfig_resources(orgName string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "%s" + email = "admin@tfe.local" +} + +resource "tfe_registry_provider" "public" { + organization = tfe_organization.foobar.name + registry_name = "public" + namespace = "hashicorp" + name = "tfe" +} + +resource "tfe_registry_provider" "private" { + organization = tfe_organization.foobar.name + registry_name = "private" + name = "foobar" +} +`, orgName) +} + +func testAccTFERegistryProvidersDataSourceConfig_all(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_providers" "foobar" { + organization = tfe_organization.foobar.name + + depends_on = [tfe_registry_provider.public, tfe_registry_provider.private] +} +`, testAccTFERegistryProvidersDataSourceConfig_resources(orgName)) +} + +func testAccTFERegistryProvidersDataSourceConfig_public(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_providers" "foobar" { + organization = tfe_organization.foobar.name + registry_name = "public" + + depends_on = [tfe_registry_provider.public, tfe_registry_provider.private] +} +`, testAccTFERegistryProvidersDataSourceConfig_resources(orgName)) +} + +func testAccTFERegistryProvidersDataSourceConfig_private(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_providers" "foobar" { + organization = tfe_organization.foobar.name + registry_name = "private" + + depends_on = [tfe_registry_provider.public, tfe_registry_provider.private] +} +`, testAccTFERegistryProvidersDataSourceConfig_resources(orgName)) +} + +func testAccTFERegistryProvidersDataSourceConfig_filtered(orgName string) string { + return fmt.Sprintf(` +%s + +data "tfe_registry_providers" "foobar" { + organization = tfe_organization.foobar.name + search = "foo" + + depends_on = [tfe_registry_provider.public, tfe_registry_provider.private] +} +`, testAccTFERegistryProvidersDataSourceConfig_resources(orgName)) +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 478260fc9..5fdc102f8 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -126,6 +126,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource NewRegistryGPGKeyDataSource, NewRegistryGPGKeysDataSource, NewRegistryProviderDataSource, + NewRegistryProvidersDataSource, NewSAMLSettingsDataSource, } } diff --git a/website/docs/d/registry_providers.html.markdown b/website/docs/d/registry_providers.html.markdown new file mode 100644 index 000000000..72f0ffcfc --- /dev/null +++ b/website/docs/d/registry_providers.html.markdown @@ -0,0 +1,57 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```hcl +data "tfe_registry_providers" "all" { + organization = "my-org-name" +} +``` + +All private providers: + +```hcl +data "tfe_registry_providers" "private" { + organization = "my-org-name" + registry_name = "private" +} +``` + +Providers with "hashicorp" in their namespace or name: + +```hcl +data "tfe_registry_providers" "hashicorp" { + organization = "my-org-name" + search = "hashicorp" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether to list only public or private providers. Must be either `public` or `private`. +* `search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `providers` - List of the providers. Each element contains the following attributes: + * `id` - ID of the provider. + * `organization` - Name of the organization. + * `registry_name` - Whether this is a publicly maintained provider or private. + * `namespace` - Namespace of the provider. + * `name` - Name of the provider. + * `created_at` - Time when the provider was created. + * `updated_at` - Time when the provider was last updated. From 56688514776fc7bcc295ab2bb76fa6ce64ddb190 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Fri, 29 Dec 2023 19:38:31 -0300 Subject: [PATCH 186/420] Fix linter --- internal/provider/data_source_registry_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/data_source_registry_provider.go b/internal/provider/data_source_registry_provider.go index 2de329b4a..ed4af97a6 100644 --- a/internal/provider/data_source_registry_provider.go +++ b/internal/provider/data_source_registry_provider.go @@ -84,7 +84,7 @@ func (d *dataSourceTFERegistryProvider) Schema(_ context.Context, _ datasource.S } } -func (r *dataSourceTFERegistryProvider) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse) { +func (d *dataSourceTFERegistryProvider) ValidateConfig(ctx context.Context, req datasource.ValidateConfigRequest, resp *datasource.ValidateConfigResponse) { var config modelTFERegistryProvider // Read Terraform plan data into the model From 9be9d8bb61866b58f2523c1521daf4030f050329 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 2 Jan 2024 09:50:31 -0700 Subject: [PATCH 187/420] Update workspace_settings.markdown --- website/docs/r/workspace_settings.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/workspace_settings.markdown b/website/docs/r/workspace_settings.markdown index 8fa1e6e5d..e47b78f9a 100644 --- a/website/docs/r/workspace_settings.markdown +++ b/website/docs/r/workspace_settings.markdown @@ -55,7 +55,7 @@ resource "tfe_workspace" "test" { resource "tfe_workspace_settings" "test-settings" { workspace_id = tfe_workspace.test.id - agent_pool_id = tfe_agent_pool.test-agent-pool.id + agent_pool_id = tfe_agent_pool_allowed_workspaces.test.agent_pool_id execution_mode = "agent" } ``` From 76ee5b703137fe54cd7a2e232b5491bd469e9cd8 Mon Sep 17 00:00:00 2001 From: Antoine Rouaze Date: Thu, 4 Jan 2024 14:36:25 -0500 Subject: [PATCH 188/420] fix: Swap error messages in validateAgentExecution The message "agent_pool_id must be provided when execution_mode is 'agent'" was displayed when the execution mode was remote, and the agent pool ID was set, which was confusing. --- internal/provider/resource_tfe_workspace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 435d15ed4..f9a047edf 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -903,9 +903,9 @@ func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { if executionModeSet { executionModeIsAgent := executionMode.AsString() == "agent" if executionModeIsAgent && !agentPoolIDSet { - return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") - } else if !executionModeIsAgent && agentPoolIDSet { return fmt.Errorf("agent_pool_id must be provided when execution_mode is 'agent'") + } else if !executionModeIsAgent && agentPoolIDSet { + return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") } } From 21c732266b9bac1e0da0b0302c4d2c5ed7bb6732 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:45:31 -0600 Subject: [PATCH 189/420] Build(deps): Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 (#1206) Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7. - [Release notes](https://github.com/cloudflare/circl/releases) - [Commits](https://github.com/cloudflare/circl/compare/v1.3.3...v1.3.7) --- updated-dependencies: - dependency-name: github.com/cloudflare/circl dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0e53f61e2..4b2f12281 100644 --- a/go.mod +++ b/go.mod @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.1 - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.4.0 // indirect google.golang.org/protobuf v1.31.0 // indirect @@ -67,7 +67,7 @@ require ( require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/cloudflare/circl v1.3.3 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/hashicorp/hc-install v0.6.1 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/kr/pretty v0.2.1 // indirect diff --git a/go.sum b/go.sum index 2fa7b2b75..b690c236a 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,9 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmms github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -178,8 +179,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -222,8 +223,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= From dde09350c6357610a46344f862d7ebce8f0d0a24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:16:22 -0600 Subject: [PATCH 190/420] Build(deps): Bump actions/download-artifact from 3.0.2 to 4.1.0 (#1186) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3.0.2 to 4.1.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/9bc31d5ccc31df68ecc42ccf4149144866c47d8a...f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2289a0e25..d2e9c93c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 16 - name: Download artifacts - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index a59b1470c..b4168ccc3 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 with: name: terraform-provider-tfe From f16d21b8d851a3ba5e5dabc84186b0391cc85dff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:28:35 -0600 Subject: [PATCH 191/420] Build(deps): Bump actions/setup-node from 3.8.1 to 4.0.1 (#1181) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d...b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2e9c93c6..dd83ce484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: needs: [ tests ] runs-on: ubuntu-latest steps: - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 with: node-version: 16 diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b4168ccc3..13739abad 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -81,7 +81,7 @@ jobs: key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }} - name: Setup Node.js - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 with: node-version: "18.x" From 6ed35b93f95c6f7803609039da6196349a57cc80 Mon Sep 17 00:00:00 2001 From: Lauren Date: Tue, 9 Jan 2024 12:55:52 -0600 Subject: [PATCH 192/420] get go-tfe v1.42.0 (#1207) * get github.com/hashicorp/go-tfe * add methods to fix failures --- go.mod | 12 +++++------ go.sum | 24 ++++++++++----------- internal/provider/client_mock_workspaces.go | 12 +++++++++++ 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 4b2f12281..55686ceb2 100644 --- a/go.mod +++ b/go.mod @@ -11,8 +11,8 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect - github.com/hashicorp/go-slug v0.13.2 - github.com/hashicorp/go-tfe v1.40.0 + github.com/hashicorp/go-slug v0.13.3 + github.com/hashicorp/go-tfe v1.42.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect @@ -28,9 +28,9 @@ require ( golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.4.0 // indirect + golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) @@ -43,7 +43,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 // indirect + github.com/hashicorp/jsonapi v1.2.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.19.0 // indirect github.com/hashicorp/terraform-json v0.17.1 // indirect @@ -76,7 +76,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.13.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index b690c236a..4c1bcb66a 100644 --- a/go.sum +++ b/go.sum @@ -71,10 +71,10 @@ github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDm github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.13.2 h1:ArlarJ8w1Rinx4P1N6Sr00t+GmjJWtYZuSEDYPQBErA= -github.com/hashicorp/go-slug v0.13.2/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.40.0 h1:xgR/ijk5XAAo4jQHIOrKnIJrc4iM0jjYPskKgf4eDTU= -github.com/hashicorp/go-tfe v1.40.0/go.mod h1:pc7+wHCH26BaoFP5txiKkM7Coi5PmB9VwNfnnT2XpKE= +github.com/hashicorp/go-slug v0.13.3 h1:JiYNpOkD0HmMWw/lNYiBAUD6+WIBIV7UftKiqIbpNqM= +github.com/hashicorp/go-slug v0.13.3/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= +github.com/hashicorp/go-tfe v1.42.0 h1:CSE7L13Rpa3+/kxfwpd/LIsi88p//SNbDFgCTyOvBco= +github.com/hashicorp/go-tfe v1.42.0/go.mod h1:WQJeUJH6hyz0xaQyRDEg6eKU4z08eRLKAoDbmBvTdE4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -86,8 +86,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521 h1:w/i7859FOgNZETHpR7nHNVZzipCypYBNqW5sRZXLFjc= -github.com/hashicorp/jsonapi v0.0.0-20231023233540-b6a3d216e521/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= +github.com/hashicorp/jsonapi v1.2.0 h1:ezDCzOFsKTL+KxVQuA1rNxkIGTvZph1rNu8kT5A8trI= +github.com/hashicorp/jsonapi v1.2.0/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= @@ -203,8 +203,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -223,8 +223,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -240,8 +240,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= -golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= diff --git a/internal/provider/client_mock_workspaces.go b/internal/provider/client_mock_workspaces.go index 5e5df377c..d7c01b859 100644 --- a/internal/provider/client_mock_workspaces.go +++ b/internal/provider/client_mock_workspaces.go @@ -172,3 +172,15 @@ func (m *mockWorkspaces) SafeDelete(ctx context.Context, organization string, wo func (m *mockWorkspaces) SafeDeleteByID(ctx context.Context, workspaceID string) error { panic("not implemented") } + +func (m *mockWorkspaces) DeleteDataRetentionPolicy(ctx context.Context, workspaceID string) error { + panic("not implemented") +} + +func (m *mockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*tfe.DataRetentionPolicy, error) { + panic("not implemented") +} + +func (m *mockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { + panic("not implemented") +} From 36c6a3dc10689ee95384eeef79f5b565fcf854bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:45:28 -0600 Subject: [PATCH 193/420] Build(deps): Bump actions/checkout from 4.1.0 to 4.1.1 (#1107) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8ade135a41bc03ea155e62e844d188df1ea18608...b4ffde65f46336ab88eb53be808477a3936bae11) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd83ce484..e8b7e93dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 13739abad..ff152442c 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 15874671a..29e1a6986 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 37d68d384..22ebb402b 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8606614c..38e22c33d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - name: Generate Release Notes From 8a675b4581d9156fcd98b03c2e146113091ce27e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:05:41 -0600 Subject: [PATCH 194/420] Build(deps): Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#1175) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/a8a3f3ad30e3422c9c7b888a15615d19a852ae32...c7d193f32edcb7bfad88892161225aeda64e9392) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8b7e93dd..f759a6a38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index ff152442c..78cc3bfcf 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38e22c33d..ad96c4e41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: release-notes path: release-notes.txt From d177879b4c693e73cc41d7ce69851922a447c271 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:30:11 +0000 Subject: [PATCH 195/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-mux Bumps [github.com/hashicorp/terraform-plugin-mux](https://github.com/hashicorp/terraform-plugin-mux) from 0.12.0 to 0.13.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-mux/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-mux/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-mux/compare/v0.12.0...v0.13.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-mux dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 55686ceb2..e6686cce3 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.20.0 - github.com/hashicorp/terraform-plugin-mux v0.12.0 + github.com/hashicorp/terraform-plugin-mux v0.13.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect diff --git a/go.sum b/go.sum index 4c1bcb66a..319622333 100644 --- a/go.sum +++ b/go.sum @@ -102,8 +102,8 @@ github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6 github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gSNgvMEng2Rn9z3WZY= -github.com/hashicorp/terraform-plugin-mux v0.12.0/go.mod h1:8MR0AgmV+Q03DIjyrAKxXyYlq2EUnYBQP8gxAAA0zeM= +github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= +github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFAsndeqJ7bZFOGbVO+0Cc= github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= From b35853f9d272bdcbc498401cc955e3bb0750fe00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:57:17 +0000 Subject: [PATCH 196/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.30.0 to 2.31.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.30.0...v2.31.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 30 ++++++++++++++---------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index e6686cce3..d63e42683 100644 --- a/go.mod +++ b/go.mod @@ -20,13 +20,13 @@ require ( github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.20.0 github.com/hashicorp/terraform-plugin-mux v0.13.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.1 golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -46,7 +46,7 @@ require ( github.com/hashicorp/jsonapi v1.2.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.19.0 // indirect - github.com/hashicorp/terraform-json v0.17.1 // indirect + github.com/hashicorp/terraform-json v0.18.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -68,14 +68,14 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/hashicorp/hc-install v0.6.1 // indirect + github.com/hashicorp/hc-install v0.6.2 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/mod v0.13.0 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/sync v0.6.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index 319622333..82eb98e06 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,6 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= -github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= @@ -32,8 +30,8 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= -github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0= +github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= +github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -80,8 +78,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.6.1 h1:IGxShH7AVhPaSuSJpKtVi/EFORNjO+OYVJJrAtGG2mY= -github.com/hashicorp/hc-install v0.6.1/go.mod h1:0fW3jpg+wraYSnFDJ6Rlie3RvLf1bIqVIkzoon4KoVE= +github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M= +github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= @@ -92,8 +90,8 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= -github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= -github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= +github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= +github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5OckzhoiO3ig6SGxwelD2sI= github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= @@ -104,8 +102,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFAsndeqJ7bZFOGbVO+0Cc= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 h1:Bl3e2ei2j/Z3Hc2HIS15Gal2KMKyLAZ2om1HCEvK6es= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0/go.mod h1:i2C41tszDjiWfziPQDL5R/f3Zp0gahXe5No/MIO9rCE= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -154,8 +152,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= -github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -184,8 +182,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -194,8 +192,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From fb5991d329ea1bccc426240af1e8f4f7adab1670 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:07:52 +0000 Subject: [PATCH 197/420] cdktf: update d/oauth_client.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- .../cdktf/python/d/agent_pool.html.markdown | 2 +- .../python/d/github_installation.html.markdown | 15 ++++++++------- .../docs/cdktf/python/d/ip_ranges.html.markdown | 2 +- .../cdktf/python/d/oauth_client.html.markdown | 2 +- .../cdktf/typescript/d/agent_pool.html.markdown | 2 +- .../d/github_installation.html.markdown | 17 +++++++++-------- .../cdktf/typescript/d/ip_ranges.html.markdown | 2 +- .../typescript/d/oauth_client.html.markdown | 4 ++-- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index ea054dd0d..f14493063 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 9a94a3068..fe947e768 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -28,7 +28,7 @@ class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) DataTfeGithubAppInstallation(self, "gha_installation", - installation_id=12345 + installation_id=12345678 ) ``` @@ -47,17 +47,17 @@ class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) DataTfeGithubAppInstallation(self, "gha_installation", - name="installation_name" + name="github_username_or_organization" ) ``` ## Argument Reference -The following arguments are supported. At least one of `name`, `installation_id` must be set. +The following arguments are supported. At least one of `name`, `installation_id` must be set. + +* `installation_id` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. +* `name` - (Optional) Name of the Github user or organization account that installed the app. -* `installation_id` - (Optional) ID of the Github Installation as shown in Github. -* `name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `installation_id` or `name`. ## Attributes Reference @@ -65,4 +65,5 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index 111748bdc..badc0ea4a 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -45,4 +45,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 9a8213f0f..df8b1d562 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -102,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index c3a9bc3e7..c8074fdca 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 5226e5f82..55a04a6ba 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -28,7 +28,7 @@ class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); new DataTfeGithubAppInstallation(this, "gha_installation", { - installationId: 12345, + installationId: 12345678, }); } } @@ -50,7 +50,7 @@ class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); new DataTfeGithubAppInstallation(this, "gha_installation", { - name: "installation_name", + name: "github_username_or_organization", }); } } @@ -59,16 +59,17 @@ class MyConvertedCode extends TerraformStack { ## Argument Reference -The following arguments are supported. At least one of `name`, `installationId` must be set. +The following arguments are supported. At least one of `name`, `installationId` must be set. + +* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. +* `name` - (Optional) Name of the Github user or organization account that installed the app. -* `installationId` - (Optional) ID of the Github Installation as shown in Github. -* `name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `installationId` or `name`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file +* `id` - The internal ID of the Github Installation. This is different from the `installationId`. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index a60d0351c..69f0e8c1d 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -48,4 +48,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index 365fbd2b7..a2db80cbb 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -100,7 +100,7 @@ be set. In addition to all arguments above, the following attributes are exported: -* `id` - The OAuth client ID. This will match `oauth_client_id`. +* `id` - The OAuth client ID. This will match `oauthClientId`. * `apiUrl` - The client's API URL. * `callbackUrl` - OAuth callback URL to provide to the OAuth service provider. * `createdAt` - The date and time this OAuth client was created in RFC3339 format. @@ -111,4 +111,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file From 0b95595be3a9cd8342df0fbb393a00996f3f5966 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:07:55 +0000 Subject: [PATCH 198/420] cdktf: update r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown,r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown --- .../cdktf/python/d/variable_set.html.markdown | 2 +- .../cdktf/python/d/variables.html.markdown | 2 +- .../cdktf/python/d/workspace.html.markdown | 2 +- .../python/d/workspace_ids.html.markdown | 2 +- .../python/d/workspace_run_task.html.markdown | 2 +- .../r/admin_organization_settings.markdown | 6 +---- .../cdktf/python/r/agent_pool.html.markdown | 2 +- ...gent_pool_allowed_workspaces.html.markdown | 20 ++++++++++------ .../cdktf/python/r/agent_token.html.markdown | 2 +- .../python/r/no_code_module.html.markdown | 2 +- .../typescript/d/variable_set.html.markdown | 2 +- .../typescript/d/variables.html.markdown | 2 +- .../typescript/d/workspace.html.markdown | 6 ++--- .../typescript/d/workspace_ids.html.markdown | 2 +- .../d/workspace_run_task.html.markdown | 2 +- .../r/admin_organization_settings.markdown | 6 +---- .../typescript/r/agent_pool.html.markdown | 2 +- ...gent_pool_allowed_workspaces.html.markdown | 23 +++++++++++++------ .../typescript/r/agent_token.html.markdown | 2 +- .../typescript/r/no_code_module.html.markdown | 2 +- 20 files changed, 49 insertions(+), 42 deletions(-) diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index b22392cd9..a7ba1ead7 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -52,4 +52,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 59a64a81c..c022fa7c5 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -87,4 +87,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 333524a94..991f72aae 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -88,4 +88,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index e4e168168..c9a50d0ea 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -64,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 3d0a9c37a..e75077b23 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index f7ee2700b..65c126ad7 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -72,8 +72,4 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index 458b24d29..96ba09a71 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -67,4 +67,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index 237093a42..5a9952cda 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -17,12 +17,12 @@ for Business account. ## Example Usage -Basic usage: +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct -from cdktf import TerraformStack +from cdktf import Fn, Token, TerraformStack # # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. @@ -31,6 +31,7 @@ from imports.tfe.agent_pool import AgentPool from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces from imports.tfe.organization import Organization from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) @@ -47,9 +48,15 @@ class MyConvertedCode(TerraformStack): organization=test_organization.name, organization_scoped=False ) - AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", + allowed = AgentPoolAllowedWorkspaces(self, "allowed", agent_pool_id=test_agent_pool.id, - allowed_workspace_ids=[test_workspace.id] + allowed_workspace_ids=Token.as_list("${[ for key, value in ${" + + Fn.lookup_nested(test, ["*", "id"]) + "} : value]}") + ) + WorkspaceSettings(self, "test-workspace-settings", + agent_pool_id=allowed.id, + execution_mode="agent", + workspace_id=test_workspace.id ) ``` @@ -69,5 +76,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index c90ab3ff6..f2c30fcfc 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -57,4 +57,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 5fc9a1cfd..d578915ea 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -119,4 +119,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index d2094ec92..bda49eb8d 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -55,4 +55,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 932991993..dc48e7187 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -93,4 +93,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index e00956d27..19623ffe3 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -53,8 +53,8 @@ In addition to all arguments above, the following attributes are exported: * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. * `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). -* `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). -* `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `global_remote_state` is set to `true`. +* `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). +* `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `globalRemoteState` is set to `true`. * `operations` - Indicates whether the workspace is using remote execution mode. Set to `false` to switch execution mode to local. `true` by default. * `policyCheckFailures` - The number of policy check failures from the latest run. * `projectId` - ID of the workspace's project @@ -91,4 +91,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 6d75f9837..94d4023ff 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -67,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 0898bd0cb..6680e45a2 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -51,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 34ff108d6..4c680b2d4 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -75,8 +75,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 08b7f09a0..e3e3aeac0 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index 053a639d7..dccd4b3fd 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -17,12 +17,12 @@ for Business account. ## Example Usage -Basic usage: +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; +import { Fn, Token, TerraformStack } from "cdktf"; /* * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. @@ -31,6 +31,7 @@ import { AgentPool } from "./.gen/providers/tfe/agent-pool"; import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; import { Organization } from "./.gen/providers/tfe/organization"; import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); @@ -47,9 +48,18 @@ class MyConvertedCode extends TerraformStack { organization: testOrganization.name, organizationScoped: false, }); - new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", { + const allowed = new AgentPoolAllowedWorkspaces(this, "allowed", { agentPoolId: testAgentPool.id, - allowedWorkspaceIds: [testWorkspace.id], + allowedWorkspaceIds: Token.asList( + "${[ for key, value in ${" + + Fn.lookupNested(test, ["*", "id"]) + + "} : value]}" + ), + }); + new WorkspaceSettings(this, "test-workspace-settings", { + agentPoolId: allowed.id, + executionMode: "agent", + workspaceId: testWorkspace.id, }); } } @@ -72,5 +82,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index 90019bba1..b2561efe4 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -60,4 +60,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index 3640b4c11..2b8a745e0 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -127,4 +127,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file From 56d367f4e7a8fc7db15879565d83bf4bac613893 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:08:14 +0000 Subject: [PATCH 199/420] cdktf: update d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown,d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/registry_providers.html.markdown,d/registry_provider.html.markdown,d/registry_gpg_keys.html.markdown --- .../python/d/registry_gpg_keys.html.markdown | 4 +- .../python/d/registry_provider.html.markdown | 73 +++++++++++++ .../python/d/registry_providers.html.markdown | 94 ++++++++++++++++ .../python/d/saml_settings.html.markdown | 2 +- .../docs/cdktf/python/d/slug.html.markdown | 2 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 2 +- .../docs/cdktf/python/d/team.html.markdown | 2 +- .../cdktf/python/d/team_access.html.markdown | 2 +- .../d/team_project_access.html.markdown | 2 +- .../docs/cdktf/python/d/teams.html.markdown | 2 +- .../d/registry_gpg_keys.html.markdown | 10 +- .../d/registry_provider.html.markdown | 79 ++++++++++++++ .../d/registry_providers.html.markdown | 103 ++++++++++++++++++ .../typescript/d/saml_settings.html.markdown | 2 +- .../cdktf/typescript/d/slug.html.markdown | 4 +- .../cdktf/typescript/d/ssh_key.html.markdown | 2 +- .../cdktf/typescript/d/team.html.markdown | 2 +- .../typescript/d/team_access.html.markdown | 2 +- .../d/team_project_access.html.markdown | 2 +- .../cdktf/typescript/d/teams.html.markdown | 2 +- 20 files changed, 371 insertions(+), 22 deletions(-) create mode 100644 website/docs/cdktf/python/d/registry_provider.html.markdown create mode 100644 website/docs/cdktf/python/d/registry_providers.html.markdown create mode 100644 website/docs/cdktf/typescript/d/registry_provider.html.markdown create mode 100644 website/docs/cdktf/typescript/d/registry_providers.html.markdown diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown index f8e45f86b..dba8d1255 100644 --- a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -21,7 +21,7 @@ from cdktf import TerraformStack # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.tfe. import DataTfeRegistryGpgKeys +from imports.tfe.data_tfe_registry_gpg_keys import DataTfeRegistryGpgKeys class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) @@ -45,4 +45,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_provider.html.markdown b/website/docs/cdktf/python/d/registry_provider.html.markdown new file mode 100644 index 000000000..b9947e8e9 --- /dev/null +++ b/website/docs/cdktf/python/d/registry_provider.html.markdown @@ -0,0 +1,73 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import RegistryProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + RegistryProvider(self, "example", + name="my-provider", + organization="my-org-name" + ) +``` + +A public provider: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import RegistryProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + RegistryProvider(self, "example", + name="aws", + namespace="hashicorp", + organization="my-org-name", + registry_name="public" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registry_name` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `created_at` - The time when the provider was created. +* `updated_at` - The time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_providers.html.markdown b/website/docs/cdktf/python/d/registry_providers.html.markdown new file mode 100644 index 000000000..8005228e0 --- /dev/null +++ b/website/docs/cdktf/python/d/registry_providers.html.markdown @@ -0,0 +1,94 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + + + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataTfeRegistryProviders(self, "all", + organization="my-org-name" + ) +``` + +All private providers: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataTfeRegistryProviders(self, "private", + organization="my-org-name", + registry_name="private" + ) +``` + +Providers with "hashicorp" in their namespace or name: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataTfeRegistryProviders(self, "hashicorp", + organization="my-org-name", + search="hashicorp" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether to list only public or private providers. Must be either `public` or `private`. +* `search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `providers` - List of the providers. Each element contains the following attributes: + * `id` - ID of the provider. + * `organization` - Name of the organization. + * `registry_name` - Whether this is a publicly maintained provider or private. + * `namespace` - Namespace of the provider. + * `name` - Name of the provider. + * `created_at` - Time when the provider was created. + * `updated_at` - Time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index ebbd46fa2..c3158c5f2 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -74,4 +74,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index b91a074be..0088cde1f 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -51,4 +51,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index f6a0cff6b..81865bd05 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -44,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 36e3b016f..a1bd9d235 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index d5efb474c..ff6aa3ceb 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -55,4 +55,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index b4dcd2558..a9932a0f8 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index b8908216b..80ec54009 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -42,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown index e44814c0a..bec9b7ada 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -21,7 +21,7 @@ import { TerraformStack } from "cdktf"; * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/"; +import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/data-tfe-registry-gpg-keys"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); @@ -44,8 +44,8 @@ The following arguments are supported: * `keys` - List of GPG keys in the organization. Each element contains the following attributes: * `id` - ID of the GPG key. * `organization` - Name of the organization. - * `ascii_armor` - ASCII-armored representation of the GPG key. - * `created_at` - The time when the GPG key was created. - * `updated_at` - The time when the GPG key was last updated. + * `asciiArmor` - ASCII-armored representation of the GPG key. + * `createdAt` - The time when the GPG key was created. + * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_provider.html.markdown b/website/docs/cdktf/typescript/d/registry_provider.html.markdown new file mode 100644 index 000000000..1635f9687 --- /dev/null +++ b/website/docs/cdktf/typescript/d/registry_provider.html.markdown @@ -0,0 +1,79 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new RegistryProvider(this, "example", { + name: "my-provider", + organization: "my-org-name", + }); + } +} + +``` + +A public provider: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new RegistryProvider(this, "example", { + name: "aws", + namespace: "hashicorp", + organization: "my-org-name", + registry_name: "public", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registryName` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `createdAt` - The time when the provider was created. +* `updatedAt` - The time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_providers.html.markdown b/website/docs/cdktf/typescript/d/registry_providers.html.markdown new file mode 100644 index 000000000..58a6f4e18 --- /dev/null +++ b/website/docs/cdktf/typescript/d/registry_providers.html.markdown @@ -0,0 +1,103 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + + + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataTfeRegistryProviders(this, "all", { + organization: "my-org-name", + }); + } +} + +``` + +All private providers: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataTfeRegistryProviders(this, "private", { + organization: "my-org-name", + registry_name: "private", + }); + } +} + +``` + +Providers with "hashicorp" in their namespace or name: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataTfeRegistryProviders(this, "hashicorp", { + organization: "my-org-name", + search: "hashicorp", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether to list only public or private providers. Must be either `public` or `private`. +* `search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `providers` - List of the providers. Each element contains the following attributes: + * `id` - ID of the provider. + * `organization` - Name of the organization. + * `registryName` - Whether this is a publicly maintained provider or private. + * `namespace` - Namespace of the provider. + * `name` - Name of the provider. + * `createdAt` - Time when the provider was created. + * `updatedAt` - Time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 196e0d4ec..8c1308dd2 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -77,4 +77,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index b439d6bf2..bfe11432a 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -13,7 +13,7 @@ intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files be sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows -resources such as `tfePolicySet` track the files and upload a new gzip compressed +resources such as `tfe_policy_set` track the files and upload a new gzip compressed tar file containing configuration files (a Terraform "slug") when those files change. ## Example Usage @@ -54,4 +54,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index c4b47bc18..8794e0838 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 63e141292..01a54bef0 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index e02662e12..c4916de41 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -58,4 +58,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 123165f0d..b790074ae 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index 0626d4bc4..37ae863c7 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file From 39809dcb338aee251331d0ec13475d457f5baf43 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:08:23 +0000 Subject: [PATCH 200/420] cdktf: update d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown,d/organization_members.html.markdown,d/organization.html.markdown --- .../cdktf/python/d/organization.html.markdown | 2 +- .../d/organization_members.html.markdown | 2 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../python/d/organization_tags.html.markdown | 2 +- .../cdktf/python/d/organizations.html.markdown | 2 +- .../docs/cdktf/python/d/outputs.html.markdown | 7 ++----- .../cdktf/python/d/policy_set.html.markdown | 2 +- .../docs/cdktf/python/d/project.html.markdown | 2 +- .../python/d/registry_gpg_key.html.markdown | 4 ++-- .../typescript/d/organization.html.markdown | 2 +- .../d/organization_members.html.markdown | 2 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../d/organization_tags.html.markdown | 4 ++-- .../typescript/d/organizations.html.markdown | 2 +- .../cdktf/typescript/d/outputs.html.markdown | 18 +++++++----------- .../typescript/d/policy_set.html.markdown | 4 ++-- .../cdktf/typescript/d/project.html.markdown | 2 +- .../d/registry_gpg_key.html.markdown | 4 ++-- 20 files changed, 31 insertions(+), 38 deletions(-) diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index aedc4bc3f..6ec8c4b15 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index 9ca351a93..50cae5f69 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -52,4 +52,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index d43914fb2..591a96c56 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -98,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index c906839c1..e39176811 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -50,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index e2de47ed3..02bf05054 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -47,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index e90bf98be..d98f7f9c2 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -44,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 461739d77..26679339f 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -33,18 +33,15 @@ from imports.tfe.data_tfe_outputs import DataTfeOutputs class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. - # For a more precise conversion please use the --provider flag in convert. foo = DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) Id(self, "vpc_id", byte_length=8, - keepers=[{ + keepers={ "bar": foo.values.bar } - ] ) ``` @@ -62,4 +59,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 6216ae254..dbe15f148 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -67,4 +67,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index e06865a57..0a853fe24 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -44,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown index 131a5e50f..bf93fc6a2 100644 --- a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -21,7 +21,7 @@ from cdktf import TerraformStack # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.tfe. import DataTfeRegistryGpgKey +from imports.tfe.data_tfe_registry_gpg_key import DataTfeRegistryGpgKey class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) @@ -44,4 +44,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 977899962..7c8373c18 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -50,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index b03a855ff..1ff3e9f42 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -55,4 +55,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index c251e74ab..a5831bed8 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -107,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index 37bfa78a2..c80231cba 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -53,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index a8c737753..c62bfb8c7 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -49,5 +49,5 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag -* `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file +* `workspace_count` - The number of workspaces the tag is associate with + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 4ecf4f8b2..c7f1bb826 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -47,4 +47,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 59648bd54..15b17e6b6 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -16,9 +16,9 @@ that are known to be non-sensitive. ## Example Usage -Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as seen below: +Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as seen below: -In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: +In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -33,19 +33,15 @@ import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. - For a more precise conversion please use the --provider flag in convert.*/ const foo = new DataTfeOutputs(this, "foo", { organization: "my-org", workspace: "my-workspace", }); new Id(this, "vpc_id", { - byte_length: 8, - keepers: [ - { - bar: foo.values.bar, - }, - ], + byteLength: 8, + keepers: { + bar: foo.values.bar, + }, }); } } @@ -66,4 +62,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 9cb0f5f25..0ba1bf7d1 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -56,7 +56,7 @@ The following arguments are supported: * `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. * `projectIds` - IDs of the projects that use the policy set. * `policyIds` - IDs of the policies attached to the policy set. -* `policiesPath` - The sub-path within the attached VCS repository when using `vcs_repo`. +* `policiesPath` - The sub-path within the attached VCS repository when using `vcsRepo`. * `vcsRepo` - Settings for the workspace's VCS repository. The `vcsRepo` block contains: @@ -70,4 +70,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index e65662563..f62b31edf 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown index c802b8872..2d56eb81f 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -21,7 +21,7 @@ import { TerraformStack } from "cdktf"; * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/"; +import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/data-tfe-registry-gpg-key"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); @@ -47,4 +47,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file From 5cc10c04afcdd6475abc2cc24a83b9031631be0c Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:08:35 +0000 Subject: [PATCH 201/420] cdktf: update r/terraform_version.html.markdown,r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown --- website/docs/cdktf/python/r/ssh_key.html.markdown | 2 +- website/docs/cdktf/python/r/team.html.markdown | 2 +- website/docs/cdktf/python/r/team_access.html.markdown | 2 +- website/docs/cdktf/python/r/team_member.html.markdown | 2 +- website/docs/cdktf/python/r/team_members.html.markdown | 2 +- .../cdktf/python/r/team_organization_member.html.markdown | 2 +- .../cdktf/python/r/team_organization_members.html.markdown | 2 +- .../docs/cdktf/python/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/python/r/team_token.html.markdown | 2 +- website/docs/cdktf/python/r/terraform_version.html.markdown | 2 +- website/docs/cdktf/typescript/r/ssh_key.html.markdown | 2 +- website/docs/cdktf/typescript/r/team.html.markdown | 6 +++--- website/docs/cdktf/typescript/r/team_access.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_member.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_members.html.markdown | 2 +- .../typescript/r/team_organization_member.html.markdown | 2 +- .../typescript/r/team_organization_members.html.markdown | 2 +- .../cdktf/typescript/r/team_project_access.html.markdown | 4 ++-- website/docs/cdktf/typescript/r/team_token.html.markdown | 2 +- .../docs/cdktf/typescript/r/terraform_version.html.markdown | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 050d1c8e4..43ce3609f 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -52,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index b3a650bed..4ea3cf1fc 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -97,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index 4d4ccba8c..0aa757fc5 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -82,4 +82,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index cb2bb3b22..ee883f677 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -65,4 +65,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 64bae9350..5de80cf59 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -96,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index f82bf0b69..c62a138cf 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -75,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index bd6119e0e..6014b6deb 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -115,4 +115,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 1da65f94b..992905b87 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -146,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index da179f43c..b05b59f0e 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -99,4 +99,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index be02b4e5c..df3982e45 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -65,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 77b9e12b5..208268fb6 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -55,4 +55,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index 6a6b76659..3412b923b 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -75,7 +75,7 @@ The following arguments are supported: The `organizationAccess` block supports: * `readWorkspaces` - (Optional) Allow members to view all workspaces in this organization. -* `readProjects` - (Optional) Allow members to view all projects within the organization. Requires `read_workspaces` to be set to `true`. +* `readProjects` - (Optional) Allow members to view all projects within the organization. Requires `readWorkspaces` to be set to `true`. * `managePolicies` - (Optional) Allows members to create, edit, and delete the organization's Sentinel policies. * `managePolicyOverrides` - (Optional) Allows members to override soft-mandatory policy checks. * `manageWorkspaces` - (Optional) Allows members to create and administrate all workspaces within the organization. @@ -83,7 +83,7 @@ The `organizationAccess` block supports: * `manageProviders` - (Optional) Allow members to publish and delete providers in the organization's private registry. * `manageModules` - (Optional) Allow members to publish and delete modules in the organization's private registry. * `manageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. -* `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manage_workspaces` to be set to `true`. +* `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manageWorkspaces` to be set to `true`. * `manageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. ## Attributes Reference @@ -103,4 +103,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index df127a57e..7e1d9b048 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -85,4 +85,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index de7629028..5b181dfa9 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -68,4 +68,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 7934b1ac2..76c09a17c 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -104,4 +104,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index ef8edbd8c..1535dca5f 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -82,4 +82,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index c6ade2d68..ea47182ad 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -134,4 +134,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 961db963a..0cf27d176 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -79,7 +79,7 @@ The following permissions apply to all workpsaces (and future workspaces) in the |----------------------|-------------------------------------------------------| | `runs` | The permission to grant project's workspaces' runs. Default: `read`. Valid strings: `read`, `plan`, or `apply`. | | `sentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `none`. Valid strings: `none`, or `read`. | -| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `readOutputs`, `read`, or `write`.| +| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `read-outputs`, `read`, or `write`.| | `variables` | The permission to grant project's workspaces' variables. Default `none`. Valid strings: `none`, `read`, or `write`. | | `create` | The permission to create project's workspaces in the project. Default: `false`. Valid booleans `true`, `false` | | `locking` | The permission to manually lock or unlock the project's workspaces. Default `false`. Valid booleans `true`, `false` | @@ -154,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index a7d0f6fec..4d551fe22 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -105,4 +105,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index efc291025..53add3e33 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -68,4 +68,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file From 1771bbd97d5062044d2587ec1c894ffa700f69ce Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:08:41 +0000 Subject: [PATCH 202/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown --- website/docs/cdktf/python/index.html.markdown | 2 +- .../docs/cdktf/python/r/variable.html.markdown | 2 +- .../cdktf/python/r/variable_set.html.markdown | 2 +- .../docs/cdktf/python/r/workspace.html.markdown | 2 +- .../python/r/workspace_policy_set.html.markdown | 2 +- .../workspace_policy_set_exclusion.html.markdown | 2 +- .../cdktf/python/r/workspace_run.html.markdown | 2 +- .../python/r/workspace_run_task.html.markdown | 2 +- .../cdktf/python/r/workspace_settings.markdown | 6 +++--- .../r/workspace_variable_set.html.markdown | 2 +- .../docs/cdktf/typescript/index.html.markdown | 6 +++--- .../cdktf/typescript/r/variable.html.markdown | 6 +++--- .../typescript/r/variable_set.html.markdown | 2 +- .../cdktf/typescript/r/workspace.html.markdown | 16 ++++++++-------- .../r/workspace_policy_set.html.markdown | 4 ++-- .../workspace_policy_set_exclusion.html.markdown | 4 ++-- .../typescript/r/workspace_run.html.markdown | 14 +++++++------- .../r/workspace_run_task.html.markdown | 2 +- .../typescript/r/workspace_settings.markdown | 14 ++++++++------ .../r/workspace_variable_set.html.markdown | 4 ++-- 20 files changed, 49 insertions(+), 47 deletions(-) diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 0a489d502..b596e13f8 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -138,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index 19ff3fc86..49ebd828b 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -189,4 +189,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index 735cf96bb..853346f0b 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -198,4 +198,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index f82ec0174..cf509013e 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -186,4 +186,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 4fc68bd52..2e6a05321 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -76,4 +76,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 4cb65ee3e..a9cf278fd 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -76,4 +76,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index ec7373c95..9f2baf905 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -228,4 +228,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index cffdb1f71..17b25ffaa 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -58,4 +58,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index c478e7282..d3554c841 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -48,7 +48,7 @@ With `execution_mode` of `agent`: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct -from cdktf import TerraformStack +from cdktf import Token, TerraformStack # # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. @@ -80,7 +80,7 @@ class MyConvertedCode(TerraformStack): # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_agent_pool_allowed_workspaces_test.override_logical_id("test") WorkspaceSettings(self, "test-settings", - agent_pool_id=test_agent_pool.id, + agent_pool_id=Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), execution_mode="agent", workspace_id=test.id ) @@ -152,4 +152,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index a3c2bb050..bc048d611 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -76,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index b5beb6ad5..4159e7030 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -43,7 +43,7 @@ There are several ways to provide the required token: - **Set the `token` argument in the provider configuration.** You can set the `token` argument in the provider configuration. Use an input variable for the token. -- **Set the `tfeToken` environment variable:** The provider can read the +- **Set the `TFE_TOKEN` environment variable:** The provider can read the `TFE_TOKEN` environment variable and the token stored there to authenticate. When configuring the input variable for either of these options, mark them as sensitive. @@ -88,7 +88,7 @@ class MyConvertedCode extends TerraformStack { As this provider is still at version zero, you should constrain the acceptable provider versions on the minor version. -The above snippet using `requiredProviders` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: +The above snippet using `required_providers` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: ```hcl provider "tfe" { @@ -148,4 +148,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 2457a5939..b6e82bef4 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -114,8 +114,8 @@ The following arguments are supported: * `sensitive` - (Optional) Whether the value is sensitive. If true then the variable is written once and not visible thereafter. Defaults to `false`. * One of the following (Required) - * `workspace_id` - ID of the workspace that owns the variable. - * `variable_set_id` - ID of the variable set that owns the variable. + * `workspaceId` - ID of the workspace that owns the variable. + * `variableSetId` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair drift if `value` is later changed out-of-band via the Terraform Cloud UI. @@ -198,4 +198,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index bf194a7a7..85568a93a 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -211,4 +211,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 726e96f3a..ee6680519 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -105,10 +105,10 @@ The following arguments are supported: 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. * `forceDelete` - (Optional) If this attribute is present on a workspace that is being deleted through the provider, it will use the existing force delete API. If this attribute is not present or false it will safe delete the workspace. -* `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remote_state_consumer_ids`). +* `globalRemoteState` - (Optional) Whether the workspace allows all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (`remoteStateConsumerIds`). * `operations` - **Deprecated** Whether to use remote execution mode. Defaults to `true`. When set to `false`, the workspace will be used for - state storage only. This value _must not_ be provided if `execution_mode` is + state storage only. This value _must not_ be provided if `executionMode` is provided. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `projectId` - (Optional) ID of the project where the workspace should be created. @@ -124,11 +124,11 @@ The following arguments are supported: * `sourceName` - (Optional) A friendly name for the application or client creating this workspace. If set, this will be displayed on the workspace as "Created via ". - Requires `source_url` to also be set. + Requires `sourceUrl` to also be set. * `sourceUrl` - (Optional) A URL for the application or client creating this workspace. This can be the URL of a related resource in another app, or a link to documentation or other info about the client. - Requires `source_name` to also be set. + Requires `sourceName` to also be set. **Note:** The API does not (currently) allow this to be updated after a workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument @@ -164,12 +164,12 @@ The `vcsRepo` block supports: in your VCS provider. The format for Azure DevOps is `//_git/`. * `branch` - (Optional) The repository branch that Terraform will execute from. This defaults to the repository's default branch (e.g. main). -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. - This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. -* `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `trigger_patterns` and `trigger_prefixes`. Should only set this value if the former is not being used. + This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. +* `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -192,4 +192,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index f874166cb..f9312e399 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -11,7 +11,7 @@ description: |- Adds and removes policy sets from a workspace --> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage @@ -79,4 +79,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 6ce27ecbe..c8b9a7200 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -11,7 +11,7 @@ description: |- Adds and removes policy sets from an excluded workspace --> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage @@ -83,4 +83,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 4e90a1e2c..012a9374f 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -14,10 +14,10 @@ Provides a resource to manage the _initial_ and/or _final_ Terraform run in a gi There are a few main use cases this resource was designed for: - **Workspaces that depend on other workspaces.** If a workspace will create infrastructure that other workspaces rely on (for example, a Kubernetes cluster to deploy resources into), those downstream workspaces can depend on an initial `apply` with `wait_for_run = true`, so they aren't created before their infrastructure dependencies. -- **A more reliable `queue_all_runs = true`.** The `queue_all_runs` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. +- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. - **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfe_workspace` resource's default safe deletion behavior. -The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfeWorkspaceRun` resource that includes an `apply` block will queue a new apply when added to a config. +The `tfe_workspace_run` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfe_workspace_run` resource that includes an `apply` block will queue a new apply when added to a config. ## Example Usage @@ -223,10 +223,10 @@ The following arguments are supported: Both `apply` and `destroy` block supports: * `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `wait_for_run` is set to `false`, this auto-apply will be done by Terraform Cloud. - * If `wait_for_run` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manual_confirm` is set to false. - * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `auto_apply` with the `tfe_workspace` data source. -* `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retry_attempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. + * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. + * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. + * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfe_workspace` data source. +* `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. * `retryAttempts` - (Optional) The number to retry attempts made after an initial error. Defaults to `3`. * `retryBackoffMin` - (Optional) The minimum time in seconds to backoff before attempting a retry. Defaults to `1`. * `retryBackoffMax` - (Optional) The maximum time in seconds to backoff before attempting a retry. Defaults to `30`. @@ -237,4 +237,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 914408037..dcb41a859 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -61,4 +61,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index 665fea87b..b7cf98845 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -51,7 +51,7 @@ With `executionMode` of `agent`: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; +import { Token, TerraformStack } from "cdktf"; /* * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. @@ -87,7 +87,9 @@ class MyConvertedCode extends TerraformStack { /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); new WorkspaceSettings(this, "test-settings", { - agentPoolId: testAgentPool.id, + agentPoolId: Token.asString( + tfeAgentPoolAllowedWorkspacesTest.agentPoolId + ), executionMode: "agent", workspaceId: test.id, }); @@ -141,8 +143,8 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `workspaceId` - (Required) ID of the workspace. -* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` - to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. +* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` + to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. @@ -152,7 +154,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - - `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `executionMode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -168,4 +170,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 41030bb00..c15f02fae 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -11,7 +11,7 @@ description: |- Adds and removes variable sets from a workspace --> **Note:** `tfeVariableSet` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. +-> **Note:** `tfe_variable_set` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. ## Example Usage @@ -83,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 9b6311514bebc288fc240138061217663eb7a5fb Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:08:58 +0000 Subject: [PATCH 203/420] cdktf: update r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_provider.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown --- .../r/policy_set_parameter.html.markdown | 2 +- .../docs/cdktf/python/r/project.html.markdown | 2 +- .../python/r/project_policy_set.html.markdown | 2 +- .../r/project_variable_set.html.markdown | 2 +- .../python/r/registry_gpg_key.html.markdown | 8 +- .../python/r/registry_module.html.markdown | 8 +- .../python/r/registry_provider.html.markdown | 103 +++++++++++++++++ .../cdktf/python/r/run_trigger.html.markdown | 2 +- .../python/r/saml_settings.html.markdown | 2 +- .../python/r/sentinel_policy.html.markdown | 2 +- .../r/policy_set_parameter.html.markdown | 2 +- .../cdktf/typescript/r/project.html.markdown | 2 +- .../r/project_policy_set.html.markdown | 2 +- .../r/project_variable_set.html.markdown | 2 +- .../r/registry_gpg_key.html.markdown | 8 +- .../r/registry_module.html.markdown | 20 ++-- .../r/registry_provider.html.markdown | 109 ++++++++++++++++++ .../typescript/r/run_trigger.html.markdown | 2 +- .../typescript/r/saml_settings.html.markdown | 2 +- .../r/sentinel_policy.html.markdown | 2 +- 20 files changed, 248 insertions(+), 36 deletions(-) create mode 100644 website/docs/cdktf/python/r/registry_provider.html.markdown create mode 100644 website/docs/cdktf/typescript/r/registry_provider.html.markdown diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 9ce7997d8..153e6bd47 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -73,4 +73,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 06f793b80..42ee71f61 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -59,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index 1a92fbed9..8adaba545 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -74,4 +74,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 8160d98b9..67b36640e 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -74,4 +74,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown index ca0f62560..329aadb29 100644 --- a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -19,17 +19,17 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ```python # DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug from constructs import Construct -from cdktf import Fn, TerraformStack +from cdktf import Fn, Token, TerraformStack # # Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. # -from imports.tfe. import RegistryGpgKey +from imports.tfe.registry_gpg_key import RegistryGpgKey class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) RegistryGpgKey(self, "example", - ascii_armor=Fn.file("my-public-key.asc"), + ascii_armor=Token.as_string(Fn.file("my-public-key.asc")), organization="my-org-name" ) ``` @@ -56,4 +56,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index e73e4f3da..f716523a4 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -77,9 +77,9 @@ class MyConvertedCode(TerraformStack): service_provider="github" ) RegistryModule(self, "test-registry-module", - test_config=[{ - "tests_enabled": True - } + test_config=[RegistryModuleTestConfig( + tests_enabled=True + ) ], vcs_repo=RegistryModuleVcsRepo( branch="main", @@ -265,4 +265,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_provider.html.markdown b/website/docs/cdktf/python/r/registry_provider.html.markdown new file mode 100644 index 000000000..796e172ef --- /dev/null +++ b/website/docs/cdktf/python/r/registry_provider.html.markdown @@ -0,0 +1,103 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + + + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import RegistryProvider +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Organization(self, "example", + email="admin@company.com", + name="my-org-name" + ) + tfe_registry_provider_example = RegistryProvider(self, "example_1", + name="my-provider", + organization=example.name + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_registry_provider_example.override_logical_id("example") +``` + +Create public provider: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe. import RegistryProvider +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Organization(self, "example", + email="admin@company.com", + name="my-org-name" + ) + tfe_registry_provider_example = RegistryProvider(self, "example_1", + name="aws", + namespace="hashicorp", + organization=example.name, + registry_name="public" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_registry_provider_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registry_name` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registry_name` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `created_at` - The time when the provider was created. +* `updated_at` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index b70959254..4dbda6d32 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -70,4 +70,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index d234e5728..e10a29a1f 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -75,4 +75,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index ace6e7320..ab8204fc4 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -66,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index b265f791a..386390bce 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index a58997243..538807c44 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index a8af193f5..e0fe2387a 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -77,4 +77,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index 11a89e985..0a96e7bec 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -77,4 +77,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index 03550caec..e2296ca07 100644 --- a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -19,17 +19,17 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug import { Construct } from "constructs"; -import { Fn, TerraformStack } from "cdktf"; +import { Fn, Token, TerraformStack } from "cdktf"; /* * Provider bindings are generated by running `cdktf get`. * See https://cdk.tf/provider-generation for more details. */ -import { RegistryGpgKey } from "./.gen/providers/tfe/"; +import { RegistryGpgKey } from "./.gen/providers/tfe/registry-gpg-key"; class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); new RegistryGpgKey(this, "example", { - ascii_armor: Fn.file("my-public-key.asc"), + asciiArmor: Token.asString(Fn.file("my-public-key.asc")), organization: "my-org-name", }); } @@ -59,4 +59,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 26f219159..c483d49a8 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -80,9 +80,9 @@ class MyConvertedCode extends TerraformStack { serviceProvider: "github", }); new RegistryModule(this, "test-registry-module", { - test_config: [ + testConfig: [ { - tests_enabled: true, + testsEnabled: true, }, ], vcsRepo: { @@ -243,12 +243,12 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: * `vcsRepo` - (Optional) Settings for the registry module's VCS repository. Forces a - new resource if changed. One of `vcs_repo` or `module_provider` is required. + new resource if changed. One of `vcsRepo` or `moduleProvider` is required. * `moduleProvider` - (Optional) Specifies the Terraform provider that this module is used for. For example, "aws" -* `name` - (Optional) The name of registry module. It must be set if `module_provider` is used. -* `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `module_provider` is used, or if `vcs_repo` is used via a GitHub App. -* `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. -* `registryName` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +* `name` - (Optional) The name of registry module. It must be set if `moduleProvider` is used. +* `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `moduleProvider` is used, or if `vcsRepo` is used via a GitHub App. +* `namespace` - (Optional) The namespace of a public registry module. It can be used if `moduleProvider` is set and `registryName` is public. +* `registryName` - (Optional) Whether the registry module is private or public. It can be used if `moduleProvider` is set. The `testConfig` block supports * `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -261,8 +261,8 @@ The `vcsRepo` block supports: * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. -* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. * `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. * `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. @@ -292,4 +292,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_provider.html.markdown b/website/docs/cdktf/typescript/r/registry_provider.html.markdown new file mode 100644 index 000000000..9f3a66ddf --- /dev/null +++ b/website/docs/cdktf/typescript/r/registry_provider.html.markdown @@ -0,0 +1,109 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + + + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Organization(this, "example", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { + name: "my-provider", + organization: example.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.overrideLogicalId("example"); + } +} + +``` + +Create public provider: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Organization(this, "example", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { + name: "aws", + namespace: "hashicorp", + organization: example.name, + registry_name: "public", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registryName` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `createdAt` - The time when the provider was created. +* `updatedAt` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 481c24289..7b47cf530 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -73,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index fd4ed8cb5..3a066e587 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -78,4 +78,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 441c9e7d2..b3c096b73 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -69,4 +69,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file From f8ec8435c26255f316122408ee238dad601e079c Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 16:09:36 +0000 Subject: [PATCH 204/420] cdktf: update r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown --- .../r/notification_configuration.html.markdown | 2 +- .../cdktf/python/r/oauth_client.html.markdown | 2 +- .../cdktf/python/r/organization.html.markdown | 2 +- ...organization_default_settings.html.markdown | 2 +- .../r/organization_membership.html.markdown | 2 +- .../organization_module_sharing.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../python/r/organization_token.html.markdown | 2 +- .../docs/cdktf/python/r/policy.html.markdown | 2 +- .../cdktf/python/r/policy_set.html.markdown | 2 +- .../r/notification_configuration.html.markdown | 14 +++++++------- .../typescript/r/oauth_client.html.markdown | 4 ++-- .../typescript/r/organization.html.markdown | 2 +- ...organization_default_settings.html.markdown | 6 +++--- .../r/organization_membership.html.markdown | 2 +- .../organization_module_sharing.html.markdown | 4 ++-- .../r/organization_run_task.html.markdown | 2 +- .../r/organization_token.html.markdown | 2 +- .../cdktf/typescript/r/policy.html.markdown | 2 +- .../typescript/r/policy_set.html.markdown | 18 +++++++++--------- 20 files changed, 38 insertions(+), 38 deletions(-) diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index c9cc66db1..a92f0fa8c 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -188,4 +188,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index cd9234004..3c8936ee5 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -130,4 +130,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index f4727dc30..0a2ff0293 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -64,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown index 3d81b5007..14ce4dff7 100644 --- a/website/docs/cdktf/python/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -67,4 +67,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 17610f185..37a4691e2 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -69,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 80126fa0e..c09624705 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -43,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index cf07b9620..0fd044ff3 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -63,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 39b73ec33..49c8b225a 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -87,4 +87,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index ec98263bb..6e5f7f313 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -97,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 8015eced1..3edf45d42 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -159,4 +159,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index c35020939..832d65613 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -117,7 +117,7 @@ class MyConvertedCode extends TerraformStack { ``` -(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: +(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `email_users`: ```typescript // DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug @@ -190,21 +190,21 @@ The following arguments are supported: * `slack` * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value - _must not_ be provided if `destination_type` is `generic`, `microsoft-teams`, or `slack`. + _must not_ be provided if `destinationType` is `generic`, `microsoft-teams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided - if `destination_type` is `generic`, `microsoft-teams`, or `slack`. + if `destinationType` is `generic`, `microsoft-teams`, or `slack`. * `enabled` - (Optional) Whether the notification configuration should be enabled or not. Disabled configurations will not send any notifications. Defaults to `false`. * `token` - (Optional) A write-only secure token for the notification configuration, which can be used by the receiving server to verify request authenticity when configured for notification configurations with a destination type of `generic`. Defaults to `null`. - This value _must not_ be provided if `destination_type` is `email`, `microsoft-teams`, or `slack`. + This value _must not_ be provided if `destinationType` is `email`, `microsoft-teams`, or `slack`. * `triggers` - (Optional) The array of triggers for which this notification configuration will send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, or `assessment:failed`. If omitted, no notification triggers are configured. -* `url` - (Required if `destination_type` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification - configuration where notification requests will be made. This value _must not_ be provided if `destination_type` +* `url` - (Required if `destinationType` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification + configuration where notification requests will be made. This value _must not_ be provided if `destinationType` is `email`. * `workspaceId` - (Required) The id of the workspace that owns the notification configuration. @@ -220,4 +220,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 33f1db35a..278eb1c09 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -116,7 +116,7 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: -* `name` - (Optional) Display name for the OAuth Client. Defaults to the `service_provider` if not supplied. +* `name` - (Optional) Display name for the OAuth Client. Defaults to the `serviceProvider` if not supplied. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `apiUrl` - (Required) The base URL of your VCS provider's API (e.g. `https://api.github.com` or `https://ghe.example.com/api/v3`). @@ -142,4 +142,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 7e3244e1d..1fe757fe2 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -67,4 +67,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown index 5c41a0a0b..f67a38223 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_organization_default_settings -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). +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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). ## Example Usage @@ -58,7 +58,7 @@ The following arguments are supported: * `defaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. -* `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. +* `defaultAgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `defaultExecutionMode` to be set to `agent`. This value _must not_ be provided if `defaultExecutionMode` is set to any other value. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -70,4 +70,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index b856b2207..89296d349 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -72,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 729b78ded..0f74eedd8 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -12,7 +12,7 @@ description: |- Manage module sharing for an organization. This resource requires the use of an admin token and is for Terraform Enterprise only. --> **NOTE:** `tfeOrganizationModuleSharing` is deprecated in favor of using `tfeAdminOrganizationSettings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. +-> **NOTE:** `tfe_organization_module_sharing` is deprecated in favor of using `tfe_admin_organization_settings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. ## Example Usage @@ -46,4 +46,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index e3d825a1d..45ac191ff 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -66,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 5ea6633b5..e3cdde277 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -93,4 +93,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index 12636f4bb..453b98975 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -103,4 +103,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index f00890aa5..49fa58617 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -119,7 +119,7 @@ The following arguments are supported: * `description` - (Optional) A description of the policy set's purpose. * `global` - (Optional) Whether or not policies in this set will apply to all workspaces. Defaults to `false`. This value _must not_ be provided if - `workspace_ids` is provided. + `workspaceIds` is provided. * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. @@ -127,17 +127,17 @@ The following arguments are supported: it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `policiesPath` - (Optional) The sub-path within the attached VCS repository - to ingress when using `vcs_repo`. All files and directories outside of this - sub-path will be ignored. This option can only be supplied when `vcs_repo` is + to ingress when using `vcsRepo`. All files and directories outside of this + sub-path will be ignored. This option can only be supplied when `vcsRepo` is present. Forces a new resource if changed. * `policyIds` - (Optional) A list of Sentinel policy IDs. This value _must not_ be provided - if `vcs_repo` is provided. + if `vcsRepo` is provided. * `vcsRepo` - (Optional) Settings for the policy sets VCS repository. Forces a - new resource if changed. This value _must not_ be provided if `policy_ids` are provided. + new resource if changed. This value _must not_ be provided if `policyIds` are provided. * `workspaceIds` - (Optional) A list of workspace IDs. This value _must not_ be provided if `global` is provided. * `slug` - (Optional) A reference to the `tfe_slug` data source that contains - the `source_path` to where the local policies are located. This is used when + the `sourcePath` to where the local policies are located. This is used when policies are located locally, and can only be used when there is no VCS repo or explicit Policy IDs. This _requires_ the usage of the `tfe_slug` data source. @@ -153,8 +153,8 @@ The `vcsRepo` block supports: This defaults to the repository's default branch (e.g. main). * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. -* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. -* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. +* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. +* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. ## Attributes Reference @@ -168,4 +168,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file From a77be33aa73c0bd9d4d69770c1dc91d52844c1fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:06:55 +0000 Subject: [PATCH 205/420] Build(deps): Bump actions/download-artifact from 4.1.0 to 4.1.1 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110...6b208ae046db98c579e8a3aa621ab581ff575935) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f759a6a38..4dc0e2a59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 16 - name: Download artifacts - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 78cc3bfcf..c1f59ded0 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 with: name: terraform-provider-tfe From a0a34665af58371e66e559fc2146c9274762c5c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:34:26 +0000 Subject: [PATCH 206/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 1.4.2 to 1.5.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v1.4.2...v1.5.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d63e42683..69f0b6c75 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect - github.com/hashicorp/terraform-plugin-framework v1.4.2 + github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.20.0 github.com/hashicorp/terraform-plugin-mux v0.13.0 diff --git a/go.sum b/go.sum index 82eb98e06..4d682b736 100644 --- a/go.sum +++ b/go.sum @@ -92,8 +92,8 @@ github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81Sp github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5OckzhoiO3ig6SGxwelD2sI= -github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY= +github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= +github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= From 0e2917f340ce11911f11b1fa1c96cb9f2ad96a01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:58:49 +0000 Subject: [PATCH 207/420] Build(deps): Bump actions/cache from 3.3.2 to 3.3.3 Bumps [actions/cache](https://github.com/actions/cache) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/704facf57e6136b1bc63b828d79edcd491f0ee84...e12d46a63a90f2fae62d114769bbf2a179198b5c) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index c1f59ded0..606449886 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -74,7 +74,7 @@ jobs: - name: Get yarn cache directory path id: global-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3 id: global-cache with: path: ${{ steps.global-cache-dir-path.outputs.dir }} From 0c137a754c05ed6926eff3ec22db97713048d0b9 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 12 Jan 2024 10:34:01 -0700 Subject: [PATCH 208/420] Nudge contributors to create new resources in Provider Framework --- docs/index.md | 2 +- docs/new-resources.md | 13 +++++++++++++ internal/provider/provider.go | 6 ++++++ mkdocs.yml | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 docs/new-resources.md diff --git a/docs/index.md b/docs/index.md index 8745c1c4f..b7fb0aabf 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,6 +2,6 @@ Thanks for your interest in contributing to the official Terraform Cloud/Enterprise provider. We appreciate your help! If you're unsure or afraid of anything, you can submit a work in progress (WIP) pull request, or file an issue with the parts you know. We'll do our best to guide you in the right direction, and let you know if there are guidelines we will need to follow. We want people to be able to participate without fear of doing the wrong thing. -This guide is broken down into sections to help you [configure your environment](development-environment.md), [debug](debugging.md), and [test](testing.md) code to ensure your contribution can be included in a release. +This guide is broken down into sections to help you [configure your environment](development-environment.md), [creating new resources](new-resources.md), [debug](debugging.md), and [test](testing.md) code to ensure your contribution can be included in a release. If you are contributing a new feature that is not yet generally available, review our [beta feature policy](beta.md). diff --git a/docs/new-resources.md b/docs/new-resources.md new file mode 100644 index 000000000..0c629f33c --- /dev/null +++ b/docs/new-resources.md @@ -0,0 +1,13 @@ +# Creating New Resources + +As we work to migrate older resources from the provider SDK v2 to the [Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework), the hashicorp/tfe provider uses plugin protocol v5 along with three separate provider servers [muxed together](https://github.com/hashicorp/terraform-provider-tfe/blob/20448c7293b2e116b633eef4bc73881b060aa32e/main.go#L51). + +For all new resources, we ask that you add them to the [provider_next](https://github.com/hashicorp/terraform-provider-tfe/blob/20448c7293b2e116b633eef4bc73881b060aa32e/internal/provider/provider_next.go) Framework Provider to ensure that they don't need to be migrated in the future. For Hashicorp employees: It can be helpful to include a section in a relevant RFC defining your proposed new resource schema. Be sure to notify #team-tf-cli. + +There are a few conventions to observe when authoring new resources: + +1. Provider default organization: `organization` should typically be an optional argument and is allowed to be configured at the provider block. [Implement](https://github.com/hashicorp/terraform-provider-tfe/blob/20448c7293b2e116b633eef4bc73881b060aa32e/internal/provider/resource_tfe_registry_provider.go#L191-L196) dataOrDefaultOrganization to help resolve the resource organization. In addition, your resource should [implement](https://github.com/hashicorp/terraform-provider-tfe/blob/20448c7293b2e116b633eef4bc73881b060aa32e/internal/provider/resource_tfe_registry_provider.go#L177-L179) framework interface `resource.ResourceWithModifyPlan` in order to detect changes in the provider default organization. + +2. Use [resource interfaces](https://github.com/hashicorp/terraform-provider-tfe/blob/20448c7293b2e116b633eef4bc73881b060aa32e/internal/provider/resource_tfe_registry_provider.go#L25-L29) to ensure your new resource implements all necessary behaviors. + +3. Make ImportState arguments convenient and using the fewest arguments possible. diff --git a/internal/provider/provider.go b/internal/provider/provider.go index a37f68b6c..3d5e87e0a 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -103,6 +103,9 @@ func Provider() *schema.Provider { "tfe_policy_set": dataSourceTFEPolicySet(), "tfe_organization_members": dataSourceTFEOrganizationMembers(), "tfe_github_app_installation": dataSourceTFEGHAInstallation(), + // IMPORTANT: + // New data sources should be defined in provider_next.go using + // the [Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework). }, ResourcesMap: map[string]*schema.Resource{ @@ -145,6 +148,9 @@ func Provider() *schema.Provider { "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), "tfe_workspace_run": resourceTFEWorkspaceRun(), "tfe_workspace_variable_set": resourceTFEWorkspaceVariableSet(), + // IMPORTANT: + // New resources should be defined in provider_next.go using + // the [Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework). }, ConfigureContextFunc: configure(), } diff --git a/mkdocs.yml b/mkdocs.yml index bbfd81a4b..23bd89aed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,6 +12,7 @@ nav: - Development Environment: development-environment.md - Test Infrastructure: test-infrastructure.md - Contribution Guides: + - New Resources: new-resources.md - Testing: testing.md - Introducing Beta Features: beta.md - Debugging: debugging.md From 8f5d37a1169300307fdd4a35a9c7da1b4d1e6247 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 12 Jan 2024 11:37:30 -0700 Subject: [PATCH 209/420] Add helpful comments to SDK v2 resources --- internal/provider/data_source_agent_pool.go | 5 +++++ internal/provider/data_source_github_app_installation.go | 6 ++++++ internal/provider/data_source_ip_ranges.go | 5 +++++ internal/provider/data_source_oauth_client.go | 5 +++++ internal/provider/data_source_organization.go | 5 +++++ internal/provider/data_source_organization_members.go | 5 +++++ internal/provider/data_source_organization_membership.go | 5 +++++ internal/provider/data_source_organization_run_task.go | 5 +++++ internal/provider/data_source_organization_tags.go | 5 +++++ internal/provider/data_source_organizations.go | 5 +++++ internal/provider/data_source_outputs.go | 4 ++++ internal/provider/data_source_policy_set.go | 5 +++++ internal/provider/data_source_project.go | 6 ++++-- internal/provider/data_source_slug.go | 5 +++++ internal/provider/data_source_ssh_key.go | 5 +++++ internal/provider/data_source_team.go | 5 +++++ internal/provider/data_source_team_access.go | 5 +++++ internal/provider/data_source_team_project_access.go | 5 +++++ internal/provider/data_source_teams.go | 5 +++++ internal/provider/data_source_variable_set.go | 5 +++++ internal/provider/data_source_variables.go | 5 +++++ internal/provider/data_source_workspace.go | 5 +++++ internal/provider/data_source_workspace_ids.go | 5 +++++ internal/provider/data_source_workspace_run_task.go | 5 +++++ .../provider/resource_tfe_admin_organization_settings.go | 5 +++++ internal/provider/resource_tfe_agent_pool.go | 5 +++++ .../provider/resource_tfe_agent_pool_allowed_workspaces.go | 5 +++++ internal/provider/resource_tfe_agent_token.go | 5 +++++ internal/provider/resource_tfe_no_code_module.go | 5 +++++ .../provider/resource_tfe_notification_configuration.go | 5 +++++ internal/provider/resource_tfe_oauth_client.go | 5 +++++ internal/provider/resource_tfe_organization.go | 5 +++++ .../provider/resource_tfe_organization_default_settings.go | 5 +++++ internal/provider/resource_tfe_organization_membership.go | 5 +++++ .../provider/resource_tfe_organization_module_sharing.go | 5 +++++ internal/provider/resource_tfe_organization_run_task.go | 5 +++++ internal/provider/resource_tfe_organization_token.go | 5 +++++ internal/provider/resource_tfe_policy.go | 5 +++++ internal/provider/resource_tfe_policy_set.go | 5 +++++ internal/provider/resource_tfe_policy_set_parameter.go | 5 +++++ internal/provider/resource_tfe_project.go | 5 +++++ internal/provider/resource_tfe_project_policy_set.go | 5 +++++ internal/provider/resource_tfe_project_variable_set.go | 5 +++++ internal/provider/resource_tfe_registry_module.go | 5 +++++ internal/provider/resource_tfe_run_trigger.go | 5 +++++ internal/provider/resource_tfe_sentinel_policy.go | 5 +++++ internal/provider/resource_tfe_ssh_key.go | 5 +++++ internal/provider/resource_tfe_team.go | 6 ++++++ internal/provider/resource_tfe_team_access.go | 5 +++++ internal/provider/resource_tfe_team_member.go | 5 +++++ internal/provider/resource_tfe_team_members.go | 5 +++++ internal/provider/resource_tfe_team_organization_member.go | 5 +++++ internal/provider/resource_tfe_team_organization_members.go | 5 +++++ internal/provider/resource_tfe_team_project_access.go | 5 +++++ internal/provider/resource_tfe_team_token.go | 5 +++++ internal/provider/resource_tfe_terraform_version.go | 5 +++++ internal/provider/resource_tfe_variable_set.go | 5 +++++ internal/provider/resource_tfe_workspace.go | 5 +++++ internal/provider/resource_tfe_workspace_policy_set.go | 5 +++++ .../provider/resource_tfe_workspace_policy_set_exclusion.go | 5 +++++ internal/provider/resource_tfe_workspace_run.go | 5 +++++ internal/provider/resource_tfe_workspace_run_task.go | 5 +++++ internal/provider/resource_tfe_workspace_variable_set.go | 5 +++++ 63 files changed, 315 insertions(+), 2 deletions(-) diff --git a/internal/provider/data_source_agent_pool.go b/internal/provider/data_source_agent_pool.go index c3cc000a3..0c811c3b5 100644 --- a/internal/provider/data_source_agent_pool.go +++ b/internal/provider/data_source_agent_pool.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_github_app_installation.go b/internal/provider/data_source_github_app_installation.go index fcccc663e..9b4f45c9d 100644 --- a/internal/provider/data_source_github_app_installation.go +++ b/internal/provider/data_source_github_app_installation.go @@ -1,5 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 + +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_ip_ranges.go b/internal/provider/data_source_ip_ranges.go index e87d6eb34..f7bff7ac8 100644 --- a/internal/provider/data_source_ip_ranges.go +++ b/internal/provider/data_source_ip_ranges.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_oauth_client.go b/internal/provider/data_source_oauth_client.go index 7ac12ed30..5f977dca2 100644 --- a/internal/provider/data_source_oauth_client.go +++ b/internal/provider/data_source_oauth_client.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organization.go b/internal/provider/data_source_organization.go index a8de9ba16..7b880d6cc 100644 --- a/internal/provider/data_source_organization.go +++ b/internal/provider/data_source_organization.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organization_members.go b/internal/provider/data_source_organization_members.go index 19cbecb1d..572696f95 100644 --- a/internal/provider/data_source_organization_members.go +++ b/internal/provider/data_source_organization_members.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organization_membership.go b/internal/provider/data_source_organization_membership.go index def811eb3..a5001bed2 100644 --- a/internal/provider/data_source_organization_membership.go +++ b/internal/provider/data_source_organization_membership.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organization_run_task.go b/internal/provider/data_source_organization_run_task.go index 1f2457c71..b18b6e4ba 100644 --- a/internal/provider/data_source_organization_run_task.go +++ b/internal/provider/data_source_organization_run_task.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organization_tags.go b/internal/provider/data_source_organization_tags.go index df2ef4311..4480425b3 100644 --- a/internal/provider/data_source_organization_tags.go +++ b/internal/provider/data_source_organization_tags.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_organizations.go b/internal/provider/data_source_organizations.go index 5fccd9a95..2ef24cc51 100644 --- a/internal/provider/data_source_organizations.go +++ b/internal/provider/data_source_organizations.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_outputs.go b/internal/provider/data_source_outputs.go index e40dd608b..d7b9d879a 100644 --- a/internal/provider/data_source_outputs.go +++ b/internal/provider/data_source_outputs.go @@ -1,6 +1,10 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This resource uses the low level plugin framework in order to +// deal with sensitive values. It may be possible to migrate this to the +// Plugin Framework. Do not use this code as boilerplate for new resources. + package provider import ( diff --git a/internal/provider/data_source_policy_set.go b/internal/provider/data_source_policy_set.go index 66f8bd518..5e5bb2ead 100644 --- a/internal/provider/data_source_policy_set.go +++ b/internal/provider/data_source_policy_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_project.go b/internal/provider/data_source_project.go index e451dc922..e4c9cf99a 100644 --- a/internal/provider/data_source_project.go +++ b/internal/provider/data_source_project.go @@ -1,8 +1,10 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Read context to implement cancellation -// +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. package provider diff --git a/internal/provider/data_source_slug.go b/internal/provider/data_source_slug.go index 6a4b5b317..728d6a969 100644 --- a/internal/provider/data_source_slug.go +++ b/internal/provider/data_source_slug.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_ssh_key.go b/internal/provider/data_source_ssh_key.go index 7b980510d..a8d607cd6 100644 --- a/internal/provider/data_source_ssh_key.go +++ b/internal/provider/data_source_ssh_key.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_team.go b/internal/provider/data_source_team.go index d9e79ec8c..5f7a63247 100644 --- a/internal/provider/data_source_team.go +++ b/internal/provider/data_source_team.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_team_access.go b/internal/provider/data_source_team_access.go index 69dcbfd3a..9b88a2f58 100644 --- a/internal/provider/data_source_team_access.go +++ b/internal/provider/data_source_team_access.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_team_project_access.go b/internal/provider/data_source_team_project_access.go index c2c891aeb..7e6ad0493 100644 --- a/internal/provider/data_source_team_project_access.go +++ b/internal/provider/data_source_team_project_access.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_teams.go b/internal/provider/data_source_teams.go index ab684b67a..11ce9839b 100644 --- a/internal/provider/data_source_teams.go +++ b/internal/provider/data_source_teams.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_variable_set.go b/internal/provider/data_source_variable_set.go index 01953ff09..cccc0ddfa 100644 --- a/internal/provider/data_source_variable_set.go +++ b/internal/provider/data_source_variable_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_variables.go b/internal/provider/data_source_variables.go index 202196a58..fb026bc44 100644 --- a/internal/provider/data_source_variables.go +++ b/internal/provider/data_source_variables.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_workspace.go b/internal/provider/data_source_workspace.go index ab5664683..7b7cb3210 100644 --- a/internal/provider/data_source_workspace.go +++ b/internal/provider/data_source_workspace.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_workspace_ids.go b/internal/provider/data_source_workspace_ids.go index 32114644b..5f9a383c5 100644 --- a/internal/provider/data_source_workspace_ids.go +++ b/internal/provider/data_source_workspace_ids.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/data_source_workspace_run_task.go b/internal/provider/data_source_workspace_run_task.go index ebbe5d090..7352ffa69 100644 --- a/internal/provider/data_source_workspace_run_task.go +++ b/internal/provider/data_source_workspace_run_task.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_admin_organization_settings.go b/internal/provider/resource_tfe_admin_organization_settings.go index faa7fc5d2..43c799908 100644 --- a/internal/provider/resource_tfe_admin_organization_settings.go +++ b/internal/provider/resource_tfe_admin_organization_settings.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_agent_pool.go b/internal/provider/resource_tfe_agent_pool.go index 03819d876..a229bdb57 100644 --- a/internal/provider/resource_tfe_agent_pool.go +++ b/internal/provider/resource_tfe_agent_pool.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_agent_pool_allowed_workspaces.go b/internal/provider/resource_tfe_agent_pool_allowed_workspaces.go index cf94d5732..c1bb6772b 100644 --- a/internal/provider/resource_tfe_agent_pool_allowed_workspaces.go +++ b/internal/provider/resource_tfe_agent_pool_allowed_workspaces.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_agent_token.go b/internal/provider/resource_tfe_agent_token.go index d160fcbf0..b0a0a7ebc 100644 --- a/internal/provider/resource_tfe_agent_token.go +++ b/internal/provider/resource_tfe_agent_token.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_no_code_module.go b/internal/provider/resource_tfe_no_code_module.go index ef073f155..92a39253f 100644 --- a/internal/provider/resource_tfe_no_code_module.go +++ b/internal/provider/resource_tfe_no_code_module.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_notification_configuration.go b/internal/provider/resource_tfe_notification_configuration.go index 93a334e8a..f27a87818 100644 --- a/internal/provider/resource_tfe_notification_configuration.go +++ b/internal/provider/resource_tfe_notification_configuration.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index 1528be804..215443193 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization.go b/internal/provider/resource_tfe_organization.go index 491581930..04a25bc2c 100644 --- a/internal/provider/resource_tfe_organization.go +++ b/internal/provider/resource_tfe_organization.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization_default_settings.go b/internal/provider/resource_tfe_organization_default_settings.go index c6fe9c3af..4462d5007 100644 --- a/internal/provider/resource_tfe_organization_default_settings.go +++ b/internal/provider/resource_tfe_organization_default_settings.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization_membership.go b/internal/provider/resource_tfe_organization_membership.go index be760c66a..b89424fe3 100644 --- a/internal/provider/resource_tfe_organization_membership.go +++ b/internal/provider/resource_tfe_organization_membership.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization_module_sharing.go b/internal/provider/resource_tfe_organization_module_sharing.go index 717ff6abb..6636b7929 100644 --- a/internal/provider/resource_tfe_organization_module_sharing.go +++ b/internal/provider/resource_tfe_organization_module_sharing.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization_run_task.go b/internal/provider/resource_tfe_organization_run_task.go index 89ce048c7..a049edcbb 100644 --- a/internal/provider/resource_tfe_organization_run_task.go +++ b/internal/provider/resource_tfe_organization_run_task.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_organization_token.go b/internal/provider/resource_tfe_organization_token.go index 497448f14..5eba3c172 100644 --- a/internal/provider/resource_tfe_organization_token.go +++ b/internal/provider/resource_tfe_organization_token.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_policy.go b/internal/provider/resource_tfe_policy.go index 8b2f5ab2d..ff0cd9c3f 100644 --- a/internal/provider/resource_tfe_policy.go +++ b/internal/provider/resource_tfe_policy.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_policy_set.go b/internal/provider/resource_tfe_policy_set.go index 4190733e5..658d9cf30 100644 --- a/internal/provider/resource_tfe_policy_set.go +++ b/internal/provider/resource_tfe_policy_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_policy_set_parameter.go b/internal/provider/resource_tfe_policy_set_parameter.go index b36770e50..0e5085b7c 100644 --- a/internal/provider/resource_tfe_policy_set_parameter.go +++ b/internal/provider/resource_tfe_policy_set_parameter.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index a56b97cb8..2762c5c47 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_project_policy_set.go b/internal/provider/resource_tfe_project_policy_set.go index dbb1987c8..79c106a82 100644 --- a/internal/provider/resource_tfe_project_policy_set.go +++ b/internal/provider/resource_tfe_project_policy_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_project_variable_set.go b/internal/provider/resource_tfe_project_variable_set.go index 65c9d4b37..f57727f73 100644 --- a/internal/provider/resource_tfe_project_variable_set.go +++ b/internal/provider/resource_tfe_project_variable_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 0c95cf0bc..825b79723 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_run_trigger.go b/internal/provider/resource_tfe_run_trigger.go index e7ff6896e..c4e590101 100644 --- a/internal/provider/resource_tfe_run_trigger.go +++ b/internal/provider/resource_tfe_run_trigger.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_sentinel_policy.go b/internal/provider/resource_tfe_sentinel_policy.go index 2bbe0c0c5..644f78729 100644 --- a/internal/provider/resource_tfe_sentinel_policy.go +++ b/internal/provider/resource_tfe_sentinel_policy.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_ssh_key.go b/internal/provider/resource_tfe_ssh_key.go index b8f5a6ca0..6f80ae986 100644 --- a/internal/provider/resource_tfe_ssh_key.go +++ b/internal/provider/resource_tfe_ssh_key.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team.go b/internal/provider/resource_tfe_team.go index d1e90c0a8..e85916563 100644 --- a/internal/provider/resource_tfe_team.go +++ b/internal/provider/resource_tfe_team.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( @@ -12,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "errors" + tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/internal/provider/resource_tfe_team_access.go b/internal/provider/resource_tfe_team_access.go index f0b047ab1..c8a18f04f 100644 --- a/internal/provider/resource_tfe_team_access.go +++ b/internal/provider/resource_tfe_team_access.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_member.go b/internal/provider/resource_tfe_team_member.go index ca8eab090..bcd6a614d 100644 --- a/internal/provider/resource_tfe_team_member.go +++ b/internal/provider/resource_tfe_team_member.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_members.go b/internal/provider/resource_tfe_team_members.go index a33543dc6..f4f65c3c8 100644 --- a/internal/provider/resource_tfe_team_members.go +++ b/internal/provider/resource_tfe_team_members.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_organization_member.go b/internal/provider/resource_tfe_team_organization_member.go index d63a65818..90f9534cc 100644 --- a/internal/provider/resource_tfe_team_organization_member.go +++ b/internal/provider/resource_tfe_team_organization_member.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_organization_members.go b/internal/provider/resource_tfe_team_organization_members.go index 8a58391b5..84696b0f2 100644 --- a/internal/provider/resource_tfe_team_organization_members.go +++ b/internal/provider/resource_tfe_team_organization_members.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_project_access.go b/internal/provider/resource_tfe_team_project_access.go index c12c517b0..94f5b360e 100644 --- a/internal/provider/resource_tfe_team_project_access.go +++ b/internal/provider/resource_tfe_team_project_access.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_team_token.go b/internal/provider/resource_tfe_team_token.go index 3fd0f03f9..5ede1b41f 100644 --- a/internal/provider/resource_tfe_team_token.go +++ b/internal/provider/resource_tfe_team_token.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_terraform_version.go b/internal/provider/resource_tfe_terraform_version.go index a687a5f5a..d8e19ef5e 100644 --- a/internal/provider/resource_tfe_terraform_version.go +++ b/internal/provider/resource_tfe_terraform_version.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_variable_set.go b/internal/provider/resource_tfe_variable_set.go index 4242db62f..2044eacc3 100644 --- a/internal/provider/resource_tfe_variable_set.go +++ b/internal/provider/resource_tfe_variable_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index f9a047edf..a6f00e646 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace_policy_set.go b/internal/provider/resource_tfe_workspace_policy_set.go index 82bb6dd19..fdefdd2e6 100644 --- a/internal/provider/resource_tfe_workspace_policy_set.go +++ b/internal/provider/resource_tfe_workspace_policy_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace_policy_set_exclusion.go b/internal/provider/resource_tfe_workspace_policy_set_exclusion.go index c23165ebb..3e359715d 100644 --- a/internal/provider/resource_tfe_workspace_policy_set_exclusion.go +++ b/internal/provider/resource_tfe_workspace_policy_set_exclusion.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace_run.go b/internal/provider/resource_tfe_workspace_run.go index a7987025b..a0bd1c6af 100644 --- a/internal/provider/resource_tfe_workspace_run.go +++ b/internal/provider/resource_tfe_workspace_run.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace_run_task.go b/internal/provider/resource_tfe_workspace_run_task.go index 9fbcb40f8..227a9a848 100644 --- a/internal/provider/resource_tfe_workspace_run_task.go +++ b/internal/provider/resource_tfe_workspace_run_task.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( diff --git a/internal/provider/resource_tfe_workspace_variable_set.go b/internal/provider/resource_tfe_workspace_variable_set.go index 066a73104..96535c255 100644 --- a/internal/provider/resource_tfe_workspace_variable_set.go +++ b/internal/provider/resource_tfe_workspace_variable_set.go @@ -1,6 +1,11 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +// NOTE: This is a legacy resource and should be migrated to the Plugin +// Framework if substantial modifications are planned. See +// docs/new-resources.md if planning to use this code as boilerplate for +// a new resource. + package provider import ( From 9d24a6c16f2eea7738bb179f3f37df317e21f9c2 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 12 Jan 2024 11:37:52 -0700 Subject: [PATCH 210/420] Fix linting issues --- .../provider/data_source_ip_ranges_test.go | 3 +-- .../resource_tfe_team_access_migrate_test.go | 2 +- .../resource_tfe_team_members_test.go | 2 +- .../provider/resource_tfe_workspace_test.go | 23 ------------------- internal/provider/workspace_helpers_test.go | 2 +- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/internal/provider/data_source_ip_ranges_test.go b/internal/provider/data_source_ip_ranges_test.go index 0483f318a..7e890d914 100644 --- a/internal/provider/data_source_ip_ranges_test.go +++ b/internal/provider/data_source_ip_ranges_test.go @@ -4,7 +4,6 @@ package provider import ( - "fmt" "regexp" "testing" @@ -38,5 +37,5 @@ func TestAccTFEIPRangesDataSource_basic(t *testing.T) { } func testAccTFEIPRangesDataSourceConfig() string { - return fmt.Sprintf(`data "tfe_ip_ranges" "ips" {}`) + return `data "tfe_ip_ranges" "ips" {}` } diff --git a/internal/provider/resource_tfe_team_access_migrate_test.go b/internal/provider/resource_tfe_team_access_migrate_test.go index 0a00d96c8..45e096243 100644 --- a/internal/provider/resource_tfe_team_access_migrate_test.go +++ b/internal/provider/resource_tfe_team_access_migrate_test.go @@ -26,7 +26,7 @@ func testResourceTfeTeamAccessStateDataV1() map[string]interface{} { func TestResourceTfeTeamAccessStateUpgradeV0(t *testing.T) { client := testTfeClient(t, testClientOptions{defaultWorkspaceID: "ws-123"}) name := "a-workspace" - client.Workspaces.Create(nil, "hashicorp", tfe.WorkspaceCreateOptions{ + client.Workspaces.Create(context.TODO(), "hashicorp", tfe.WorkspaceCreateOptions{ Name: &name, }) diff --git a/internal/provider/resource_tfe_team_members_test.go b/internal/provider/resource_tfe_team_members_test.go index 8de290291..fe10ee999 100644 --- a/internal/provider/resource_tfe_team_members_test.go +++ b/internal/provider/resource_tfe_team_members_test.go @@ -177,7 +177,7 @@ func testAccCheckTFETeamMembersAttributes( } func usernamesFromTFEUsers(users []*tfe.User) []string { - usernames := make([]string, len(users), len(users)) + usernames := make([]string, len(users)) for i, user := range users { usernames[i] = user.Username } diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 81cfef2d1..c48ab922f 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2918,22 +2918,6 @@ resource "tfe_workspace" "foobar" { }`, organization, organization) } -// while testing the flow of unsetting execution mode as in TestAccTFEWorkspace_unsetExecutionMode -// the resource "tfe_agent_pool" has been kept in both configs(testAccTFEWorkspace_executionModeAgent & testAccTFEWorkspace_executionModeNull) -// this prevents an attempt to destroy the agent pool before disassociating it from the workspace -func testAccTFEWorkspace_executionModeNull(organization string) string { - return fmt.Sprintf(` -resource "tfe_agent_pool" "foobar" { - name = "agent-pool-test" - organization = "%s" -} - -resource "tfe_workspace" "foobar" { - name = "workspace-test" - organization = "%s" -}`, organization, organization) -} - func testAccTFEWorkspace_basicSpeculativeOff(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { @@ -3648,10 +3632,3 @@ resource "tfe_workspace" "foobar" { source_name = "Example Source" }`, rInt) } - -func testAccTFEWorkspace_mismatchOrganization() string { - return `resource "tfe_workspace" "foobar" { - name = "workspace-test" - description = "My favorite workspace!" - }` -} diff --git a/internal/provider/workspace_helpers_test.go b/internal/provider/workspace_helpers_test.go index a99bff8c0..93106bcd2 100644 --- a/internal/provider/workspace_helpers_test.go +++ b/internal/provider/workspace_helpers_test.go @@ -35,7 +35,7 @@ func TestFetchWorkspaceExternalID(t *testing.T) { client := testTfeClient(t, testClientOptions{defaultWorkspaceID: "ws-123"}) name := "a-workspace" - client.Workspaces.Create(nil, "hashicorp", tfe.WorkspaceCreateOptions{ + client.Workspaces.Create(context.TODO(), "hashicorp", tfe.WorkspaceCreateOptions{ Name: &name, }) From 87908df977d478d0a87fac18db1c222df1b1f03e Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 12 Jan 2024 14:03:40 -0700 Subject: [PATCH 211/420] Flaky test fix --- internal/provider/data_source_organizations_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/provider/data_source_organizations_test.go b/internal/provider/data_source_organizations_test.go index 1d8fb95e7..784f5a179 100644 --- a/internal/provider/data_source_organizations_test.go +++ b/internal/provider/data_source_organizations_test.go @@ -23,9 +23,6 @@ func TestAccTFEOrganizationsDataSource_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccTFEOrganizationsDataSourceConfig_basic_resource(rInt), - }, - { - Config: testAccTFEOrganizationsDataSourceConfig_basic_data(), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckTFEOrganizationHasNames("data.tfe_organizations.foobarbaz", []string{ fmt.Sprintf("tst-terraform-foo-%d", rInt), @@ -107,9 +104,9 @@ resource "tfe_organization" "bar" { resource "tfe_organization" "baz" { name = "tst-terraform-baz-%d" email = "admin@company.com" -}`, rInt, rInt, rInt) } -func testAccTFEOrganizationsDataSourceConfig_basic_data() string { - return `data "tfe_organizations" "foobarbaz" {}` +data "tfe_organizations" "foobarbaz" { + depends_on = [tfe_organization.foo, tfe_organization.bar, tfe_organization.baz] +}`, rInt, rInt, rInt) } From 53e846023e67b6c8b541dcdee58d2256f0ce7c3f Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Fri, 12 Jan 2024 15:13:33 -0800 Subject: [PATCH 212/420] r/tfe_workspace: Fix panic when `trigger_prefixes = [""]` A customer reported this panic via support. Sebastian clued me in that this is an extremely cursed known behavior in sdkv2, where it munges a list of strings containing one empty string into a list containing a single nil, so you must do a type assert on the inner elements. Note that the Update function already did exactly this (around line 655 or so)! So there was no panic if you changed trigger_prefixes to the fatal value after the resource already existed. --- internal/provider/resource_tfe_workspace.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index a6f00e646..c8ce80a98 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -373,7 +373,9 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error if tps, ok := d.GetOk("trigger_prefixes"); ok { for _, tp := range tps.([]interface{}) { - options.TriggerPrefixes = append(options.TriggerPrefixes, tp.(string)) + if val, ok := tp.(string); ok { + options.TriggerPrefixes = append(options.TriggerPrefixes, val) + } } } else { options.TriggerPrefixes = nil From f1ae794f3115068d91e78cf289937a44f14e2714 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Fri, 12 Jan 2024 15:23:20 -0800 Subject: [PATCH 213/420] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2a8d41a..e3390ada6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ FEATURES: * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) +BUG FIXES: + +* `r/tfe_workspace`: Fix panic on creation when `trigger_prefixes = [""]`, by @nfagerlund [1214](https://github.com/hashicorp/terraform-provider-tfe/pull/1214) + ## v0.51.1 BUG FIXES: From 9460a4a1c41fe843e604219792d52b9cf9a9098a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:55:30 +0000 Subject: [PATCH 214/420] Build(deps): Bump actions/upload-artifact from 4.0.0 to 4.1.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/c7d193f32edcb7bfad88892161225aeda64e9392...1eb3cb2b3e0f29609092a73eb033bb759a334595) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dc0e2a59..0f4cf8fe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 606449886..195a8f166 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad96c4e41..8045dd97c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 with: name: release-notes path: release-notes.txt From 4e83154fa0121800b6fab25bda43dae8aa539637 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:09 +0000 Subject: [PATCH 215/420] cdktf: update r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown,r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown --- website/docs/cdktf/python/d/variable_set.html.markdown | 2 +- website/docs/cdktf/python/d/variables.html.markdown | 2 +- website/docs/cdktf/python/d/workspace.html.markdown | 2 +- website/docs/cdktf/python/d/workspace_ids.html.markdown | 2 +- website/docs/cdktf/python/d/workspace_run_task.html.markdown | 2 +- .../docs/cdktf/python/r/admin_organization_settings.markdown | 2 +- website/docs/cdktf/python/r/agent_pool.html.markdown | 2 +- .../cdktf/python/r/agent_pool_allowed_workspaces.html.markdown | 2 +- website/docs/cdktf/python/r/agent_token.html.markdown | 2 +- website/docs/cdktf/python/r/no_code_module.html.markdown | 2 +- website/docs/cdktf/typescript/d/variable_set.html.markdown | 2 +- website/docs/cdktf/typescript/d/variables.html.markdown | 2 +- website/docs/cdktf/typescript/d/workspace.html.markdown | 2 +- website/docs/cdktf/typescript/d/workspace_ids.html.markdown | 2 +- .../docs/cdktf/typescript/d/workspace_run_task.html.markdown | 2 +- .../cdktf/typescript/r/admin_organization_settings.markdown | 2 +- website/docs/cdktf/typescript/r/agent_pool.html.markdown | 2 +- .../typescript/r/agent_pool_allowed_workspaces.html.markdown | 2 +- website/docs/cdktf/typescript/r/agent_token.html.markdown | 2 +- website/docs/cdktf/typescript/r/no_code_module.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index a7ba1ead7..27fae8882 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -52,4 +52,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index c022fa7c5..cd3625403 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -87,4 +87,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 991f72aae..a60c39267 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -88,4 +88,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index c9a50d0ea..ca8b5f27a 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -64,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index e75077b23..84261df7d 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 65c126ad7..43e9e3b4e 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -72,4 +72,4 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index 96ba09a71..f0997789c 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -67,4 +67,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index 5a9952cda..b3908db0f 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -76,4 +76,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index f2c30fcfc..0a6b17a56 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -57,4 +57,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index d578915ea..a35a6503c 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -119,4 +119,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index bda49eb8d..3ff81d38e 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -55,4 +55,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index dc48e7187..09ecfabe9 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -93,4 +93,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 19623ffe3..5a491e8d7 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -91,4 +91,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 94d4023ff..31628da96 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -67,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 6680e45a2..5d1a71a5b 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -51,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 4c680b2d4..fbbaca18a 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -75,4 +75,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index e3e3aeac0..1e9d0c0f2 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index dccd4b3fd..f532fa426 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -82,4 +82,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index b2561efe4..a9b84db50 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -60,4 +60,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index 2b8a745e0..0e9040064 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -127,4 +127,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file From 43f9c350213e86f0d9ee12c9043e0283ccdcb661 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:26 +0000 Subject: [PATCH 216/420] cdktf: update d/oauth_client.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- website/docs/cdktf/python/d/agent_pool.html.markdown | 2 +- website/docs/cdktf/python/d/github_installation.html.markdown | 2 +- website/docs/cdktf/python/d/ip_ranges.html.markdown | 2 +- website/docs/cdktf/python/d/oauth_client.html.markdown | 2 +- website/docs/cdktf/typescript/d/agent_pool.html.markdown | 2 +- .../docs/cdktf/typescript/d/github_installation.html.markdown | 2 +- website/docs/cdktf/typescript/d/ip_ranges.html.markdown | 2 +- website/docs/cdktf/typescript/d/oauth_client.html.markdown | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index f14493063..df964f4cc 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index fe947e768..2d5ab9fd9 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -66,4 +66,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index badc0ea4a..545b0540a 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -45,4 +45,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index df8b1d562..79b1e70ef 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -102,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index c8074fdca..679a0d95e 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 55a04a6ba..de4de22b5 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -72,4 +72,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 69f0e8c1d..93428bb23 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -48,4 +48,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index a2db80cbb..30064e5c7 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -111,4 +111,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file From 09ad3677884c2341e2fe072911b5b833704c0f4d Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:42 +0000 Subject: [PATCH 217/420] cdktf: update d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown,d/organization_members.html.markdown,d/organization.html.markdown --- website/docs/cdktf/python/d/organization.html.markdown | 2 +- website/docs/cdktf/python/d/organization_members.html.markdown | 2 +- .../docs/cdktf/python/d/organization_membership.html.markdown | 2 +- website/docs/cdktf/python/d/organization_run_task.html.markdown | 2 +- website/docs/cdktf/python/d/organization_tags.html.markdown | 2 +- website/docs/cdktf/python/d/organizations.html.markdown | 2 +- website/docs/cdktf/python/d/outputs.html.markdown | 2 +- website/docs/cdktf/python/d/policy_set.html.markdown | 2 +- website/docs/cdktf/python/d/project.html.markdown | 2 +- website/docs/cdktf/python/d/registry_gpg_key.html.markdown | 2 +- website/docs/cdktf/typescript/d/organization.html.markdown | 2 +- .../docs/cdktf/typescript/d/organization_members.html.markdown | 2 +- .../cdktf/typescript/d/organization_membership.html.markdown | 2 +- .../docs/cdktf/typescript/d/organization_run_task.html.markdown | 2 +- website/docs/cdktf/typescript/d/organization_tags.html.markdown | 2 +- website/docs/cdktf/typescript/d/organizations.html.markdown | 2 +- website/docs/cdktf/typescript/d/outputs.html.markdown | 2 +- website/docs/cdktf/typescript/d/policy_set.html.markdown | 2 +- website/docs/cdktf/typescript/d/project.html.markdown | 2 +- website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 6ec8c4b15..b0b5bdc68 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index 50cae5f69..d27f10272 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -52,4 +52,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index 591a96c56..5d34fc000 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -98,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index e39176811..f4057ee90 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -50,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 02bf05054..35e8ecf05 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -47,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index d98f7f9c2..40acebd22 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -44,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 26679339f..81fff84bc 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -59,4 +59,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index dbe15f148..79249f665 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -67,4 +67,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 0a853fe24..7d521d696 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -44,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown index bf93fc6a2..a89adf1e9 100644 --- a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -44,4 +44,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 7c8373c18..00eb85705 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -50,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 1ff3e9f42..bc6075dcf 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -55,4 +55,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index a5831bed8..1f6b95439 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -107,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index c80231cba..eb3ef17ab 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -53,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index c62bfb8c7..fa7618293 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -50,4 +50,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index c7f1bb826..82fbe35c5 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -47,4 +47,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 15b17e6b6..2586d6d5f 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -62,4 +62,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 0ba1bf7d1..7c712ee1f 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -70,4 +70,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index f62b31edf..a6059773f 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown index 2d56eb81f..f85d500f4 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -47,4 +47,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file From a5b918e670a5f2d5cad200780fb452eb3c30b772 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:48 +0000 Subject: [PATCH 218/420] cdktf: update d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown,d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/registry_providers.html.markdown,d/registry_provider.html.markdown,d/registry_gpg_keys.html.markdown --- website/docs/cdktf/python/d/registry_gpg_keys.html.markdown | 2 +- website/docs/cdktf/python/d/registry_provider.html.markdown | 2 +- website/docs/cdktf/python/d/registry_providers.html.markdown | 2 +- website/docs/cdktf/python/d/saml_settings.html.markdown | 2 +- website/docs/cdktf/python/d/slug.html.markdown | 2 +- website/docs/cdktf/python/d/ssh_key.html.markdown | 2 +- website/docs/cdktf/python/d/team.html.markdown | 2 +- website/docs/cdktf/python/d/team_access.html.markdown | 2 +- website/docs/cdktf/python/d/team_project_access.html.markdown | 2 +- website/docs/cdktf/python/d/teams.html.markdown | 2 +- website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown | 2 +- website/docs/cdktf/typescript/d/registry_provider.html.markdown | 2 +- .../docs/cdktf/typescript/d/registry_providers.html.markdown | 2 +- website/docs/cdktf/typescript/d/saml_settings.html.markdown | 2 +- website/docs/cdktf/typescript/d/slug.html.markdown | 2 +- website/docs/cdktf/typescript/d/ssh_key.html.markdown | 2 +- website/docs/cdktf/typescript/d/team.html.markdown | 2 +- website/docs/cdktf/typescript/d/team_access.html.markdown | 2 +- .../docs/cdktf/typescript/d/team_project_access.html.markdown | 2 +- website/docs/cdktf/typescript/d/teams.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown index dba8d1255..3320a1c75 100644 --- a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -45,4 +45,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_provider.html.markdown b/website/docs/cdktf/python/d/registry_provider.html.markdown index b9947e8e9..f77027dfb 100644 --- a/website/docs/cdktf/python/d/registry_provider.html.markdown +++ b/website/docs/cdktf/python/d/registry_provider.html.markdown @@ -70,4 +70,4 @@ The following arguments are supported: * `created_at` - The time when the provider was created. * `updated_at` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_providers.html.markdown b/website/docs/cdktf/python/d/registry_providers.html.markdown index 8005228e0..c423eb4ba 100644 --- a/website/docs/cdktf/python/d/registry_providers.html.markdown +++ b/website/docs/cdktf/python/d/registry_providers.html.markdown @@ -91,4 +91,4 @@ The following arguments are supported: * `created_at` - Time when the provider was created. * `updated_at` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index c3158c5f2..f103ca385 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -74,4 +74,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 0088cde1f..c4f0c8a54 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -51,4 +51,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index 81865bd05..d5d2e6bba 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -44,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index a1bd9d235..620317566 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index ff6aa3ceb..d0e17f1f6 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -55,4 +55,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index a9932a0f8..b6e18fa24 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index 80ec54009..6580fd5fb 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -42,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown index bec9b7ada..67edda778 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -48,4 +48,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_provider.html.markdown b/website/docs/cdktf/typescript/d/registry_provider.html.markdown index 1635f9687..63cf354e6 100644 --- a/website/docs/cdktf/typescript/d/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_provider.html.markdown @@ -76,4 +76,4 @@ The following arguments are supported: * `createdAt` - The time when the provider was created. * `updatedAt` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_providers.html.markdown b/website/docs/cdktf/typescript/d/registry_providers.html.markdown index 58a6f4e18..9750ab164 100644 --- a/website/docs/cdktf/typescript/d/registry_providers.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_providers.html.markdown @@ -100,4 +100,4 @@ The following arguments are supported: * `createdAt` - Time when the provider was created. * `updatedAt` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 8c1308dd2..0f2535cb1 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -77,4 +77,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index bfe11432a..84a8bf12d 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -54,4 +54,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 8794e0838..0a783fac4 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 01a54bef0..95b80260f 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index c4916de41..e74140956 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -58,4 +58,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index b790074ae..b53b01c7b 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index 37ae863c7..a882c09e3 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file From 78cba66ccf671b3f8bf663f31c313f30409f222e Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:49 +0000 Subject: [PATCH 219/420] cdktf: update r/terraform_version.html.markdown,r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown --- website/docs/cdktf/python/r/ssh_key.html.markdown | 2 +- website/docs/cdktf/python/r/team.html.markdown | 2 +- website/docs/cdktf/python/r/team_access.html.markdown | 2 +- website/docs/cdktf/python/r/team_member.html.markdown | 2 +- website/docs/cdktf/python/r/team_members.html.markdown | 2 +- .../docs/cdktf/python/r/team_organization_member.html.markdown | 2 +- .../docs/cdktf/python/r/team_organization_members.html.markdown | 2 +- website/docs/cdktf/python/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/python/r/team_token.html.markdown | 2 +- website/docs/cdktf/python/r/terraform_version.html.markdown | 2 +- website/docs/cdktf/typescript/r/ssh_key.html.markdown | 2 +- website/docs/cdktf/typescript/r/team.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_access.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_member.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_members.html.markdown | 2 +- .../cdktf/typescript/r/team_organization_member.html.markdown | 2 +- .../cdktf/typescript/r/team_organization_members.html.markdown | 2 +- .../docs/cdktf/typescript/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/typescript/r/team_token.html.markdown | 2 +- website/docs/cdktf/typescript/r/terraform_version.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 43ce3609f..777ce33f4 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -52,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 4ea3cf1fc..8986aeff9 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -97,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index 0aa757fc5..a52e519f8 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -82,4 +82,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index ee883f677..e0e91ab64 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -65,4 +65,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 5de80cf59..405b4b098 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -96,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index c62a138cf..048cfa5d9 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -75,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 6014b6deb..7895bcf61 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -115,4 +115,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 992905b87..5f374a1e1 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -146,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index b05b59f0e..d3a7c2688 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -99,4 +99,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index df3982e45..010e15457 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -65,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 208268fb6..5005e86a3 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -55,4 +55,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index 3412b923b..723937553 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -103,4 +103,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 7e1d9b048..79dcd1795 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -85,4 +85,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index 5b181dfa9..d04d60adb 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -68,4 +68,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 76c09a17c..385531b7e 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -104,4 +104,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 1535dca5f..9c60fbb77 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -82,4 +82,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index ea47182ad..7dda75e25 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -134,4 +134,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 0cf27d176..bc47d7f18 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -154,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index 4d551fe22..702ea826e 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -105,4 +105,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 53add3e33..498537295 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -68,4 +68,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file From c1f5741c2b569287becf11d48ea6529c4b688941 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:43:56 +0000 Subject: [PATCH 220/420] cdktf: update r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown --- .../cdktf/python/r/notification_configuration.html.markdown | 2 +- website/docs/cdktf/python/r/oauth_client.html.markdown | 2 +- website/docs/cdktf/python/r/organization.html.markdown | 2 +- .../cdktf/python/r/organization_default_settings.html.markdown | 2 +- .../docs/cdktf/python/r/organization_membership.html.markdown | 2 +- .../cdktf/python/r/organization_module_sharing.html.markdown | 2 +- website/docs/cdktf/python/r/organization_run_task.html.markdown | 2 +- website/docs/cdktf/python/r/organization_token.html.markdown | 2 +- website/docs/cdktf/python/r/policy.html.markdown | 2 +- website/docs/cdktf/python/r/policy_set.html.markdown | 2 +- .../cdktf/typescript/r/notification_configuration.html.markdown | 2 +- website/docs/cdktf/typescript/r/oauth_client.html.markdown | 2 +- website/docs/cdktf/typescript/r/organization.html.markdown | 2 +- .../typescript/r/organization_default_settings.html.markdown | 2 +- .../cdktf/typescript/r/organization_membership.html.markdown | 2 +- .../typescript/r/organization_module_sharing.html.markdown | 2 +- .../docs/cdktf/typescript/r/organization_run_task.html.markdown | 2 +- .../docs/cdktf/typescript/r/organization_token.html.markdown | 2 +- website/docs/cdktf/typescript/r/policy.html.markdown | 2 +- website/docs/cdktf/typescript/r/policy_set.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index a92f0fa8c..d6e1694af 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -188,4 +188,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index 3c8936ee5..a0d2139ef 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -130,4 +130,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index 0a2ff0293..81beeb9bc 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -64,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown index 14ce4dff7..b96435924 100644 --- a/website/docs/cdktf/python/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -67,4 +67,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 37a4691e2..93f7c20b1 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -69,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index c09624705..5e606ea7c 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -43,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 0fd044ff3..0f562bca2 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -63,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 49c8b225a..02e9544c7 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -87,4 +87,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 6e5f7f313..3e794c4d2 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -97,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 3edf45d42..4193878fa 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -159,4 +159,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 832d65613..a4d382fde 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -220,4 +220,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 278eb1c09..1a3b53615 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -142,4 +142,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 1fe757fe2..a71bf2174 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -67,4 +67,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown index f67a38223..cf68a6606 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -70,4 +70,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 89296d349..094241ddd 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -72,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 0f74eedd8..23972ab15 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -46,4 +46,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index 45ac191ff..a52e2e0b8 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -66,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index e3cdde277..273e96979 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -93,4 +93,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index 453b98975..e9edf7291 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -103,4 +103,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 49fa58617..606aa5f95 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -168,4 +168,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file From f51302d2d0b92a792eb7ef215a150eda119ef17a Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:44:03 +0000 Subject: [PATCH 221/420] cdktf: update r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_provider.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown --- website/docs/cdktf/python/r/policy_set_parameter.html.markdown | 2 +- website/docs/cdktf/python/r/project.html.markdown | 2 +- website/docs/cdktf/python/r/project_policy_set.html.markdown | 2 +- website/docs/cdktf/python/r/project_variable_set.html.markdown | 2 +- website/docs/cdktf/python/r/registry_gpg_key.html.markdown | 2 +- website/docs/cdktf/python/r/registry_module.html.markdown | 2 +- website/docs/cdktf/python/r/registry_provider.html.markdown | 2 +- website/docs/cdktf/python/r/run_trigger.html.markdown | 2 +- website/docs/cdktf/python/r/saml_settings.html.markdown | 2 +- website/docs/cdktf/python/r/sentinel_policy.html.markdown | 2 +- .../docs/cdktf/typescript/r/policy_set_parameter.html.markdown | 2 +- website/docs/cdktf/typescript/r/project.html.markdown | 2 +- .../docs/cdktf/typescript/r/project_policy_set.html.markdown | 2 +- .../docs/cdktf/typescript/r/project_variable_set.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_module.html.markdown | 2 +- website/docs/cdktf/typescript/r/registry_provider.html.markdown | 2 +- website/docs/cdktf/typescript/r/run_trigger.html.markdown | 2 +- website/docs/cdktf/typescript/r/saml_settings.html.markdown | 2 +- website/docs/cdktf/typescript/r/sentinel_policy.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 153e6bd47..5904442c7 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -73,4 +73,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 42ee71f61..106e20258 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -59,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index 8adaba545..85ad3e390 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -74,4 +74,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 67b36640e..648c90db8 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -74,4 +74,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown index 329aadb29..e087f01bb 100644 --- a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -56,4 +56,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index f716523a4..9aadf00f2 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -265,4 +265,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_provider.html.markdown b/website/docs/cdktf/python/r/registry_provider.html.markdown index 796e172ef..5fdd3ac45 100644 --- a/website/docs/cdktf/python/r/registry_provider.html.markdown +++ b/website/docs/cdktf/python/r/registry_provider.html.markdown @@ -100,4 +100,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index 4dbda6d32..1ef9fc6f8 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -70,4 +70,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index e10a29a1f..3842ee3c9 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -75,4 +75,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index ab8204fc4..39b7518af 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -66,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index 386390bce..9acedef19 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 538807c44..98f69dc50 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index e0fe2387a..87d6f764d 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -77,4 +77,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index 0a96e7bec..cdb622020 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -77,4 +77,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index e2296ca07..3d4c9f943 100644 --- a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -59,4 +59,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index c483d49a8..1404322a4 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -292,4 +292,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_provider.html.markdown b/website/docs/cdktf/typescript/r/registry_provider.html.markdown index 9f3a66ddf..f295de485 100644 --- a/website/docs/cdktf/typescript/r/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_provider.html.markdown @@ -106,4 +106,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 7b47cf530..24f65857b 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -73,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 3a066e587..78e016f2f 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -78,4 +78,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index b3c096b73..0c1b07cf4 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -69,4 +69,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file From 47178a39fd3287cf443d6f3e8064434ccc6cc92a Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 17 Jan 2024 10:45:34 +0000 Subject: [PATCH 222/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown --- website/docs/cdktf/python/index.html.markdown | 2 +- website/docs/cdktf/python/r/variable.html.markdown | 2 +- website/docs/cdktf/python/r/variable_set.html.markdown | 2 +- website/docs/cdktf/python/r/workspace.html.markdown | 2 +- website/docs/cdktf/python/r/workspace_policy_set.html.markdown | 2 +- .../cdktf/python/r/workspace_policy_set_exclusion.html.markdown | 2 +- website/docs/cdktf/python/r/workspace_run.html.markdown | 2 +- website/docs/cdktf/python/r/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/python/r/workspace_settings.markdown | 2 +- .../docs/cdktf/python/r/workspace_variable_set.html.markdown | 2 +- website/docs/cdktf/typescript/index.html.markdown | 2 +- website/docs/cdktf/typescript/r/variable.html.markdown | 2 +- website/docs/cdktf/typescript/r/variable_set.html.markdown | 2 +- website/docs/cdktf/typescript/r/workspace.html.markdown | 2 +- .../docs/cdktf/typescript/r/workspace_policy_set.html.markdown | 2 +- .../typescript/r/workspace_policy_set_exclusion.html.markdown | 2 +- website/docs/cdktf/typescript/r/workspace_run.html.markdown | 2 +- .../docs/cdktf/typescript/r/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/typescript/r/workspace_settings.markdown | 2 +- .../cdktf/typescript/r/workspace_variable_set.html.markdown | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index b596e13f8..7309ce774 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -138,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index 49ebd828b..a606daed4 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -189,4 +189,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index 853346f0b..f5e16a6bd 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -198,4 +198,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index cf509013e..b7ff5cb80 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -186,4 +186,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 2e6a05321..bbf800503 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -76,4 +76,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index a9cf278fd..ab821e937 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -76,4 +76,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index 9f2baf905..200047332 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -228,4 +228,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 17b25ffaa..b27948513 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -58,4 +58,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index d3554c841..3825237d4 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -152,4 +152,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index bc048d611..0d3f249f3 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -76,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 4159e7030..57db5a77a 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -148,4 +148,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index b6e82bef4..329aa0a2d 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -198,4 +198,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index 85568a93a..f4e66379a 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -211,4 +211,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index ee6680519..8d128a5bd 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -192,4 +192,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index f9312e399..eb29e7b08 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -79,4 +79,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index c8b9a7200..e76d7a91a 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -83,4 +83,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 012a9374f..388a6fded 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -237,4 +237,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index dcb41a859..b45d66f2a 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -61,4 +61,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index b7cf98845..26cba38c8 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -170,4 +170,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index c15f02fae..89747f9cf 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -83,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 42c6513cff2481a8d3af110221d713c0b101acd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:37:26 +0000 Subject: [PATCH 223/420] Build(deps): Bump actions/cache from 3.3.3 to 4.0.0 Bumps [actions/cache](https://github.com/actions/cache) from 3.3.3 to 4.0.0. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/e12d46a63a90f2fae62d114769bbf2a179198b5c...13aacd865c20de90d75de3b17ebe84f7a17d57d2) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 606449886..3d93c63f5 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -74,7 +74,7 @@ jobs: - name: Get yarn cache directory path id: global-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3 + - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 id: global-cache with: path: ${{ steps.global-cache-dir-path.outputs.dir }} From bb1a4bd5f951633e22676f0a514127fbbc3beea2 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 4 Jan 2024 11:11:10 +1100 Subject: [PATCH 224/420] add support for policy tool version in terraform providers --- internal/provider/resource_tfe_opa_version.go | 175 +++++++++++ .../provider/resource_tfe_opa_version_test.go | 271 ++++++++++++++++++ .../provider/resource_tfe_sentinel_version.go | 175 +++++++++++ .../resource_tfe_sentinel_version_test.go | 271 ++++++++++++++++++ internal/provider/tool_helpers.go | 86 ++++++ 5 files changed, 978 insertions(+) create mode 100644 internal/provider/resource_tfe_opa_version.go create mode 100644 internal/provider/resource_tfe_opa_version_test.go create mode 100644 internal/provider/resource_tfe_sentinel_version.go create mode 100644 internal/provider/resource_tfe_sentinel_version_test.go diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go new file mode 100644 index 000000000..f70b8e1ca --- /dev/null +++ b/internal/provider/resource_tfe_opa_version.go @@ -0,0 +1,175 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tfe + +import ( + "context" + "fmt" + "log" + "strings" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceTFEOPAVersion() *schema.Resource { + return &schema.Resource{ + Create: resourceTFEOPAVersionCreate, + Read: resourceTFEOPAVersionRead, + Update: resourceTFEOPAVersionUpdate, + Delete: resourceTFEOPAVersionDelete, + Importer: &schema.ResourceImporter{ + StateContext: resourceTFEOPAVersionImporter, + }, + + Schema: map[string]*schema.Schema{ + "version": { + Type: schema.TypeString, + Required: true, + }, + "url": { + Type: schema.TypeString, + Required: true, + }, + "sha": { + Type: schema.TypeString, + Required: true, + }, + "official": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "beta": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "deprecated": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "deprecated_reason": { + Type: schema.TypeString, + Optional: true, + Default: nil, + }, + }, + } +} + +func resourceTFEOPAVersionCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + opts := tfe.AdminOPAVersionCreateOptions{ + Version: *tfe.String(d.Get("version").(string)), + URL: *tfe.String(d.Get("url").(string)), + SHA: *tfe.String(d.Get("sha").(string)), + Official: tfe.Bool(d.Get("official").(bool)), + Enabled: tfe.Bool(d.Get("enabled").(bool)), + Beta: tfe.Bool(d.Get("beta").(bool)), + Deprecated: tfe.Bool(d.Get("deprecated").(bool)), + DeprecatedReason: tfe.String(d.Get("deprecated_reason").(string)), + } + + log.Printf("[DEBUG] Create new OPA version: %s", opts.Version) + v, err := config.Client.Admin.OPAVersions.Create(ctx, opts) + if err != nil { + return fmt.Errorf("Error creating the new OPA version %s: %w", opts.Version, err) + } + + d.SetId(v.ID) + + return resourceTFEOPAVersionUpdate(d, meta) +} + +func resourceTFEOPAVersionRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Read configuration of OPA version: %s", d.Id()) + v, err := config.Client.Admin.OPAVersions.Read(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + log.Printf("[DEBUG] OPA version %s no longer exists", d.Id()) + d.SetId("") + return nil + } + return err + } + + d.Set("version", v.Version) + d.Set("url", v.URL) + d.Set("sha", v.SHA) + d.Set("official", v.Official) + d.Set("enabled", v.Enabled) + d.Set("beta", v.Beta) + d.Set("deprecated", v.Deprecated) + d.Set("deprecated_reason", v.DeprecatedReason) + + return nil +} + +func resourceTFEOPAVersionUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + opts := tfe.AdminOPAVersionUpdateOptions{ + Version: tfe.String(d.Get("version").(string)), + URL: tfe.String(d.Get("url").(string)), + SHA: tfe.String(d.Get("sha").(string)), + Official: tfe.Bool(d.Get("official").(bool)), + Enabled: tfe.Bool(d.Get("enabled").(bool)), + Beta: tfe.Bool(d.Get("beta").(bool)), + Deprecated: tfe.Bool(d.Get("deprecated").(bool)), + DeprecatedReason: tfe.String(d.Get("deprecated_reason").(string)), + } + + log.Printf("[DEBUG] Update configuration of OPA version: %s", d.Id()) + v, err := config.Client.Admin.OPAVersions.Update(ctx, d.Id(), opts) + if err != nil { + return fmt.Errorf("Error updating OPA version %s: %w", d.Id(), err) + } + + d.SetId(v.ID) + + return resourceTFEOPAVersionRead(d, meta) +} + +func resourceTFEOPAVersionDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Delete OPA version: %s", d.Id()) + err := config.Client.Admin.OPAVersions.Delete(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + return nil + } + return fmt.Errorf("Error deleting OPA version %s: %w", d.Id(), err) + } + + return nil +} + +func resourceTFEOPAVersionImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(ConfiguredClient) + + // Splitting by '-' and checking if the first elem is equal to tool + // determines if the string is a tool version ID + s := strings.Split(d.Id(), "-") + if s[0] != "tool" { + versionID, err := fetchOPAVersionID(d.Id(), config.Client) + if err != nil { + return nil, fmt.Errorf("error retrieving OPA version %s: %w", d.Id(), err) + } + + d.SetId(versionID) + } + + return []*schema.ResourceData{d}, nil +} diff --git a/internal/provider/resource_tfe_opa_version_test.go b/internal/provider/resource_tfe_opa_version_test.go new file mode 100644 index 000000000..3a8b77d6c --- /dev/null +++ b/internal/provider/resource_tfe_opa_version_test.go @@ -0,0 +1,271 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tfe + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "math/rand" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFEOPAVersion_basic(t *testing.T) { + skipIfCloud(t) + + opaVersion := &tfe.AdminOPAVersion{} + sha := genOPASha(t, "secret", "data") + version := genSafeRandomOPAVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOPAVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOPAVersion_basic(version, sha), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOPAVersionExists("tfe_opa_version.foobar", opaVersion), + testAccCheckTFEOPAVersionAttributesBasic(opaVersion, version, sha), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "version", version), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "url", "https://www.hashicorp.com"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "sha", sha), + ), + }, + }, + }) +} + +func TestAccTFEOPAVersion_import(t *testing.T) { + skipIfCloud(t) + + sha := genOPASha(t, "secret", "data") + version := genSafeRandomOPAVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOPAVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOPAVersion_basic(version, sha), + }, + { + ResourceName: "tfe_opa_version.foobar", + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: "tfe_opa_version.foobar", + ImportState: true, + ImportStateId: version, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFEOPAVersion_full(t *testing.T) { + skipIfCloud(t) + + opaVersion := &tfe.AdminOPAVersion{} + sha := genOPASha(t, "secret", "data") + version := genSafeRandomOPAVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOPAVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOPAVersion_full(version, sha), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOPAVersionExists("tfe_opa_version.foobar", opaVersion), + testAccCheckTFEOPAVersionAttributesFull(opaVersion, version, sha), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "version", version), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "url", "https://www.hashicorp.com"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "sha", sha), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "official", "false"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "enabled", "true"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "beta", "true"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "deprecated", "true"), + resource.TestCheckResourceAttr( + "tfe_opa_version.foobar", "deprecated_reason", "foobar"), + ), + }, + }, + }) +} + +func testAccCheckTFEOPAVersionDestroy(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_opa_version" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + _, err := config.Client.Admin.OPAVersions.Read(ctx, rs.Primary.ID) + if err == nil { + return fmt.Errorf("OPA version %s still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckTFEOPAVersionExists(n string, opaVersion *tfe.AdminOPAVersion) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + v, err := config.Client.Admin.OPAVersions.Read(ctx, rs.Primary.ID) + if err != nil { + return err + } + + if v.ID != rs.Primary.ID { + return fmt.Errorf("OPA version not found") + } + + *opaVersion = *v + + return nil + } +} + +func testAccCheckTFEOPAVersionAttributesBasic(opaVersion *tfe.AdminOPAVersion, version string, sha string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if opaVersion.URL != "https://www.hashicorp.com" { + return fmt.Errorf("Bad URL: %s", opaVersion.URL) + } + + if opaVersion.Version != version { + return fmt.Errorf("Bad version: %s", opaVersion.Version) + } + + if opaVersion.SHA != sha { + return fmt.Errorf("Bad value for Sha: %v", opaVersion.SHA) + } + + return nil + } +} + +func testAccCheckTFEOPAVersionAttributesFull(opaVersion *tfe.AdminOPAVersion, version string, sha string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if opaVersion.URL != "https://www.hashicorp.com" { + return fmt.Errorf("Bad URL: %s", opaVersion.URL) + } + + if opaVersion.Version != version { + return fmt.Errorf("Bad version: %s", opaVersion.Version) + } + + if opaVersion.SHA != sha { + return fmt.Errorf("Bad value for Sha: %v", opaVersion.SHA) + } + + if opaVersion.Official != false { + return fmt.Errorf("Bad value for official: %t", opaVersion.Official) + } + + if opaVersion.Enabled != true { + return fmt.Errorf("Bad value for enabled: %t", opaVersion.Enabled) + } + + if opaVersion.Beta != true { + return fmt.Errorf("Bad value for beta: %t", opaVersion.Beta) + } + + if opaVersion.Deprecated != true { + return fmt.Errorf("Bad value for deprecated: %t", opaVersion.Deprecated) + } + + if *opaVersion.DeprecatedReason != "foobar" { + return fmt.Errorf("Bad value for deprecated_reason: %s", *opaVersion.DeprecatedReason) + } + + return nil + } +} + +func testAccTFEOPAVersion_basic(version string, sha string) string { + return fmt.Sprintf(` +resource "tfe_opa_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +}`, version, sha) +} + +func testAccTFEOPAVersion_full(version string, sha string) string { + return fmt.Sprintf(` +resource "tfe_opa_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" + official = false + enabled = true + beta = true + deprecated = true + deprecated_reason = "foobar" +}`, version, sha) +} + +// Helper functions +func genOPASha(t *testing.T, secret, data string) string { + h := hmac.New(sha256.New, []byte(secret)) + _, err := h.Write([]byte(data)) + if err != nil { + t.Fatalf("error writing hmac: %s", err) + } + + sha := hex.EncodeToString(h.Sum(nil)) + return sha +} + +// genSafeRandomOPAVersion returns a random version number of the form +// `0.0.`, which TFC won't ever select as the latest available +// OPA. (At the time of writing, a fresh TFC instance will include +// official OPAs 0.44.0 and higher.) This is necessary because newly created +// workspaces default to the latest available version, and there's nothing +// preventing unrelated processes from creating workspaces during these tests. +func genSafeRandomOPAVersion() string { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + // Avoid colliding with an official OPA version. Highest was + // 0.58.0, so add a little padding and call it good. + for rInt < 20 { + rInt = rand.New(rand.NewSource(time.Now().UnixNano())).Int() + } + return fmt.Sprintf("0.0.%d", rInt) +} diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go new file mode 100644 index 000000000..da5ad2895 --- /dev/null +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -0,0 +1,175 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tfe + +import ( + "context" + "fmt" + "log" + "strings" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceTFESentinelVersion() *schema.Resource { + return &schema.Resource{ + Create: resourceTFESentinelVersionCreate, + Read: resourceTFESentinelVersionRead, + Update: resourceTFESentinelVersionUpdate, + Delete: resourceTFESentinelVersionDelete, + Importer: &schema.ResourceImporter{ + StateContext: resourceTFESentinelVersionImporter, + }, + + Schema: map[string]*schema.Schema{ + "version": { + Type: schema.TypeString, + Required: true, + }, + "url": { + Type: schema.TypeString, + Required: true, + }, + "sha": { + Type: schema.TypeString, + Required: true, + }, + "official": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "beta": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "deprecated": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "deprecated_reason": { + Type: schema.TypeString, + Optional: true, + Default: nil, + }, + }, + } +} + +func resourceTFESentinelVersionCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + opts := tfe.AdminSentinelVersionCreateOptions{ + Version: *tfe.String(d.Get("version").(string)), + URL: *tfe.String(d.Get("url").(string)), + SHA: *tfe.String(d.Get("sha").(string)), + Official: tfe.Bool(d.Get("official").(bool)), + Enabled: tfe.Bool(d.Get("enabled").(bool)), + Beta: tfe.Bool(d.Get("beta").(bool)), + Deprecated: tfe.Bool(d.Get("deprecated").(bool)), + DeprecatedReason: tfe.String(d.Get("deprecated_reason").(string)), + } + + log.Printf("[DEBUG] Create new Sentinel version: %s", opts.Version) + v, err := config.Client.Admin.SentinelVersions.Create(ctx, opts) + if err != nil { + return fmt.Errorf("Error creating the new Sentinel version %s: %w", opts.Version, err) + } + + d.SetId(v.ID) + + return resourceTFESentinelVersionUpdate(d, meta) +} + +func resourceTFESentinelVersionRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Read configuration of Sentinel version: %s", d.Id()) + v, err := config.Client.Admin.SentinelVersions.Read(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + log.Printf("[DEBUG] Sentinel version %s no longer exists", d.Id()) + d.SetId("") + return nil + } + return err + } + + d.Set("version", v.Version) + d.Set("url", v.URL) + d.Set("sha", v.SHA) + d.Set("official", v.Official) + d.Set("enabled", v.Enabled) + d.Set("beta", v.Beta) + d.Set("deprecated", v.Deprecated) + d.Set("deprecated_reason", v.DeprecatedReason) + + return nil +} + +func resourceTFESentinelVersionUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + opts := tfe.AdminSentinelVersionUpdateOptions{ + Version: tfe.String(d.Get("version").(string)), + URL: tfe.String(d.Get("url").(string)), + SHA: tfe.String(d.Get("sha").(string)), + Official: tfe.Bool(d.Get("official").(bool)), + Enabled: tfe.Bool(d.Get("enabled").(bool)), + Beta: tfe.Bool(d.Get("beta").(bool)), + Deprecated: tfe.Bool(d.Get("deprecated").(bool)), + DeprecatedReason: tfe.String(d.Get("deprecated_reason").(string)), + } + + log.Printf("[DEBUG] Update configuration of Sentinel version: %s", d.Id()) + v, err := config.Client.Admin.SentinelVersions.Update(ctx, d.Id(), opts) + if err != nil { + return fmt.Errorf("Error updating Sentinel version %s: %w", d.Id(), err) + } + + d.SetId(v.ID) + + return resourceTFESentinelVersionRead(d, meta) +} + +func resourceTFESentinelVersionDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(ConfiguredClient) + + log.Printf("[DEBUG] Delete Sentinel version: %s", d.Id()) + err := config.Client.Admin.SentinelVersions.Delete(ctx, d.Id()) + if err != nil { + if err == tfe.ErrResourceNotFound { + return nil + } + return fmt.Errorf("Error deleting Sentinel version %s: %w", d.Id(), err) + } + + return nil +} + +func resourceTFESentinelVersionImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(ConfiguredClient) + + // Splitting by '-' and checking if the first elem is equal to tool + // determines if the string is a tool version ID + s := strings.Split(d.Id(), "-") + if s[0] != "tool" { + versionID, err := fetchSentinelVersionID(d.Id(), config.Client) + if err != nil { + return nil, fmt.Errorf("error retrieving sentinel version %s: %w", d.Id(), err) + } + + d.SetId(versionID) + } + + return []*schema.ResourceData{d}, nil +} diff --git a/internal/provider/resource_tfe_sentinel_version_test.go b/internal/provider/resource_tfe_sentinel_version_test.go new file mode 100644 index 000000000..68e0ea81d --- /dev/null +++ b/internal/provider/resource_tfe_sentinel_version_test.go @@ -0,0 +1,271 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tfe + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "math/rand" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFESentinelVersion_basic(t *testing.T) { + skipIfCloud(t) + + sentinelVersion := &tfe.AdminSentinelVersion{} + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomSentinelVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFESentinelVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESentinelVersion_basic(version, sha), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFESentinelVersionExists("tfe_sentinel_version.foobar", sentinelVersion), + testAccCheckTFESentinelVersionAttributesBasic(sentinelVersion, version, sha), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "version", version), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "url", "https://www.hashicorp.com"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "sha", sha), + ), + }, + }, + }) +} + +func TestAccTFESentinelVersion_import(t *testing.T) { + skipIfCloud(t) + + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomSentinelVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFESentinelVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESentinelVersion_basic(version, sha), + }, + { + ResourceName: "tfe_sentinel_version.foobar", + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: "tfe_sentinel_version.foobar", + ImportState: true, + ImportStateId: version, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFESentinelVersion_full(t *testing.T) { + skipIfCloud(t) + + sentinelVersion := &tfe.AdminSentinelVersion{} + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomSentinelVersion() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFESentinelVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFESentinelVersion_full(version, sha), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFESentinelVersionExists("tfe_sentinel_version.foobar", sentinelVersion), + testAccCheckTFESentinelVersionAttributesFull(sentinelVersion, version, sha), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "version", version), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "url", "https://www.hashicorp.com"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "sha", sha), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "official", "false"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "enabled", "true"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "beta", "true"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "deprecated", "true"), + resource.TestCheckResourceAttr( + "tfe_sentinel_version.foobar", "deprecated_reason", "foobar"), + ), + }, + }, + }) +} + +func testAccCheckTFESentinelVersionDestroy(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_sentinel_version" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + _, err := config.Client.Admin.SentinelVersions.Read(ctx, rs.Primary.ID) + if err == nil { + return fmt.Errorf("Sentinel version %s still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckTFESentinelVersionExists(n string, sentinelVersion *tfe.AdminSentinelVersion) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + v, err := config.Client.Admin.SentinelVersions.Read(ctx, rs.Primary.ID) + if err != nil { + return err + } + + if v.ID != rs.Primary.ID { + return fmt.Errorf("Sentinel version not found") + } + + *sentinelVersion = *v + + return nil + } +} + +func testAccCheckTFESentinelVersionAttributesBasic(sentinelVersion *tfe.AdminSentinelVersion, version string, sha string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if sentinelVersion.URL != "https://www.hashicorp.com" { + return fmt.Errorf("Bad URL: %s", sentinelVersion.URL) + } + + if sentinelVersion.Version != version { + return fmt.Errorf("Bad version: %s", sentinelVersion.Version) + } + + if sentinelVersion.SHA != sha { + return fmt.Errorf("Bad value for Sha: %v", sentinelVersion.SHA) + } + + return nil + } +} + +func testAccCheckTFESentinelVersionAttributesFull(sentinelVersion *tfe.AdminSentinelVersion, version string, sha string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if sentinelVersion.URL != "https://www.hashicorp.com" { + return fmt.Errorf("Bad URL: %s", sentinelVersion.URL) + } + + if sentinelVersion.Version != version { + return fmt.Errorf("Bad version: %s", sentinelVersion.Version) + } + + if sentinelVersion.SHA != sha { + return fmt.Errorf("Bad value for Sha: %v", sentinelVersion.SHA) + } + + if sentinelVersion.Official != false { + return fmt.Errorf("Bad value for official: %t", sentinelVersion.Official) + } + + if sentinelVersion.Enabled != true { + return fmt.Errorf("Bad value for enabled: %t", sentinelVersion.Enabled) + } + + if sentinelVersion.Beta != true { + return fmt.Errorf("Bad value for beta: %t", sentinelVersion.Beta) + } + + if sentinelVersion.Deprecated != true { + return fmt.Errorf("Bad value for deprecated: %t", sentinelVersion.Deprecated) + } + + if *sentinelVersion.DeprecatedReason != "foobar" { + return fmt.Errorf("Bad value for deprecated_reason: %s", *sentinelVersion.DeprecatedReason) + } + + return nil + } +} + +func testAccTFESentinelVersion_basic(version string, sha string) string { + return fmt.Sprintf(` +resource "tfe_sentinel_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +}`, version, sha) +} + +func testAccTFESentinelVersion_full(version string, sha string) string { + return fmt.Sprintf(` +resource "tfe_sentinel_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" + official = false + enabled = true + beta = true + deprecated = true + deprecated_reason = "foobar" +}`, version, sha) +} + +// Helper functions +func genSentinelSha(t *testing.T, secret, data string) string { + h := hmac.New(sha256.New, []byte(secret)) + _, err := h.Write([]byte(data)) + if err != nil { + t.Fatalf("error writing hmac: %s", err) + } + + sha := hex.EncodeToString(h.Sum(nil)) + return sha +} + +// genSafeRandomSentinelVersion returns a random version number of the form +// `0.0.`, which TFC won't ever select as the latest available +// Sentinel. (At the time of writing, a fresh TFC instance will include +// official Sentinels 0.22.1 and higher.) This is necessary because newly created +// workspaces default to the latest available version, and there's nothing +// preventing unrelated processes from creating workspaces during these tests. +func genSafeRandomSentinelVersion() string { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + // Avoid colliding with an official Sentinel version. Highest was + // 0.24.0, so add a little padding and call it good. + for rInt < 20 { + rInt = rand.New(rand.NewSource(time.Now().UnixNano())).Int() + } + return fmt.Sprintf("0.0.%d", rInt) +} diff --git a/internal/provider/tool_helpers.go b/internal/provider/tool_helpers.go index 181a266ad..6c2e80b0b 100644 --- a/internal/provider/tool_helpers.go +++ b/internal/provider/tool_helpers.go @@ -51,3 +51,89 @@ func fetchTerraformVersionID(version string, client *tfe.Client) (string, error) return "", fmt.Errorf("terraform version not found") } + +// fetchSentinelVersionID returns a Sentinel Version ID for the given Sentinel version number +func fetchSentinelVersionID(version string, client *tfe.Client) (string, error) { + versions, err := client.Admin.SentinelVersions.List(ctx, &tfe.AdminSentinelVersionsListOptions{ + Filter: version, + }) + if err != nil { + return "", fmt.Errorf("error reading Sentinel versions: %w", err) + } + + // filter[version] returns 1 item or 0, if however + // the number of versions returned is greater than 1, + // we can assume the API doesn't support the filter[version] query param + // and so we'll use a fallback search mechanism + switch len(versions.Items) { + case 0: + return "", fmt.Errorf("sentinel version not found") + case 1: + return versions.Items[0].ID, nil + default: + options := &tfe.AdminSentinelVersionsListOptions{} + for { + for _, v := range versions.Items { + if v.Version == version { + return v.ID, nil + } + } + + if versions.CurrentPage >= versions.TotalPages { + break + } + + options.PageNumber = versions.NextPage + + versions, err = client.Admin.SentinelVersions.List(ctx, options) + if err != nil { + return "", fmt.Errorf("error reading Sentinel Versions: %w", err) + } + } + } + + return "", fmt.Errorf("sentinel version not found") +} + +// fetchOPAVersionID returns a OPA Version ID for the given OPA version number +func fetchOPAVersionID(version string, client *tfe.Client) (string, error) { + versions, err := client.Admin.OPAVersions.List(ctx, &tfe.AdminOPAVersionsListOptions{ + Filter: version, + }) + if err != nil { + return "", fmt.Errorf("error reading OPA versions: %w", err) + } + + // filter[version] returns 1 item or 0, if however + // the number of versions returned is greater than 1, + // we can assume the API doesn't support the filter[version] query param + // and so we'll use a fallback search mechanism + switch len(versions.Items) { + case 0: + return "", fmt.Errorf("OPA version not found") + case 1: + return versions.Items[0].ID, nil + default: + options := &tfe.AdminOPAVersionsListOptions{} + for { + for _, v := range versions.Items { + if v.Version == version { + return v.ID, nil + } + } + + if versions.CurrentPage >= versions.TotalPages { + break + } + + options.PageNumber = versions.NextPage + + versions, err = client.Admin.OPAVersions.List(ctx, options) + if err != nil { + return "", fmt.Errorf("error reading OPA Versions: %w", err) + } + } + } + + return "", fmt.Errorf("OPA version not found") +} From 077d686111754b66894e723b1f1136552d5e9f2a Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 4 Jan 2024 11:22:39 +1100 Subject: [PATCH 225/420] Add CHANGELOG and docs --- CHANGELOG.md | 2 + website/docs/r/opa_version.html.markdown | 53 +++++++++++++++++++ website/docs/r/sentinel_version.html.markdown | 53 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 website/docs/r/opa_version.html.markdown create mode 100644 website/docs/r/sentinel_version.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index e3390ada6..e23415247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) +* **New Resource**: `tfe_sentinel_version` ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* **New Resource**: `tfe_opa_version` ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) BUG FIXES: diff --git a/website/docs/r/opa_version.html.markdown b/website/docs/r/opa_version.html.markdown new file mode 100644 index 000000000..ee326673b --- /dev/null +++ b/website/docs/r/opa_version.html.markdown @@ -0,0 +1,53 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + +# tfe_sentinel_version + +Manage OPA versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```hcl +resource "tfe_opa_version" "test" { + version = "0.58.0-custom" + url = "https://tfe-host.com/path/to/opa" + sha = "e75ac73deb69a6b3aa667cb0b8b731aee79e2904" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `deprecated_reason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the OPA version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` diff --git a/website/docs/r/sentinel_version.html.markdown b/website/docs/r/sentinel_version.html.markdown new file mode 100644 index 000000000..01b8ef175 --- /dev/null +++ b/website/docs/r/sentinel_version.html.markdown @@ -0,0 +1,53 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```hcl +resource "tfe_sentinel_version" "test" { + version = "0.24.0-custom" + url = "https://tfe-host.com/path/to/sentinel.zip" + sha = "e75ac73deb69a6b3aa667cb0b8b731aee79e2904" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `deprecated_reason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` From 539a92282d2739162723620c3c7d009551344b8b Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 4 Jan 2024 11:38:29 +1100 Subject: [PATCH 226/420] rename to right package --- internal/provider/resource_tfe_opa_version.go | 2 +- internal/provider/resource_tfe_opa_version_test.go | 2 +- internal/provider/resource_tfe_sentinel_version.go | 2 +- internal/provider/resource_tfe_sentinel_version_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go index f70b8e1ca..062bb94c2 100644 --- a/internal/provider/resource_tfe_opa_version.go +++ b/internal/provider/resource_tfe_opa_version.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package tfe +package provider import ( "context" diff --git a/internal/provider/resource_tfe_opa_version_test.go b/internal/provider/resource_tfe_opa_version_test.go index 3a8b77d6c..e42bef6a6 100644 --- a/internal/provider/resource_tfe_opa_version_test.go +++ b/internal/provider/resource_tfe_opa_version_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package tfe +package provider import ( "crypto/hmac" diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go index da5ad2895..6fd135225 100644 --- a/internal/provider/resource_tfe_sentinel_version.go +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package tfe +package provider import ( "context" diff --git a/internal/provider/resource_tfe_sentinel_version_test.go b/internal/provider/resource_tfe_sentinel_version_test.go index 68e0ea81d..df1818f4e 100644 --- a/internal/provider/resource_tfe_sentinel_version_test.go +++ b/internal/provider/resource_tfe_sentinel_version_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package tfe +package provider import ( "crypto/hmac" From ee6d1b8fbb67844ac6874415e9222ca183244c76 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 4 Jan 2024 14:41:09 +1100 Subject: [PATCH 227/420] fix tests and add mocks --- internal/provider/client_mock_workspaces.go | 12 ++++++++++++ internal/provider/provider.go | 2 ++ internal/provider/resource_tfe_opa_version.go | 5 +++-- internal/provider/resource_tfe_sentinel_version.go | 5 +++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/internal/provider/client_mock_workspaces.go b/internal/provider/client_mock_workspaces.go index d7c01b859..b07b6afaf 100644 --- a/internal/provider/client_mock_workspaces.go +++ b/internal/provider/client_mock_workspaces.go @@ -21,6 +21,18 @@ type mockWorkspaces struct { workspaceNames map[workspaceNamesKey]*tfe.Workspace } +func (m *mockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*tfe.DataRetentionPolicy, error) { + panic("not implemented") +} + +func (m *mockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { + panic("not implemented") +} + +func (m *mockWorkspaces) DeleteDataRetentionPolicy(ctx context.Context, workspaceID string) error { + panic("not implemented") +} + // newMockWorkspaces creates a mock workspaces implementation. Any created // workspaces will have the id given in defaultWorkspaceID. func newMockWorkspaces(options testClientOptions) *mockWorkspaces { diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 3d5e87e0a..4bee0645f 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -141,6 +141,8 @@ func Provider() *schema.Provider { "tfe_team_members": resourceTFETeamMembers(), "tfe_team_token": resourceTFETeamToken(), "tfe_terraform_version": resourceTFETerraformVersion(), + "tfe_sentinel_version": resourceTFESentinelVersion(), + "tfe_opa_version": resourceTFEOPAVersion(), "tfe_workspace": resourceTFEWorkspace(), "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), "tfe_variable_set": resourceTFEVariableSet(), diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go index 062bb94c2..da9f774d6 100644 --- a/internal/provider/resource_tfe_opa_version.go +++ b/internal/provider/resource_tfe_opa_version.go @@ -5,6 +5,7 @@ package provider import ( "context" + "errors" "fmt" "log" "strings" @@ -96,7 +97,7 @@ func resourceTFEOPAVersionRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Read configuration of OPA version: %s", d.Id()) v, err := config.Client.Admin.OPAVersions.Read(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] OPA version %s no longer exists", d.Id()) d.SetId("") return nil @@ -147,7 +148,7 @@ func resourceTFEOPAVersionDelete(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Delete OPA version: %s", d.Id()) err := config.Client.Admin.OPAVersions.Delete(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { return nil } return fmt.Errorf("Error deleting OPA version %s: %w", d.Id(), err) diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go index 6fd135225..bbaf33f2d 100644 --- a/internal/provider/resource_tfe_sentinel_version.go +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -5,6 +5,7 @@ package provider import ( "context" + "errors" "fmt" "log" "strings" @@ -96,7 +97,7 @@ func resourceTFESentinelVersionRead(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Read configuration of Sentinel version: %s", d.Id()) v, err := config.Client.Admin.SentinelVersions.Read(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { log.Printf("[DEBUG] Sentinel version %s no longer exists", d.Id()) d.SetId("") return nil @@ -147,7 +148,7 @@ func resourceTFESentinelVersionDelete(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Delete Sentinel version: %s", d.Id()) err := config.Client.Admin.SentinelVersions.Delete(ctx, d.Id()) if err != nil { - if err == tfe.ErrResourceNotFound { + if errors.Is(err, tfe.ErrResourceNotFound) { return nil } return fmt.Errorf("Error deleting Sentinel version %s: %w", d.Id(), err) From 5a7efe75a713f5a016c4a624470fd122aa04cb76 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Fri, 5 Jan 2024 16:14:42 +1100 Subject: [PATCH 228/420] fix changelog + docs --- CHANGELOG.md | 4 ++-- website/docs/r/sentinel_version.html.markdown | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e23415247..ca4659ec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) -* **New Resource**: `tfe_sentinel_version` ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) -* **New Resource**: `tfe_opa_version` ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* **New Resource**: `r/tfe_sentinel_version` adds the ability for admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* **New Resource**: `r/tfe_opa_version` adds the ability for admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) BUG FIXES: diff --git a/website/docs/r/sentinel_version.html.markdown b/website/docs/r/sentinel_version.html.markdown index 01b8ef175..d1b669953 100644 --- a/website/docs/r/sentinel_version.html.markdown +++ b/website/docs/r/sentinel_version.html.markdown @@ -40,7 +40,7 @@ The following arguments are supported: ## Import -Sentinel versions can be imported; use `` or `` as the import ID. For example: +Sentinel versions can be imported; use `` or `` as the import ID. For example: ```shell terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr From 20c6aad9199063cb2f5ef7b3036c10f14e279117 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Tue, 9 Jan 2024 08:49:06 +1100 Subject: [PATCH 229/420] add entries alphabetically --- internal/provider/provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 4bee0645f..f9cd41ff8 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -115,6 +115,7 @@ func Provider() *schema.Provider { "tfe_agent_token": resourceTFEAgentToken(), "tfe_notification_configuration": resourceTFENotificationConfiguration(), "tfe_oauth_client": resourceTFEOAuthClient(), + "tfe_opa_version": resourceTFEOPAVersion(), "tfe_organization": resourceTFEOrganization(), "tfe_organization_default_settings": resourceTFEOrganizationDefaultSettings(), "tfe_organization_membership": resourceTFEOrganizationMembership(), @@ -131,6 +132,7 @@ func Provider() *schema.Provider { "tfe_no_code_module": resourceTFENoCodeModule(), "tfe_run_trigger": resourceTFERunTrigger(), "tfe_sentinel_policy": resourceTFESentinelPolicy(), + "tfe_sentinel_version": resourceTFESentinelVersion(), "tfe_ssh_key": resourceTFESSHKey(), "tfe_team": resourceTFETeam(), "tfe_team_access": resourceTFETeamAccess(), @@ -141,8 +143,6 @@ func Provider() *schema.Provider { "tfe_team_members": resourceTFETeamMembers(), "tfe_team_token": resourceTFETeamToken(), "tfe_terraform_version": resourceTFETerraformVersion(), - "tfe_sentinel_version": resourceTFESentinelVersion(), - "tfe_opa_version": resourceTFEOPAVersion(), "tfe_workspace": resourceTFEWorkspace(), "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), "tfe_variable_set": resourceTFEVariableSet(), From 630cda930ae21018cc4edefe2e25af6268d582a0 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Tue, 9 Jan 2024 14:40:42 +1100 Subject: [PATCH 230/420] add logs + formatting --- internal/provider/client_mock_workspaces.go | 12 ------------ internal/provider/resource_tfe_opa_version.go | 7 ++++--- internal/provider/resource_tfe_sentinel_version.go | 7 ++++--- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/internal/provider/client_mock_workspaces.go b/internal/provider/client_mock_workspaces.go index b07b6afaf..d7c01b859 100644 --- a/internal/provider/client_mock_workspaces.go +++ b/internal/provider/client_mock_workspaces.go @@ -21,18 +21,6 @@ type mockWorkspaces struct { workspaceNames map[workspaceNamesKey]*tfe.Workspace } -func (m *mockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*tfe.DataRetentionPolicy, error) { - panic("not implemented") -} - -func (m *mockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { - panic("not implemented") -} - -func (m *mockWorkspaces) DeleteDataRetentionPolicy(ctx context.Context, workspaceID string) error { - panic("not implemented") -} - // newMockWorkspaces creates a mock workspaces implementation. Any created // workspaces will have the id given in defaultWorkspaceID. func newMockWorkspaces(options testClientOptions) *mockWorkspaces { diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go index da9f774d6..450127b87 100644 --- a/internal/provider/resource_tfe_opa_version.go +++ b/internal/provider/resource_tfe_opa_version.go @@ -83,7 +83,7 @@ func resourceTFEOPAVersionCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Create new OPA version: %s", opts.Version) v, err := config.Client.Admin.OPAVersions.Create(ctx, opts) if err != nil { - return fmt.Errorf("Error creating the new OPA version %s: %w", opts.Version, err) + return fmt.Errorf("error creating the new OPA version %s: %w", opts.Version, err) } d.SetId(v.ID) @@ -134,7 +134,7 @@ func resourceTFEOPAVersionUpdate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Update configuration of OPA version: %s", d.Id()) v, err := config.Client.Admin.OPAVersions.Update(ctx, d.Id(), opts) if err != nil { - return fmt.Errorf("Error updating OPA version %s: %w", d.Id(), err) + return fmt.Errorf("error updating OPA version %s: %w", d.Id(), err) } d.SetId(v.ID) @@ -149,9 +149,10 @@ func resourceTFEOPAVersionDelete(d *schema.ResourceData, meta interface{}) error err := config.Client.Admin.OPAVersions.Delete(ctx, d.Id()) if err != nil { if errors.Is(err, tfe.ErrResourceNotFound) { + log.Printf("[DEBUG] OPA version: %s not found", d.Id()) return nil } - return fmt.Errorf("Error deleting OPA version %s: %w", d.Id(), err) + return fmt.Errorf("error deleting OPA version %s: %w", d.Id(), err) } return nil diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go index bbaf33f2d..7b78b2987 100644 --- a/internal/provider/resource_tfe_sentinel_version.go +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -83,7 +83,7 @@ func resourceTFESentinelVersionCreate(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Create new Sentinel version: %s", opts.Version) v, err := config.Client.Admin.SentinelVersions.Create(ctx, opts) if err != nil { - return fmt.Errorf("Error creating the new Sentinel version %s: %w", opts.Version, err) + return fmt.Errorf("error creating the new Sentinel version %s: %w", opts.Version, err) } d.SetId(v.ID) @@ -134,7 +134,7 @@ func resourceTFESentinelVersionUpdate(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Update configuration of Sentinel version: %s", d.Id()) v, err := config.Client.Admin.SentinelVersions.Update(ctx, d.Id(), opts) if err != nil { - return fmt.Errorf("Error updating Sentinel version %s: %w", d.Id(), err) + return fmt.Errorf("error updating Sentinel version %s: %w", d.Id(), err) } d.SetId(v.ID) @@ -149,9 +149,10 @@ func resourceTFESentinelVersionDelete(d *schema.ResourceData, meta interface{}) err := config.Client.Admin.SentinelVersions.Delete(ctx, d.Id()) if err != nil { if errors.Is(err, tfe.ErrResourceNotFound) { + log.Printf("[DEBUG] Sentinel version: %s not found", d.Id()) return nil } - return fmt.Errorf("Error deleting Sentinel version %s: %w", d.Id(), err) + return fmt.Errorf("error deleting Sentinel version %s: %w", d.Id(), err) } return nil From 6467b5744a301d839e711fc5fa197ff2900b91cc Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Mon, 15 Jan 2024 14:51:12 +1100 Subject: [PATCH 231/420] fix resource + docs --- internal/provider/resource_tfe_opa_version.go | 2 +- internal/provider/resource_tfe_sentinel_version.go | 2 +- website/docs/r/opa_version.html.markdown | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go index 450127b87..b752b2955 100644 --- a/internal/provider/resource_tfe_opa_version.go +++ b/internal/provider/resource_tfe_opa_version.go @@ -88,7 +88,7 @@ func resourceTFEOPAVersionCreate(d *schema.ResourceData, meta interface{}) error d.SetId(v.ID) - return resourceTFEOPAVersionUpdate(d, meta) + return resourceTFEOPAVersionRead(d, meta) } func resourceTFEOPAVersionRead(d *schema.ResourceData, meta interface{}) error { diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go index 7b78b2987..1740cf26b 100644 --- a/internal/provider/resource_tfe_sentinel_version.go +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -88,7 +88,7 @@ func resourceTFESentinelVersionCreate(d *schema.ResourceData, meta interface{}) d.SetId(v.ID) - return resourceTFESentinelVersionUpdate(d, meta) + return resourceTFESentinelVersionRead(d, meta) } func resourceTFESentinelVersionRead(d *schema.ResourceData, meta interface{}) error { diff --git a/website/docs/r/opa_version.html.markdown b/website/docs/r/opa_version.html.markdown index ee326673b..8c8503021 100644 --- a/website/docs/r/opa_version.html.markdown +++ b/website/docs/r/opa_version.html.markdown @@ -5,9 +5,9 @@ description: |- Manages OPA versions --- -# tfe_sentinel_version +# tfe_opa_version -Manage OPA versions available on Terraform Cloud/Enterprise. +Manage OPA versions available on Terraform Enterprise. ## Example Usage @@ -40,7 +40,7 @@ The following arguments are supported: ## Import -Sentinel versions can be imported; use `` or `` as the import ID. For example: +OPA versions can be imported; use `` or `` as the import ID. For example: ```shell terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr From afb5cc2639294195d9b6f513c98f920529f76042 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Wed, 17 Jan 2024 09:43:53 +1100 Subject: [PATCH 232/420] minor fix as per feedback --- internal/provider/resource_tfe_opa_version.go | 6 +++--- internal/provider/resource_tfe_sentinel_version.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/provider/resource_tfe_opa_version.go b/internal/provider/resource_tfe_opa_version.go index b752b2955..61036f8b4 100644 --- a/internal/provider/resource_tfe_opa_version.go +++ b/internal/provider/resource_tfe_opa_version.go @@ -70,9 +70,9 @@ func resourceTFEOPAVersionCreate(d *schema.ResourceData, meta interface{}) error config := meta.(ConfiguredClient) opts := tfe.AdminOPAVersionCreateOptions{ - Version: *tfe.String(d.Get("version").(string)), - URL: *tfe.String(d.Get("url").(string)), - SHA: *tfe.String(d.Get("sha").(string)), + Version: d.Get("version").(string), + URL: d.Get("url").(string), + SHA: d.Get("sha").(string), Official: tfe.Bool(d.Get("official").(bool)), Enabled: tfe.Bool(d.Get("enabled").(bool)), Beta: tfe.Bool(d.Get("beta").(bool)), diff --git a/internal/provider/resource_tfe_sentinel_version.go b/internal/provider/resource_tfe_sentinel_version.go index 1740cf26b..25806cae4 100644 --- a/internal/provider/resource_tfe_sentinel_version.go +++ b/internal/provider/resource_tfe_sentinel_version.go @@ -70,9 +70,9 @@ func resourceTFESentinelVersionCreate(d *schema.ResourceData, meta interface{}) config := meta.(ConfiguredClient) opts := tfe.AdminSentinelVersionCreateOptions{ - Version: *tfe.String(d.Get("version").(string)), - URL: *tfe.String(d.Get("url").(string)), - SHA: *tfe.String(d.Get("sha").(string)), + Version: d.Get("version").(string), + URL: d.Get("url").(string), + SHA: d.Get("sha").(string), Official: tfe.Bool(d.Get("official").(bool)), Enabled: tfe.Bool(d.Get("enabled").(bool)), Beta: tfe.Bool(d.Get("beta").(bool)), From 3aa177b0beca8e29a210697ef1bea9adfe2db9a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:03:02 -0600 Subject: [PATCH 233/420] Build(deps): Bump hashicorp/ghaction-terraform-provider-release (#1222) Bumps [hashicorp/ghaction-terraform-provider-release](https://github.com/hashicorp/ghaction-terraform-provider-release) from 2 to 3. - [Release notes](https://github.com/hashicorp/ghaction-terraform-provider-release/releases) - [Changelog](https://github.com/hashicorp/ghaction-terraform-provider-release/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/ghaction-terraform-provider-release/compare/v2...v3) --- updated-dependencies: - dependency-name: hashicorp/ghaction-terraform-provider-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8045dd97c..012a4da61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: terraform-provider-release: name: 'Terraform Provider Release' needs: [release-notes] - uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v2 + uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v3 secrets: hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}' hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}' From c5fb3eb2f5fefa5d51ad6c564f79ecb5f6273136 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:04:02 -0600 Subject: [PATCH 234/420] Build(deps): Bump actions/upload-artifact from 4.1.0 to 4.2.0 (#1221) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/1eb3cb2b3e0f29609092a73eb033bb759a334595...694cdabd8bdb0f10b2cea11669e1bf5453eed0a6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f4cf8fe4..8a8f3d901 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index c99fe59b4..4fd92e1bf 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 012a4da61..ad69d95ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: release-notes path: release-notes.txt From 162a6454ac718a1d8e7d8cd460d2db8681b53911 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 22 Jan 2024 17:13:43 -0700 Subject: [PATCH 235/420] Update README (#1195) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66e9d8c7e..62f1af9ab 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.51.1" } } } @@ -45,7 +45,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.50.0" + version = "~> 0.51.1" ... } ``` From 3baa85b6d26e4691d1e5762bbf4cd655640529e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 08:12:23 -0600 Subject: [PATCH 236/420] Build(deps): Bump actions/upload-artifact from 4.2.0 to 4.3.0 (#1225) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/694cdabd8bdb0f10b2cea11669e1bf5453eed0a6...26f96dfa697d77e81fd5907df203aa23a56210a8) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a8f3d901..2c3b40aeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 4fd92e1bf..fc6fcce0e 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad69d95ed..25530c534 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 + - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: release-notes path: release-notes.txt From eec33172acf869aa3e13601fbd1e1c5f99eca698 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 08:12:53 -0600 Subject: [PATCH 237/420] Build(deps): Bump github.com/zclconf/go-cty from 1.14.1 to 1.14.2 (#1227) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.14.1 to 1.14.2. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.14.1...v1.14.2) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 69f0b6c75..63adfbc22 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/zclconf/go-cty v1.14.1 + github.com/zclconf/go-cty v1.14.2 golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect diff --git a/go.sum b/go.sum index 4d682b736..eb7a7ee18 100644 --- a/go.sum +++ b/go.sum @@ -170,8 +170,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= -github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= +github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= From 2ec58e0166d22b4a293175a631ca2d7dd3d686ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 08:37:22 -0600 Subject: [PATCH 238/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.42.0 to 1.43.0 (#1226) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.42.0 to 1.43.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.42.0...v1.43.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 63adfbc22..3b8e1f4bd 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.3 - github.com/hashicorp/go-tfe v1.42.0 + github.com/hashicorp/go-tfe v1.43.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index eb7a7ee18..f76a56cf0 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.3 h1:JiYNpOkD0HmMWw/lNYiBAUD6+WIBIV7UftKiqIbpNqM= github.com/hashicorp/go-slug v0.13.3/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= -github.com/hashicorp/go-tfe v1.42.0 h1:CSE7L13Rpa3+/kxfwpd/LIsi88p//SNbDFgCTyOvBco= -github.com/hashicorp/go-tfe v1.42.0/go.mod h1:WQJeUJH6hyz0xaQyRDEg6eKU4z08eRLKAoDbmBvTdE4= +github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBIC0= +github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 0e6d2583f9f5942ad6189d94955673ac009c459a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:37:15 +0000 Subject: [PATCH 239/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-go Bumps [github.com/hashicorp/terraform-plugin-go](https://github.com/hashicorp/terraform-plugin-go) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-go/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-go/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 3b8e1f4bd..ef0620171 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.20.0 + github.com/hashicorp/terraform-plugin-go v0.21.0 github.com/hashicorp/terraform-plugin-mux v0.13.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 github.com/hashicorp/terraform-svchost v0.1.1 @@ -27,11 +27,11 @@ require ( github.com/zclconf/go-cty v1.14.2 golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect ) require ( @@ -56,7 +56,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.61.0 // indirect ) require ( @@ -77,7 +77,7 @@ require ( github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/sync v0.6.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f76a56cf0..5f173f6e8 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgs github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= -github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= +github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= +github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= @@ -194,8 +194,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -254,14 +254,14 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 34be2daee4fade63cdd4723f9c416ac568bba43f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 09:33:44 -0600 Subject: [PATCH 240/420] Build(deps): Bump slackapi/slack-github-action from 1.24.0 to 1.25.0 (#1230) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/e28cf165c92ffef168d23c5c9000cffc8a25e117...6c661ce58804a1a20f6dc5fbee7f0381b469e001) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/nightly-tfe-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 22ebb402b..f4db5b344 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 with: payload: | { From f16047a2919b8975771df0f1d59e057be94ea3d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 09:50:50 -0600 Subject: [PATCH 241/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#1233) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.31.0 to 2.32.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.31.0...v2.32.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index ef0620171..a636af5ba 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,12 @@ require ( github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.21.0 github.com/hashicorp/terraform-plugin-mux v0.13.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.2 - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.18.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.16.0 // indirect @@ -45,8 +45,8 @@ require ( github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/jsonapi v1.2.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.19.0 // indirect - github.com/hashicorp/terraform-json v0.18.0 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index 5f173f6e8..bb72f877b 100644 --- a/go.sum +++ b/go.sum @@ -88,10 +88,10 @@ github.com/hashicorp/jsonapi v1.2.0 h1:ezDCzOFsKTL+KxVQuA1rNxkIGTvZph1rNu8kT5A8t github.com/hashicorp/jsonapi v1.2.0/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= -github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= -github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= -github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= @@ -102,8 +102,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 h1:Bl3e2ei2j/Z3Hc2HIS15Gal2KMKyLAZ2om1HCEvK6es= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0/go.mod h1:i2C41tszDjiWfziPQDL5R/f3Zp0gahXe5No/MIO9rCE= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -177,8 +177,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= From b32ab0db2334c3901016bd23d75fc6f5577ab4e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:06:41 -0600 Subject: [PATCH 242/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-mux (#1232) Bumps [github.com/hashicorp/terraform-plugin-mux](https://github.com/hashicorp/terraform-plugin-mux) from 0.13.0 to 0.14.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-mux/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-mux/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-mux/compare/v0.13.0...v0.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-mux dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a636af5ba..2b80655ee 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.21.0 - github.com/hashicorp/terraform-plugin-mux v0.13.0 + github.com/hashicorp/terraform-plugin-mux v0.14.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.19 // indirect diff --git a/go.sum b/go.sum index bb72f877b..681094640 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= -github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= +github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= +github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= From 0274c511767bb71175cfa56acef49cd3cbb7efef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:31:04 -0600 Subject: [PATCH 243/420] Build(deps): Bump github.com/hashicorp/go-slug from 0.13.3 to 0.13.4 (#1236) Bumps [github.com/hashicorp/go-slug](https://github.com/hashicorp/go-slug) from 0.13.3 to 0.13.4. - [Release notes](https://github.com/hashicorp/go-slug/releases) - [Commits](https://github.com/hashicorp/go-slug/compare/v0.13.3...v0.13.4) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-slug dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2b80655ee..5ab73a630 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect - github.com/hashicorp/go-slug v0.13.3 + github.com/hashicorp/go-slug v0.13.4 github.com/hashicorp/go-tfe v1.43.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 diff --git a/go.sum b/go.sum index 681094640..696d3db60 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDm github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.13.3 h1:JiYNpOkD0HmMWw/lNYiBAUD6+WIBIV7UftKiqIbpNqM= -github.com/hashicorp/go-slug v0.13.3/go.mod h1:RA4C+ezyC2nDsiPM5+1djqagveBBJdSN/fM2QCUziYQ= +github.com/hashicorp/go-slug v0.13.4 h1:dIyjGKFVwbOVAqp0/s7tmONwCNr9D2UvmMuVE4mPfv0= +github.com/hashicorp/go-slug v0.13.4/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBIC0= github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From d25ceaa9151d3b7c210429f85aa59abfa29704ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:48:06 -0600 Subject: [PATCH 244/420] Build(deps): Bump peter-evans/create-pull-request from 5.0.2 to 6.0.0 (#1235) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.2 to 6.0.0. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/153407881ec5c347639a548ade7d8ad1d6740e38...b1ddad2c994a25fbc81a28b3ec0e368bb2021c50) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index fc6fcce0e..fd1813c88 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -102,7 +102,7 @@ jobs: TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins - name: Create Pull Request - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 with: commit-message: "cdktf: update documentation" title: "release: ${{ github.event.inputs.version }}" From ae27874cacfed051427be16685c98fc1b3b6ecc2 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Wed, 31 Jan 2024 14:30:21 +1100 Subject: [PATCH 245/420] policy_set data and resource change to include attributes from PPRV --- go.mod | 2 +- go.sum | 2 + internal/provider/data_source_policy_set.go | 17 +++ .../provider/data_source_policy_set_test.go | 140 +++++++++++++++++- internal/provider/resource_tfe_policy_set.go | 36 ++++- .../provider/resource_tfe_policy_set_test.go | 116 +++++++++++++-- 6 files changed, 296 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 5ab73a630..9138b3208 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.4 - github.com/hashicorp/go-tfe v1.43.0 + github.com/hashicorp/go-tfe v1.44.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index 696d3db60..2b742b91f 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/hashicorp/go-slug v0.13.4 h1:dIyjGKFVwbOVAqp0/s7tmONwCNr9D2UvmMuVE4mP github.com/hashicorp/go-slug v0.13.4/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBIC0= github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= +github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba h1:5ghRIwO76fM7XsNwONGlw/xE+XO9uU3yyTUE36JX/nM= +github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= diff --git a/internal/provider/data_source_policy_set.go b/internal/provider/data_source_policy_set.go index 5e5bb2ead..91b22ba91 100644 --- a/internal/provider/data_source_policy_set.go +++ b/internal/provider/data_source_policy_set.go @@ -53,6 +53,18 @@ func dataSourceTFEPolicySet() *schema.Resource { Optional: true, }, + "agent_enabled": { + Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", + Type: schema.TypeBool, + Optional: true, + }, + + "policy_tool_version": { + Description: "The policy tool version to run the policy evaluation against", + Type: schema.TypeString, + Optional: true, + }, + "policies_path": { Type: schema.TypeString, Computed: true, @@ -146,6 +158,7 @@ func dataSourceTFEPolicySetRead(d *schema.ResourceData, meta interface{}) error d.Set("description", policySet.Description) d.Set("global", policySet.Global) d.Set("policies_path", policySet.PoliciesPath) + d.Set("agent_enabled", policySet.AgentEnabled) if policySet.Kind != "" { d.Set("kind", policySet.Kind) @@ -155,6 +168,10 @@ func dataSourceTFEPolicySetRead(d *schema.ResourceData, meta interface{}) error d.Set("overridable", policySet.Overridable) } + if policySet.PolicyToolVersion != "" { + d.Set("policy_tool_version", policySet.PolicyToolVersion) + } + var vcsRepo []interface{} if policySet.VCSRepo != nil { vcsRepo = append(vcsRepo, map[string]interface{}{ diff --git a/internal/provider/data_source_policy_set_test.go b/internal/provider/data_source_policy_set_test.go index 2985204e7..32ce23936 100644 --- a/internal/provider/data_source_policy_set_test.go +++ b/internal/provider/data_source_policy_set_test.go @@ -43,6 +43,61 @@ func TestAccTFEPolicySetDataSource_basic(t *testing.T) { "data.tfe_policy_set.bar", "organization", org.Name), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "policy_ids.#", "1"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "agent_enabled", "false"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "workspace_ids.#", "1"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "excluded_workspace_ids.#", "1"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "project_ids.#", "1"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "vcs_repo.#", "0"), + ), + }, + }, + }, + ) +} + +func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { + skipUnlessBeta(t) + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomSentinelVersion() + + org, orgCleanup := createBusinessOrganization(t, tfeClient) + t.Cleanup(orgCleanup) + + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + CheckDestroy: testAccCheckTFESentinelVersionDestroy, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(org.Name, rInt, version, sha), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tfe_policy_set.bar", "id"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "name", fmt.Sprintf("tst-policy-set-%d", rInt)), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "description", "Policy Set"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "global", "false"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "organization", org.Name), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "policy_ids.#", "1"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "agent_enabled", "true"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "policy_tool_version", version), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "workspace_ids.#", "1"), resource.TestCheckResourceAttr( @@ -65,17 +120,21 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) { t.Fatal(err) } + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomOPAVersion() + org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + CheckDestroy: testAccCheckTFEOPAVersionDestroy, + Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySetDataSourceConfigOPA_basic(org.Name, rInt), + Config: testAccTFEPolicySetDataSourceConfigOPA_basic(org.Name, rInt, version, sha), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("data.tfe_policy_set.bar", "id"), resource.TestCheckResourceAttr( @@ -88,6 +147,8 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) { "data.tfe_policy_set.bar", "organization", org.Name), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "kind", "opa"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "agent_enabled", "true"), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "overridable", "true"), resource.TestCheckResourceAttr( @@ -147,6 +208,8 @@ func TestAccTFEPolicySetDataSource_vcs(t *testing.T) { "data.tfe_policy_set.bar", "global", "false"), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "kind", "sentinel"), + resource.TestCheckResourceAttr( + "data.tfe_policy_set.bar", "agent_enabled", "false"), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "organization", org.Name), resource.TestCheckResourceAttr( @@ -225,15 +288,79 @@ resource "tfe_workspace_policy_set_exclusion" "foobar" { data "tfe_policy_set" "bar" { name = tfe_policy_set.foobar.name organization = local.organization_name + depends_on=[tfe_policy_set.foobar, tfe_project_policy_set.foobar, tfe_workspace_policy_set_exclusion.foobar] }`, organization, rInt, rInt, rInt) } -func testAccTFEPolicySetDataSourceConfigOPA_basic(organization string, rInt int) string { +func testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(organization string, rInt int, version string, sha string) string { return fmt.Sprintf(` locals { organization_name = "%s" } + +resource "tfe_sentinel_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-foo-%d" + organization = local.organization_name +} + +resource "tfe_project" "foobar" { + name = "project-foo-%d" + organization = local.organization_name +} + +resource "tfe_sentinel_policy" "foo" { + name = "policy-foo" + policy = "main = rule { true }" + organization = local.organization_name +} + +resource "tfe_policy_set" "foobar" { + name = "tst-policy-set-%d" + description = "Policy Set" + organization = local.organization_name + agent_enabled = true + policy_tool_version = "%s" + policy_ids = [tfe_sentinel_policy.foo.id] + workspace_ids = [tfe_workspace.foobar.id] +} + +resource "tfe_project_policy_set" "foobar" { + policy_set_id = tfe_policy_set.foobar.id + project_id = tfe_project.foobar.id +} + +resource "tfe_workspace_policy_set_exclusion" "foobar" { + policy_set_id = tfe_policy_set.foobar.id + workspace_id = tfe_workspace.foobar.id +} + +data "tfe_policy_set" "bar" { + name = tfe_policy_set.foobar.name + organization = local.organization_name + depends_on=[tfe_policy_set.foobar, tfe_project_policy_set.foobar, tfe_workspace_policy_set_exclusion.foobar] +}`, organization, version, sha, rInt, rInt, rInt, version) +} + +func testAccTFEPolicySetDataSourceConfigOPA_basic(organization string, rInt int, version string, sha string) string { + return fmt.Sprintf(` +locals { + organization_name = "%s" +} + + +resource "tfe_opa_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +} + resource "tfe_workspace" "foobar" { name = "workspace-foo-%d" organization = local.organization_name @@ -249,6 +376,8 @@ resource "tfe_policy_set" "foobar" { description = "Policy Set" organization = local.organization_name kind = "opa" + agent_enabled = true + policy_tool_version = "%s" overridable = true workspace_ids = [tfe_workspace.foobar.id] } @@ -267,7 +396,8 @@ data "tfe_policy_set" "bar" { name = tfe_policy_set.foobar.name organization = local.organization_name kind = "opa" -}`, organization, rInt, rInt, rInt) + depends_on=[tfe_policy_set.foobar, tfe_project_policy_set.foobar, tfe_workspace_policy_set_exclusion.foobar] +}`, organization, version, sha, rInt, rInt, rInt, version) } func testAccTFEPolicySetDataSourceConfig_vcs(organization string, rInt int) string { diff --git a/internal/provider/resource_tfe_policy_set.go b/internal/provider/resource_tfe_policy_set.go index 658d9cf30..b9418faab 100644 --- a/internal/provider/resource_tfe_policy_set.go +++ b/internal/provider/resource_tfe_policy_set.go @@ -75,6 +75,18 @@ func resourceTFEPolicySet() *schema.Resource { Default: false, }, + "agent_enabled": { + Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", + Type: schema.TypeBool, + Optional: true, + }, + + "policy_tool_version": { + Description: "The policy tool version to run the policy evaluation against", + Type: schema.TypeString, + Optional: true, + }, + "policies_path": { Type: schema.TypeString, Optional: true, @@ -171,6 +183,14 @@ func resourceTFEPolicySetCreate(d *schema.ResourceData, meta interface{}) error options.Overridable = tfe.Bool(vOverridable.(bool)) } + if vAgentEnabled, ok := d.GetOk("agent_enabled"); ok { + options.AgentEnabled = tfe.Bool(vAgentEnabled.(bool)) + } + + if vPolicyToolVersion, ok := d.GetOk("policy_tool_version"); ok { + options.PolicyToolVersion = tfe.String(vPolicyToolVersion.(string)) + } + if desc, ok := d.GetOk("description"); ok { options.Description = tfe.String(desc.(string)) } @@ -243,6 +263,7 @@ func resourceTFEPolicySetRead(d *schema.ResourceData, meta interface{}) error { d.Set("description", policySet.Description) d.Set("global", policySet.Global) d.Set("policies_path", policySet.PoliciesPath) + d.Set("agent_enabled", policySet.AgentEnabled) if policySet.Organization != nil { d.Set("organization", policySet.Organization.Name) @@ -257,6 +278,10 @@ func resourceTFEPolicySetRead(d *schema.ResourceData, meta interface{}) error { d.Set("overridable", policySet.Overridable) } + if policySet.PolicyToolVersion != "" { + d.Set("policy_tool_version", policySet.PolicyToolVersion) + } + // Set VCS policy set options. var vcsRepo []interface{} if policySet.VCSRepo != nil { @@ -330,7 +355,7 @@ func resourceTFEPolicySetUpdate(d *schema.ResourceData, meta interface{}) error } // Don't bother updating the policy set's attributes if they haven't changed - if d.HasChange("name") || d.HasChange("description") || d.HasChange("global") || d.HasChange("vcs_repo") || d.HasChange("overridable") { + if d.HasChange("name") || d.HasChange("description") || d.HasChange("global") || d.HasChange("vcs_repo") || d.HasChange("overridable") || d.HasChange("agent_enabled") || d.HasChange("policy_tool_version") { // Create a new options struct. options := tfe.PolicySetUpdateOptions{ Name: tfe.String(name), @@ -346,6 +371,15 @@ func resourceTFEPolicySetUpdate(d *schema.ResourceData, meta interface{}) error options.Overridable = tfe.Bool(o) } + if d.HasChange("agent_enabled") { + o := d.Get("agent_enabled").(bool) + options.AgentEnabled = tfe.Bool(o) + } + + if policyToolVersion, ok := d.GetOk("policy_tool_version"); ok { + options.PolicyToolVersion = tfe.String(policyToolVersion.(string)) + } + if v, ok := d.GetOk("vcs_repo"); ok { vcsRepo := v.([]interface{})[0].(map[string]interface{}) diff --git a/internal/provider/resource_tfe_policy_set_test.go b/internal/provider/resource_tfe_policy_set_test.go index 47583891b..9f26b0bd6 100644 --- a/internal/provider/resource_tfe_policy_set_test.go +++ b/internal/provider/resource_tfe_policy_set_test.go @@ -41,6 +41,50 @@ func TestAccTFEPolicySet_basic(t *testing.T) { "tfe_policy_set.foobar", "description", "Policy Set"), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "agent_enabled", "false"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "policy_ids.#", "1"), + ), + }, + }, + }) +} + +func TestAccTFEPolicySet_pinnedPolicyRuntimeVersion(t *testing.T) { + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomSentinelVersion() + + org, orgCleanup := createBusinessOrganization(t, tfeClient) + t.Cleanup(orgCleanup) + + policySet := &tfe.PolicySet{} + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEPolicySetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEPolicySet_pinnedPolicyRuntimeVersion(org.Name, version, sha), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEPolicySetExists("tfe_policy_set.foobar", policySet), + testAccCheckTFEPolicySetAttributes(policySet), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "name", "tst-terraform"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "description", "Policy Set"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "global", "false"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "agent_enabled", "true"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "policy_tool_version", version), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "policy_ids.#", "1"), ), @@ -50,12 +94,14 @@ func TestAccTFEPolicySet_basic(t *testing.T) { } func TestAccTFEPolicySetOPA_basic(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) } + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomOPAVersion() + org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) @@ -67,7 +113,7 @@ func TestAccTFEPolicySetOPA_basic(t *testing.T) { CheckDestroy: testAccCheckTFEPolicySetDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySetOPA_basic(org.Name), + Config: testAccTFEPolicySetOPA_basic(org.Name, version, sha), Check: resource.ComposeTestCheckFunc( testAccCheckTFEPolicySetExists("tfe_policy_set.foobar", policySet), testAccCheckTFEPolicySetAttributes(policySet), @@ -76,7 +122,11 @@ func TestAccTFEPolicySetOPA_basic(t *testing.T) { resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "kind", "opa"), resource.TestCheckResourceAttr( - "tfe_policy_set.foobar", "overridable", "false"), + "tfe_policy_set.foobar", "overridable", "true"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "agent_enabled", "true"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "policy_tool_version", version), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "description", "Policy Set"), resource.TestCheckResourceAttr( @@ -88,11 +138,12 @@ func TestAccTFEPolicySetOPA_basic(t *testing.T) { } func TestAccTFEPolicySet_updateOverridable(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) } + sha := genSentinelSha(t, "secret", "data") + version := genSafeRandomOPAVersion() org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) @@ -105,7 +156,7 @@ func TestAccTFEPolicySet_updateOverridable(t *testing.T) { CheckDestroy: testAccCheckTFEPolicySetDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySetOPA_basic(org.Name), + Config: testAccTFEPolicySetOPA_basic(org.Name, version, sha), Check: resource.ComposeTestCheckFunc( testAccCheckTFEPolicySetExists("tfe_policy_set.foobar", policySet), testAccCheckTFEPolicySetAttributes(policySet), @@ -115,6 +166,8 @@ func TestAccTFEPolicySet_updateOverridable(t *testing.T) { "tfe_policy_set.foobar", "description", "Policy Set"), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "kind", "opa"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "agent_enabled", "true"), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "global", "false"), resource.TestCheckResourceAttr( @@ -123,7 +176,7 @@ func TestAccTFEPolicySet_updateOverridable(t *testing.T) { }, { - Config: testAccTFEPolicySetOPA_overridable(org.Name), + Config: testAccTFEPolicySetOPA_overridable(org.Name, version, sha), Check: resource.ComposeTestCheckFunc( testAccCheckTFEPolicySetExists("tfe_policy_set.foobar", policySet), resource.TestCheckResourceAttr( @@ -132,6 +185,8 @@ func TestAccTFEPolicySet_updateOverridable(t *testing.T) { "tfe_policy_set.foobar", "global", "false"), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "kind", "opa"), + resource.TestCheckResourceAttr( + "tfe_policy_set.foobar", "agent_enabled", "true"), resource.TestCheckResourceAttr( "tfe_policy_set.foobar", "workspace_ids.#", "1"), resource.TestCheckResourceAttr( @@ -979,15 +1034,48 @@ resource "tfe_policy_set" "foobar" { }`, organization, organization) } -func testAccTFEPolicySetOPA_basic(organization string) string { +func testAccTFEPolicySet_pinnedPolicyRuntimeVersion(organization string, version string, sha string) string { return fmt.Sprintf(` +resource "tfe_sentinel_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +} + +resource "tfe_sentinel_policy" "foo" { + name = "policy-foo" + policy = "main = rule { true }" + organization = "%s" +} + +resource "tfe_policy_set" "foobar" { + name = "tst-terraform" + description = "Policy Set" + organization = "%s" + agent_enabled = true + policy_tool_version = "%s" + policy_ids = [tfe_sentinel_policy.foo.id] +}`, version, sha, organization, organization, version) +} + +func testAccTFEPolicySetOPA_basic(organization string, version string, sha string) string { + return fmt.Sprintf(` +resource "tfe_opa_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +} + resource "tfe_policy_set" "foobar" { name = "tst-terraform" description = "Policy Set" organization = "%s" kind = "opa" overridable = "true" -}`, organization) + agent_enabled = "true" + policy_tool_version = "%s" + depends_on = [tfe_opa_version.foobar] +}`, version, sha, organization, version) } func testAccTFEPolicySet_empty(organization string) string { @@ -1024,12 +1112,18 @@ resource "tfe_policy_set" "foobar" { }`, organization) } -func testAccTFEPolicySetOPA_overridable(organization string) string { +func testAccTFEPolicySetOPA_overridable(organization string, version string, sha string) string { return fmt.Sprintf(` locals { organization_name = "%s" } +resource "tfe_opa_version" "foobar" { + version = "%s" + url = "https://www.hashicorp.com" + sha = "%s" +} + resource "tfe_workspace" "foo" { name = "workspace-foo" organization = local.organization_name @@ -1040,8 +1134,10 @@ resource "tfe_policy_set" "foobar" { organization = local.organization_name workspace_ids = [tfe_workspace.foo.id] overridable = "false" + agent_enabled = "true" + policy_tool_version = "%s" kind = "opa" -}`, organization) +}`, organization, version, sha, version) } func testAccTFEPolicySet_updatePopulated(organization string) string { From 0cfda51ad6a3c71786c2cba16e7dec3a969dac75 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Wed, 31 Jan 2024 14:52:05 +1100 Subject: [PATCH 246/420] add CHANGELOG and update doc --- CHANGELOG.md | 2 ++ website/docs/d/policy_set.html.markdown | 2 ++ website/docs/r/policy_set.html.markdown | 31 +++++++++++++++---------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca4659ec5..59d74c65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ FEATURES: * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Resource**: `r/tfe_sentinel_version` adds the ability for admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * **New Resource**: `r/tfe_opa_version` adds the ability for admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* `r/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to allow setting a policy runtime version to the policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) +* `d/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to get the policy runtime version of a policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) BUG FIXES: diff --git a/website/docs/d/policy_set.html.markdown b/website/docs/d/policy_set.html.markdown index fe614630f..141a6b472 100644 --- a/website/docs/d/policy_set.html.markdown +++ b/website/docs/d/policy_set.html.markdown @@ -35,6 +35,8 @@ The following arguments are supported: * `description` - Description of the policy set. * `global` - Whether or not the policy set applies to all workspaces in the organization. * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `agent_enabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `policy_tool_version` - The policy tool version to run the evaluation against. * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspace_ids` - IDs of the workspaces that use the policy set. * `excluded_workspace_ids` - IDs of the workspaces that do not use the policy set. diff --git a/website/docs/r/policy_set.html.markdown b/website/docs/r/policy_set.html.markdown index a5a252e02..c27881951 100644 --- a/website/docs/r/policy_set.html.markdown +++ b/website/docs/r/policy_set.html.markdown @@ -21,12 +21,14 @@ Basic usage (VCS-based policy set): ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] vcs_repo { identifier = "my-org-name/my-policy-set-repository" @@ -41,12 +43,14 @@ Using manually-specified policies: ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } ``` @@ -81,6 +85,9 @@ The following arguments are supported: * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. +* `agent_enabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `policy_tool_version` - (Optional) The policy tool version to run the evaluation against. * `overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. From 58fb5a040625c10e1fb807460f1b72b1de8405dc Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 1 Feb 2024 08:58:04 +1100 Subject: [PATCH 247/420] minor changes as per feedback --- go.mod | 2 +- go.sum | 4 ++++ internal/provider/data_source_policy_set.go | 4 ++-- internal/provider/data_source_policy_set_test.go | 1 - internal/provider/resource_tfe_policy_set.go | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9138b3208..eaa044057 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/jsonapi v1.2.0 // indirect + github.com/hashicorp/jsonapi v1.3.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.20.0 // indirect github.com/hashicorp/terraform-json v0.21.0 // indirect diff --git a/go.sum b/go.sum index 2b742b91f..52aebfed9 100644 --- a/go.sum +++ b/go.sum @@ -75,6 +75,8 @@ github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBI github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba h1:5ghRIwO76fM7XsNwONGlw/xE+XO9uU3yyTUE36JX/nM= github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= +github.com/hashicorp/go-tfe v1.44.0 h1:eQ9n2Ecfel6O5j03UW6B9LNsM1x6KbHErsjwSd9BLmg= +github.com/hashicorp/go-tfe v1.44.0/go.mod h1:3ZGX+wxeyp/JnP8qEZo8m3s0ggJ7H+L2BvJRpkRdtVU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -88,6 +90,8 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/jsonapi v1.2.0 h1:ezDCzOFsKTL+KxVQuA1rNxkIGTvZph1rNu8kT5A8trI= github.com/hashicorp/jsonapi v1.2.0/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= +github.com/hashicorp/jsonapi v1.3.1 h1:GtPvnmcWgYwCuDGvYT5VZBHcUyFdq9lSyCzDjn1DdPo= +github.com/hashicorp/jsonapi v1.3.1/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= diff --git a/internal/provider/data_source_policy_set.go b/internal/provider/data_source_policy_set.go index 91b22ba91..069584f9c 100644 --- a/internal/provider/data_source_policy_set.go +++ b/internal/provider/data_source_policy_set.go @@ -56,13 +56,13 @@ func dataSourceTFEPolicySet() *schema.Resource { "agent_enabled": { Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", Type: schema.TypeBool, - Optional: true, + Computed: true, }, "policy_tool_version": { Description: "The policy tool version to run the policy evaluation against", Type: schema.TypeString, - Optional: true, + Computed: true, }, "policies_path": { diff --git a/internal/provider/data_source_policy_set_test.go b/internal/provider/data_source_policy_set_test.go index 32ce23936..ab2691008 100644 --- a/internal/provider/data_source_policy_set_test.go +++ b/internal/provider/data_source_policy_set_test.go @@ -61,7 +61,6 @@ func TestAccTFEPolicySetDataSource_basic(t *testing.T) { } func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) diff --git a/internal/provider/resource_tfe_policy_set.go b/internal/provider/resource_tfe_policy_set.go index b9418faab..ce4317fd1 100644 --- a/internal/provider/resource_tfe_policy_set.go +++ b/internal/provider/resource_tfe_policy_set.go @@ -79,12 +79,14 @@ func resourceTFEPolicySet() *schema.Resource { Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", Type: schema.TypeBool, Optional: true, + Computed: true, }, "policy_tool_version": { Description: "The policy tool version to run the policy evaluation against", Type: schema.TypeString, Optional: true, + Computed: true, }, "policies_path": { From a51a7d485c14713ad7757637ca84eb0c838db661 Mon Sep 17 00:00:00 2001 From: mrinalirao Date: Thu, 1 Feb 2024 09:06:55 +1100 Subject: [PATCH 248/420] go mod tidy --- go.sum | 6 ------ 1 file changed, 6 deletions(-) diff --git a/go.sum b/go.sum index 52aebfed9..29962dbb1 100644 --- a/go.sum +++ b/go.sum @@ -71,10 +71,6 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.4 h1:dIyjGKFVwbOVAqp0/s7tmONwCNr9D2UvmMuVE4mPfv0= github.com/hashicorp/go-slug v0.13.4/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBIC0= -github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= -github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba h1:5ghRIwO76fM7XsNwONGlw/xE+XO9uU3yyTUE36JX/nM= -github.com/hashicorp/go-tfe v1.43.1-0.20240124225001-a70b00fc17ba/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= github.com/hashicorp/go-tfe v1.44.0 h1:eQ9n2Ecfel6O5j03UW6B9LNsM1x6KbHErsjwSd9BLmg= github.com/hashicorp/go-tfe v1.44.0/go.mod h1:3ZGX+wxeyp/JnP8qEZo8m3s0ggJ7H+L2BvJRpkRdtVU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -88,8 +84,6 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/jsonapi v1.2.0 h1:ezDCzOFsKTL+KxVQuA1rNxkIGTvZph1rNu8kT5A8trI= -github.com/hashicorp/jsonapi v1.2.0/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= github.com/hashicorp/jsonapi v1.3.1 h1:GtPvnmcWgYwCuDGvYT5VZBHcUyFdq9lSyCzDjn1DdPo= github.com/hashicorp/jsonapi v1.3.1/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= From f9d0b1aa6f79a582371849b13af47e9aa99b3031 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:38:24 -0600 Subject: [PATCH 249/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.43.0 to 1.44.0 (#1240) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.43.0 to 1.44.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.43.0...v1.44.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5ab73a630..eaa044057 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.13.4 - github.com/hashicorp/go-tfe v1.43.0 + github.com/hashicorp/go-tfe v1.44.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect @@ -43,7 +43,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/jsonapi v1.2.0 // indirect + github.com/hashicorp/jsonapi v1.3.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.20.0 // indirect github.com/hashicorp/terraform-json v0.21.0 // indirect diff --git a/go.sum b/go.sum index 696d3db60..29962dbb1 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.13.4 h1:dIyjGKFVwbOVAqp0/s7tmONwCNr9D2UvmMuVE4mPfv0= github.com/hashicorp/go-slug v0.13.4/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.43.0 h1:0rFw/87Mw87nBrkH4JkCIYlUlmR+l2IYs4Ip5cVBIC0= -github.com/hashicorp/go-tfe v1.43.0/go.mod h1:bwFaHnmB+XigFoSVYaBXfYiwFI9+RecXTA0CrHT919s= +github.com/hashicorp/go-tfe v1.44.0 h1:eQ9n2Ecfel6O5j03UW6B9LNsM1x6KbHErsjwSd9BLmg= +github.com/hashicorp/go-tfe v1.44.0/go.mod h1:3ZGX+wxeyp/JnP8qEZo8m3s0ggJ7H+L2BvJRpkRdtVU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -84,8 +84,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/jsonapi v1.2.0 h1:ezDCzOFsKTL+KxVQuA1rNxkIGTvZph1rNu8kT5A8trI= -github.com/hashicorp/jsonapi v1.2.0/go.mod h1:Yog5+CPEM3c99L1CL2CFCYoSzgWm5vTU58idbRUaLik= +github.com/hashicorp/jsonapi v1.3.1 h1:GtPvnmcWgYwCuDGvYT5VZBHcUyFdq9lSyCzDjn1DdPo= +github.com/hashicorp/jsonapi v1.3.1/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= From e5854c7f63cb96c8d6335484ed2b6ecf727ff39c Mon Sep 17 00:00:00 2001 From: Michael Yocca <19916665+mjyocca@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:18:15 -0800 Subject: [PATCH 250/420] Add `aggregated_commit_status_enabled ` attribute to org resource and data blocks (#1169) --- CHANGELOG.md | 4 +++- internal/provider/data_source_organization.go | 6 ++++++ internal/provider/resource_tfe_organization.go | 18 ++++++++++++++++-- .../provider/resource_tfe_organization_test.go | 4 ++++ website/docs/d/organization.html.markdown | 3 ++- website/docs/r/organization.html.markdown | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d74c65f..abe550ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,9 @@ FEATURES: * **New Resource**: `r/tfe_sentinel_version` adds the ability for admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * **New Resource**: `r/tfe_opa_version` adds the ability for admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * `r/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to allow setting a policy runtime version to the policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) -* `d/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to get the policy runtime version of a policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) +* `d/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to get the policy runtime version of a policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) +* `r/tfe_organization`: Add `aggregated_commit_status_enabled` attribute, by @mjyocca [1169](https://github.com/hashicorp/terraform-provider-tfe/pull/1169) +* `d/tfe_organization`: Add `aggregated_commit_status_enabled` attribute, by @mjyocca [1169](https://github.com/hashicorp/terraform-provider-tfe/pull/1169) BUG FIXES: diff --git a/internal/provider/data_source_organization.go b/internal/provider/data_source_organization.go index 7b880d6cc..e2f79e3a8 100644 --- a/internal/provider/data_source_organization.go +++ b/internal/provider/data_source_organization.go @@ -66,6 +66,11 @@ func dataSourceTFEOrganization() *schema.Resource { Computed: true, }, + "aggregated_commit_status_enabled": { + Type: schema.TypeBool, + Computed: true, + }, + "assessments_enforced": { Type: schema.TypeBool, Computed: true, @@ -106,6 +111,7 @@ func dataSourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) err d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("two_factor_conformant", org.TwoFactorConformant) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) + d.Set("aggregated_commit_status_enabled", org.AggregatedCommitStatusEnabled) d.Set("assessments_enforced", org.AssessmentsEnforced) return nil diff --git a/internal/provider/resource_tfe_organization.go b/internal/provider/resource_tfe_organization.go index 04a25bc2c..0a8ce3738 100644 --- a/internal/provider/resource_tfe_organization.go +++ b/internal/provider/resource_tfe_organization.go @@ -82,6 +82,12 @@ func resourceTFEOrganization() *schema.Resource { Computed: true, }, + "aggregated_commit_status_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "assessments_enforced": { Type: schema.TypeBool, Optional: true, @@ -146,6 +152,7 @@ func resourceTFEOrganizationRead(d *schema.ResourceData, meta interface{}) error d.Set("owners_team_saml_role_id", org.OwnersTeamSAMLRoleID) d.Set("cost_estimation_enabled", org.CostEstimationEnabled) d.Set("send_passing_statuses_for_untriggered_speculative_plans", org.SendPassingStatusesForUntriggeredSpeculativePlans) + d.Set("aggregated_commit_status_enabled", org.AggregatedCommitStatusEnabled) // TFE (onprem) does not currently have this feature and this value won't be returned in those cases. // org.AssessmentsEnforced will default to false d.Set("assessments_enforced", org.AssessmentsEnforced) @@ -193,8 +200,15 @@ func resourceTFEOrganizationUpdate(d *schema.ResourceData, meta interface{}) err } // If send_passing_statuses_for_untriggered_speculative_plans is supplied, set it using the options struct. - if sendPassingStatusesForUntriggeredSpeculativePlans, ok := d.GetOk("send_passing_statuses_for_untriggered_speculative_plans"); ok { - options.SendPassingStatusesForUntriggeredSpeculativePlans = tfe.Bool(sendPassingStatusesForUntriggeredSpeculativePlans.(bool)) + if d.HasChange("send_passing_statuses_for_untriggered_speculative_plans") { + _, newVal := d.GetChange("send_passing_statuses_for_untriggered_speculative_plans") + options.SendPassingStatusesForUntriggeredSpeculativePlans = tfe.Bool(newVal.(bool)) + } + + // If aggregated_commit_status_enabled is supplied, set it using the options struct. + if d.HasChange("aggregated_commit_status_enabled") { + _, newVal := d.GetChange("aggregated_commit_status_enabled") + options.AggregatedCommitStatusEnabled = tfe.Bool(newVal.(bool)) } // If assessments_enforced is supplied, set it using the options struct. diff --git a/internal/provider/resource_tfe_organization_test.go b/internal/provider/resource_tfe_organization_test.go index cae3b88b6..5c353d87e 100644 --- a/internal/provider/resource_tfe_organization_test.go +++ b/internal/provider/resource_tfe_organization_test.go @@ -76,6 +76,8 @@ func TestAccTFEOrganization_full(t *testing.T) { "tfe_organization.foobar", "cost_estimation_enabled", "false"), resource.TestCheckResourceAttr( "tfe_organization.foobar", "send_passing_statuses_for_untriggered_speculative_plans", "false"), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "aggregated_commit_status_enabled", "true"), resource.TestCheckResourceAttr( "tfe_organization.foobar", "assessments_enforced", "false"), resource.TestCheckResourceAttr( @@ -161,6 +163,8 @@ func TestAccTFEOrganization_update_costEstimation(t *testing.T) { "tfe_organization.foobar", "cost_estimation_enabled", strconv.FormatBool(costEstimationEnabled1)), resource.TestCheckResourceAttr( "tfe_organization.foobar", "send_passing_statuses_for_untriggered_speculative_plans", "false"), + resource.TestCheckResourceAttr( + "tfe_organization.foobar", "aggregated_commit_status_enabled", "true"), resource.TestCheckResourceAttr( "tfe_organization.foobar", "assessments_enforced", strconv.FormatBool(assessmentsEnforced1)), resource.TestCheckResourceAttr( diff --git a/website/docs/d/organization.html.markdown b/website/docs/d/organization.html.markdown index d74625c37..95fb50f3b 100644 --- a/website/docs/d/organization.html.markdown +++ b/website/docs/d/organization.html.markdown @@ -33,4 +33,5 @@ In addition to all arguments above, the following attributes are exported: * `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. -* `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. \ No newline at end of file +* `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. +* `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. diff --git a/website/docs/r/organization.html.markdown b/website/docs/r/organization.html.markdown index ac2351a1b..c72a0ff49 100644 --- a/website/docs/r/organization.html.markdown +++ b/website/docs/r/organization.html.markdown @@ -35,6 +35,7 @@ The following arguments are supported: * `owners_team_saml_role_id` - (Optional) The name of the "owners" team. * `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. * `assessments_enforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allow_force_delete_workspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. From d5a81d781ef98cab22c7ea8f7779dd836112d515 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:03:43 -0600 Subject: [PATCH 251/420] Build(deps): Bump github.com/hashicorp/go-slug from 0.13.4 to 0.14.0 (#1244) Bumps [github.com/hashicorp/go-slug](https://github.com/hashicorp/go-slug) from 0.13.4 to 0.14.0. - [Release notes](https://github.com/hashicorp/go-slug/releases) - [Commits](https://github.com/hashicorp/go-slug/compare/v0.13.4...v0.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-slug dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eaa044057..1850249a4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect - github.com/hashicorp/go-slug v0.13.4 + github.com/hashicorp/go-slug v0.14.0 github.com/hashicorp/go-tfe v1.44.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 diff --git a/go.sum b/go.sum index 29962dbb1..498546861 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDm github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.13.4 h1:dIyjGKFVwbOVAqp0/s7tmONwCNr9D2UvmMuVE4mPfv0= -github.com/hashicorp/go-slug v0.13.4/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= +github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= +github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.44.0 h1:eQ9n2Ecfel6O5j03UW6B9LNsM1x6KbHErsjwSd9BLmg= github.com/hashicorp/go-tfe v1.44.0/go.mod h1:3ZGX+wxeyp/JnP8qEZo8m3s0ggJ7H+L2BvJRpkRdtVU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 75905b68a124fc4ecf7a1f3ba9653abdf5e56717 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 5 Feb 2024 14:56:55 -0600 Subject: [PATCH 252/420] docs: fix typo in 'team_project_access' --- website/docs/cdktf/csharp/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/go/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/java/r/team_project_access.html.markdown | 2 +- website/docs/cdktf/python/r/team_project_access.html.markdown | 2 +- .../docs/cdktf/typescript/r/team_project_access.html.markdown | 2 +- website/docs/r/team_project_access.html.markdown | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/cdktf/csharp/r/team_project_access.html.markdown b/website/docs/cdktf/csharp/r/team_project_access.html.markdown index 5274cbefa..2be7db365 100644 --- a/website/docs/cdktf/csharp/r/team_project_access.html.markdown +++ b/website/docs/cdktf/csharp/r/team_project_access.html.markdown @@ -69,7 +69,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| diff --git a/website/docs/cdktf/go/r/team_project_access.html.markdown b/website/docs/cdktf/go/r/team_project_access.html.markdown index 6dd725740..ea298cee3 100644 --- a/website/docs/cdktf/go/r/team_project_access.html.markdown +++ b/website/docs/cdktf/go/r/team_project_access.html.markdown @@ -74,7 +74,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| diff --git a/website/docs/cdktf/java/r/team_project_access.html.markdown b/website/docs/cdktf/java/r/team_project_access.html.markdown index 9cd5ee592..bb3d6a831 100644 --- a/website/docs/cdktf/java/r/team_project_access.html.markdown +++ b/website/docs/cdktf/java/r/team_project_access.html.markdown @@ -70,7 +70,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 5f374a1e1..e0b9e6ebf 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -70,7 +70,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index bc47d7f18..85224969a 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -73,7 +73,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| diff --git a/website/docs/r/team_project_access.html.markdown b/website/docs/r/team_project_access.html.markdown index 7d5ad1e13..533455c4a 100644 --- a/website/docs/r/team_project_access.html.markdown +++ b/website/docs/r/team_project_access.html.markdown @@ -55,7 +55,7 @@ The following permissions apply to the project itself. -The following permissions apply to all workpsaces (and future workspaces) in the project. +The following permissions apply to all workspaces (and future workspaces) in the project. | workspace_access | Description, Default, Valid Values | |----------------------|-------------------------------------------------------| From 45f626194c67a1771929692048f9c33fa2232f97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:56:42 -0600 Subject: [PATCH 253/420] Build(deps): Bump actions/upload-artifact from 4.3.0 to 4.3.1 (#1247) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.0 to 4.3.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/26f96dfa697d77e81fd5907df203aa23a56210a8...5d5d22a31266ced268874388b861e4b58bb5c2f3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c3b40aeb..b28464e3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index fd1813c88..82220b3e4 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25530c534..6d2f60f7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: release-notes path: release-notes.txt From 7c2a2bed48fd52fe80bca25c781616eb6caa4b96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:13:47 -0600 Subject: [PATCH 254/420] Build(deps): Bump actions/download-artifact from 4.1.1 to 4.1.2 (#1248) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/6b208ae046db98c579e8a3aa621ab581ff575935...eaceaf801fd36c7dee90939fad912460b18a1ffe) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b28464e3a..699cb7af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 16 - name: Download artifacts - uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 82220b3e4..b49cb4e70 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: terraform-provider-tfe From 496b6fe31466a23cbfdae4838e06704bfb4caf87 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Tue, 6 Feb 2024 11:32:06 -0500 Subject: [PATCH 255/420] Data source no-code module (#1246) * stub no-code module data-source * add data-source for no-code module * add changelog * remove unnecessary conversion * mark organization as just computed * add documentation for no-code module data source * remove unnecessary validation method * Rebased "data-source-module" onto a local branch --------- Co-authored-by: catsby --- CHANGELOG.md | 1 + .../provider/data_source_no_code_module.go | 135 ++++++++++++++++++ .../data_source_no_code_module_test.go | 45 ++++++ internal/provider/provider_next.go | 1 + website/docs/d/no_code_module.html.markdown | 38 +++++ 5 files changed, 220 insertions(+) create mode 100644 internal/provider/data_source_no_code_module.go create mode 100644 internal/provider/data_source_no_code_module_test.go create mode 100644 website/docs/d/no_code_module.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index abe550ca6..f82409682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) +* **New Data Source**: `d/tfe_no_code_module` is a new data source to retrieve information about a no-code module, by @catsby [1242](https://github.com/hashicorp/terraform-provider-tfe/pull/1242) * **New Resource**: `r/tfe_sentinel_version` adds the ability for admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * **New Resource**: `r/tfe_opa_version` adds the ability for admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * `r/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to allow setting a policy runtime version to the policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) diff --git a/internal/provider/data_source_no_code_module.go b/internal/provider/data_source_no_code_module.go new file mode 100644 index 000000000..245d5bffd --- /dev/null +++ b/internal/provider/data_source_no_code_module.go @@ -0,0 +1,135 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceTFENoCodeModule{} + _ datasource.DataSourceWithConfigure = &dataSourceTFENoCodeModule{} +) + +// NewNoCodeModuleDataSource is a helper function to simplify the implementation. +func NewNoCodeModuleDataSource() datasource.DataSource { + return &dataSourceTFENoCodeModule{} +} + +// dataSourceTFENoCodeModule is the data source implementation. +type dataSourceTFENoCodeModule struct { + config ConfiguredClient +} + +// modelNoCodeModule maps the data source schema data. +type modelNoCodeModule struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + Namespace types.String `tfsdk:"namespace"` + VersionPin types.String `tfsdk:"version_pin"` + RegistryModuleID types.String `tfsdk:"registry_module_id"` + Enabled types.Bool `tfsdk:"enabled"` +} + +// Metadata returns the data source type name. +func (d *dataSourceTFENoCodeModule) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_no_code_module" +} + +// Schema defines the schema for the data source. +func (d *dataSourceTFENoCodeModule) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "This data source can be used to retrieve a public or private no-code module.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "ID of the no-code module.", + Required: true, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization.", + Computed: true, + }, + "namespace": schema.StringAttribute{ + Description: "The namespace of the no-code module.", + Computed: true, + }, + "registry_module_id": schema.StringAttribute{ + Description: "ID of the registry module.", + Computed: true, + }, + "version_pin": schema.StringAttribute{ + Description: "Version pin of the no-code module.", + Computed: true, + }, + "enabled": schema.BoolAttribute{ + Description: "Indiate if this no-code module is currently enabled.", + Computed: true, + }, + }, + } +} + +// Configure adds the provider configured client to the data source. +func (d *dataSourceTFENoCodeModule) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceTFENoCodeModule) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelNoCodeModule + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + options := &tfe.RegistryNoCodeModuleReadOptions{ + Include: []tfe.RegistryNoCodeModuleIncludeOpt{tfe.RegistryNoCodeIncludeVariableOptions}, + } + + tflog.Debug(ctx, "Reading no code module") + module, err := d.config.Client.RegistryNoCodeModules.Read(ctx, data.ID.ValueString(), options) + if err != nil { + resp.Diagnostics.AddError("Unable to read no code module", err.Error()) + return + } + + data = modelFromTFENoCodeModule(module) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} +func modelFromTFENoCodeModule(v *tfe.RegistryNoCodeModule) modelNoCodeModule { + return modelNoCodeModule{ + ID: types.StringValue(v.ID), + Organization: types.StringValue(v.Organization.Name), + RegistryModuleID: types.StringValue(v.RegistryModule.ID), + Namespace: types.StringValue(v.RegistryModule.Namespace), + VersionPin: types.StringValue(v.VersionPin), + Enabled: types.BoolValue(v.Enabled), + } +} diff --git a/internal/provider/data_source_no_code_module_test.go b/internal/provider/data_source_no_code_module_test.go new file mode 100644 index 000000000..65c8c438e --- /dev/null +++ b/internal/provider/data_source_no_code_module_test.go @@ -0,0 +1,45 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTFENoCodeModuleDataSource_public(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + orgName := fmt.Sprintf("tst-terraform-%d", rInt) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFENoCodeModuleDataSourceConfig_public(rInt), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tfe_no_code_module.foobar", "id"), + resource.TestCheckResourceAttr("data.tfe_no_code_module.foobar", "organization", orgName), + resource.TestCheckResourceAttr("data.tfe_no_code_module.foobar", "enabled", "true"), + resource.TestCheckResourceAttrSet("data.tfe_no_code_module.foobar", "registry_module_id"), + ), + }, + }, + }) +} + +func testAccTFENoCodeModuleDataSourceConfig_public(rInt int) string { + return fmt.Sprintf(` +%s + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} +`, testAccTFENoCodeModule_basic(rInt)) +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 5fdc102f8..cb52e5b62 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -127,6 +127,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource NewRegistryGPGKeysDataSource, NewRegistryProviderDataSource, NewRegistryProvidersDataSource, + NewNoCodeModuleDataSource, NewSAMLSettingsDataSource, } } diff --git a/website/docs/d/no_code_module.html.markdown b/website/docs/d/no_code_module.html.markdown new file mode 100644 index 000000000..0a817b766 --- /dev/null +++ b/website/docs/d/no_code_module.html.markdown @@ -0,0 +1,38 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `id` - ID of the no-code module. +* `organization` - Organization name that the no-code module belongs to. +* `namespace` - Namespace name that the no-code module belongs to. +* `registry_module_id` - ID of the registry module for the no-code module. +* `version_pin` - Version number the no-code module is pinned to. +* `enabled` - Indicates if this no-code module is currently enabled From 1c75d9dfedbe3f8bbdbfc2643fa3d4b7942456bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 09:38:42 -0600 Subject: [PATCH 256/420] Build(deps): Bump actions/setup-node from 4.0.1 to 4.0.2 (#1249) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8...60edb5dd545a775178f52524783378180af0d1f8) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 699cb7af9..c405489e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: needs: [ tests ] runs-on: ubuntu-latest steps: - - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: 16 diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b49cb4e70..18148fe8c 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -81,7 +81,7 @@ jobs: key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }} - name: Setup Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: "18.x" From fd7f21da98cc3bd3852c2d8077e6670f81ed9b3f Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 8 Feb 2024 16:35:25 -0700 Subject: [PATCH 257/420] Prep v0.52.0 release Update CHANGELOG.md --- CHANGELOG.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f82409682..8459d0939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,12 @@ -## UNRELEASED - - +## v0.52.0 FEATURES: * **New Resource**: `r/tfe_registry_provider` is a new resource for managing public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_provider` is a new data source to retrieve information about a public or private provider in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_registry_providers` is a new data source to retrieve information about public and private providers in the private registry, by @tmatilai [1185](https://github.com/hashicorp/terraform-provider-tfe/pull/1185) * **New Data Source**: `d/tfe_no_code_module` is a new data source to retrieve information about a no-code module, by @catsby [1242](https://github.com/hashicorp/terraform-provider-tfe/pull/1242) -* **New Resource**: `r/tfe_sentinel_version` adds the ability for admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) -* **New Resource**: `r/tfe_opa_version` adds the ability for admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* **New Resource**: `r/tfe_sentinel_version` adds the ability for Terraform Enterprise admins to configure settings for sentinel versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) +* **New Resource**: `r/tfe_opa_version` adds the ability for Terraform Enterprise admins to configure settings for OPA versions ([#1202](https://github.com/hashicorp/terraform-provider-tfe/pull/1202)) * `r/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to allow setting a policy runtime version to the policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) * `d/tfe_policy_set`: Add `agent_enabled` and `policy_tool_version` attributes to get the policy runtime version of a policy set, by @mrinalirao [1234](https://github.com/hashicorp/terraform-provider-tfe/pull/1234) * `r/tfe_organization`: Add `aggregated_commit_status_enabled` attribute, by @mjyocca [1169](https://github.com/hashicorp/terraform-provider-tfe/pull/1169) From 3431681313fb14e72f0f119f5256a98430e22cbd Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 8 Feb 2024 16:54:06 -0700 Subject: [PATCH 258/420] Update index.html.markdown --- website/docs/index.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index c6a35bcd8..dd9dfbf81 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.51.1" + version = "~> 0.52.0" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.52.0" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.51.1" + version = "~> 0.52.0" } # Create an organization From 4c66c5519962d2a98b78b89165b2bdde246ced20 Mon Sep 17 00:00:00 2001 From: team-tf-cdk <84392119+team-tf-cdk@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:18:05 +0100 Subject: [PATCH 259/420] cdktf: update documentation (#1253) * cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown * cdktf: update d/registry_provider.html.markdown,d/registry_gpg_keys.html.markdown,d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown * cdktf: update r/sentinel_version.html.markdown,r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_provider.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown * cdktf: update r/terraform_version.html.markdown,r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown * cdktf: update d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/no_code_module.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown * cdktf: update r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/opa_version.html.markdown --- .../python/d/no_code_module.html.markdown | 55 ++++++++++++++ .../cdktf/python/d/organization.html.markdown | 4 +- .../cdktf/python/d/policy_set.html.markdown | 4 +- website/docs/cdktf/python/index.html.markdown | 4 +- .../cdktf/python/r/opa_version.html.markdown | 68 ++++++++++++++++++ .../cdktf/python/r/organization.html.markdown | 3 +- .../cdktf/python/r/policy_set.html.markdown | 9 ++- .../python/r/sentinel_version.html.markdown | 68 ++++++++++++++++++ .../r/team_project_access.html.markdown | 2 +- .../typescript/d/no_code_module.html.markdown | 62 ++++++++++++++++ .../typescript/d/organization.html.markdown | 4 +- .../typescript/d/policy_set.html.markdown | 4 +- .../docs/cdktf/typescript/index.html.markdown | 4 +- .../typescript/r/opa_version.html.markdown | 71 +++++++++++++++++++ .../typescript/r/organization.html.markdown | 3 +- .../typescript/r/policy_set.html.markdown | 9 ++- .../r/sentinel_version.html.markdown | 71 +++++++++++++++++++ .../r/team_project_access.html.markdown | 2 +- 18 files changed, 433 insertions(+), 14 deletions(-) create mode 100644 website/docs/cdktf/python/d/no_code_module.html.markdown create mode 100644 website/docs/cdktf/python/r/opa_version.html.markdown create mode 100644 website/docs/cdktf/python/r/sentinel_version.html.markdown create mode 100644 website/docs/cdktf/typescript/d/no_code_module.html.markdown create mode 100644 website/docs/cdktf/typescript/r/opa_version.html.markdown create mode 100644 website/docs/cdktf/typescript/r/sentinel_version.html.markdown diff --git a/website/docs/cdktf/python/d/no_code_module.html.markdown b/website/docs/cdktf/python/d/no_code_module.html.markdown new file mode 100644 index 000000000..76a3c8037 --- /dev/null +++ b/website/docs/cdktf/python/d/no_code_module.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_no_code_module import DataTfeNoCodeModule +from imports.tfe.no_code_module import NoCodeModule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foobar = NoCodeModule(self, "foobar", + organization=Token.as_string(tfe_organization_foobar.id), + registry_module=Token.as_string(tfe_registry_module_foobar.id) + ) + data_tfe_no_code_module_foobar = DataTfeNoCodeModule(self, "foobar_1", + id=foobar.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_tfe_no_code_module_foobar.override_logical_id("foobar") +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `id` - ID of the no-code module. +* `organization` - Organization name that the no-code module belongs to. +* `namespace` - Namespace name that the no-code module belongs to. +* `registry_module_id` - ID of the registry module for the no-code module. +* `version_pin` - Version number the no-code module is pinned to. +* `enabled` - Indicates if this no-code module is currently enabled + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index b0b5bdc68..e28ac7661 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -46,5 +46,7 @@ In addition to all arguments above, the following attributes are exported: * `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 79249f665..f07549b13 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -48,6 +48,8 @@ The following arguments are supported: * `description` - Description of the policy set. * `global` - Whether or not the policy set applies to all workspaces in the organization. * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `agent_enabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `policy_tool_version` - The policy tool version to run the evaluation against. * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspace_ids` - IDs of the workspaces that use the policy set. * `excluded_workspace_ids` - IDs of the workspaces that do not use the policy set. @@ -67,4 +69,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 7309ce774..94170cc21 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -89,7 +89,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.52.0" ... } ``` @@ -138,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opa_version.html.markdown b/website/docs/cdktf/python/r/opa_version.html.markdown new file mode 100644 index 000000000..a6beba2e4 --- /dev/null +++ b/website/docs/cdktf/python/r/opa_version.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + + + +# tfe_opa_version + +Manage OPA versions available on Terraform Enterprise. + +## Example Usage + +Basic Usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.opa_version import OpaVersion +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + OpaVersion(self, "test", + sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + url="https://tfe-host.com/path/to/opa", + version="0.58.0-custom" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `deprecated_reason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the OPA version + +## Import + +OPA versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index 81beeb9bc..babd13d88 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -48,6 +48,7 @@ The following arguments are supported: * `owners_team_saml_role_id` - (Optional) The name of the "owners" team. * `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. * `assessments_enforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allow_force_delete_workspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. @@ -64,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 4193878fa..83e93767f 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -34,11 +34,13 @@ class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) PolicySet(self, "test", + agent_enabled=Token.as_boolean("true"), description="A brand new policy set", kind="sentinel", name="my-policy-set", organization="my-org-name", policies_path="policies/my-policy-set", + policy_tool_version="0.24.1", vcs_repo=PolicySetVcsRepo( branch="main", identifier="my-org-name/my-policy-set-repository", @@ -64,11 +66,13 @@ class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) PolicySet(self, "test", + agent_enabled=Token.as_boolean("true"), description="A brand new policy set", kind="sentinel", name="my-policy-set", organization="my-org-name", policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], + policy_tool_version="0.24.1", workspace_ids=[Token.as_string(tfe_workspace_test.id)] ) ``` @@ -114,6 +118,9 @@ The following arguments are supported: * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. +* `agent_enabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `policy_tool_version` - (Optional) The policy tool version to run the evaluation against. * `overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -159,4 +166,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_version.html.markdown b/website/docs/cdktf/python/r/sentinel_version.html.markdown new file mode 100644 index 000000000..f1cf14543 --- /dev/null +++ b/website/docs/cdktf/python/r/sentinel_version.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + + + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.sentinel_version import SentinelVersion +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + SentinelVersion(self, "test", + sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + url="https://tfe-host.com/path/to/sentinel.zip", + version="0.24.0-custom" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `deprecated_reason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index e0b9e6ebf..6a9a2b5c2 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -146,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/no_code_module.html.markdown b/website/docs/cdktf/typescript/d/no_code_module.html.markdown new file mode 100644 index 000000000..e680d7bd9 --- /dev/null +++ b/website/docs/cdktf/typescript/d/no_code_module.html.markdown @@ -0,0 +1,62 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeNoCodeModule } from "./.gen/providers/tfe/data-tfe-no-code-module"; +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foobar = new NoCodeModule(this, "foobar", { + organization: Token.asString(tfeOrganizationFoobar.id), + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + }); + const dataTfeNoCodeModuleFoobar = new DataTfeNoCodeModule( + this, + "foobar_1", + { + id: foobar.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataTfeNoCodeModuleFoobar.overrideLogicalId("foobar"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `id` - ID of the no-code module. +* `organization` - Organization name that the no-code module belongs to. +* `namespace` - Namespace name that the no-code module belongs to. +* `registryModuleId` - ID of the registry module for the no-code module. +* `versionPin` - Version number the no-code module is pinned to. +* `enabled` - Indicates if this no-code module is currently enabled + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 00eb85705..7f2b0b3fc 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -49,5 +49,7 @@ In addition to all arguments above, the following attributes are exported: * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 7c712ee1f..519edc03a 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -51,6 +51,8 @@ The following arguments are supported: * `description` - Description of the policy set. * `global` - Whether or not the policy set applies to all workspaces in the organization. * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `agentEnabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `policyToolVersion` - The policy tool version to run the evaluation against. * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspaceIds` - IDs of the workspaces that use the policy set. * `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. @@ -70,4 +72,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 57db5a77a..13c0b5f4f 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -92,7 +92,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.52.0" ... } ``` @@ -148,4 +148,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown new file mode 100644 index 000000000..e1d634b0d --- /dev/null +++ b/website/docs/cdktf/typescript/r/opa_version.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + + + +# tfe_opa_version + +Manage OPA versions available on Terraform Enterprise. + +## Example Usage + +Basic Usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OpaVersion } from "./.gen/providers/tfe/opa-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new OpaVersion(this, "test", { + sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + url: "https://tfe-host.com/path/to/opa", + version: "0.58.0-custom", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `deprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the OPA version + +## Import + +OPA versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index a71bf2174..3ba278ef1 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -51,6 +51,7 @@ The following arguments are supported: * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `sendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. * `assessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. @@ -67,4 +68,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 606aa5f95..6c3c74812 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -34,11 +34,13 @@ class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); new PolicySet(this, "test", { + agentEnabled: Token.asBoolean("true"), description: "A brand new policy set", kind: "sentinel", name: "my-policy-set", organization: "my-org-name", policiesPath: "policies/my-policy-set", + policyToolVersion: "0.24.1", vcsRepo: { branch: "main", identifier: "my-org-name/my-policy-set-repository", @@ -67,11 +69,13 @@ class MyConvertedCode extends TerraformStack { constructor(scope: Construct, name: string) { super(scope, name); new PolicySet(this, "test", { + agentEnabled: Token.asBoolean("true"), description: "A brand new policy set", kind: "sentinel", name: "my-policy-set", organization: "my-org-name", policyIds: [Token.asString(tfeSentinelPolicyTest.id)], + policyToolVersion: "0.24.1", workspaceIds: [Token.asString(tfeWorkspaceTest.id)], }); } @@ -123,6 +127,9 @@ The following arguments are supported: * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. +* `agentEnabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `policyToolVersion` - (Optional) The policy tool version to run the evaluation against. * `overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -168,4 +175,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown new file mode 100644 index 000000000..c11688de7 --- /dev/null +++ b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + + + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SentinelVersion } from "./.gen/providers/tfe/sentinel-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new SentinelVersion(this, "test", { + sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + url: "https://tfe-host.com/path/to/sentinel.zip", + version: "0.24.0-custom", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `deprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 85224969a..f85ec64cc 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -154,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file From 83e97f85bc92dd70682447489950f6e21bc048d8 Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Wed, 14 Feb 2024 11:11:15 -0700 Subject: [PATCH 260/420] create oauth_client with agent pool --- .../provider/resource_tfe_oauth_client.go | 9 ++++ .../resource_tfe_oauth_client_test.go | 51 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index 215443193..bca166a7e 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -111,6 +111,12 @@ func resourceTFEOAuthClient() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "agent_pool_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, }, } } @@ -156,6 +162,9 @@ func resourceTFEOAuthClientCreate(d *schema.ResourceData, meta interface{}) erro if serviceProvider == tfe.ServiceProviderBitbucket { options.Secret = tfe.String(secret) } + if v, ok := d.GetOk("agent_pool_id"); ok && v.(string) != "" { + options.AgentPool = &tfe.AgentPool{ID: *tfe.String(v.(string))} + } log.Printf("[DEBUG] Create an OAuth client for organization: %s", organization) oc, err := config.Client.OAuthClients.Create(ctx, organization, options) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index a74ecc811..24adc96ca 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -75,6 +75,35 @@ func TestAccTFEOAuthClient_rsaKeys(t *testing.T) { }) } +func TestAccTFEOAuthClient_agentPool(t *testing.T) { + oc := &tfe.OAuthClient{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + if envGithubToken == "" { + t.Skip("Please set GITHUB_TOKEN to run this test") + } + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEOAuthClientDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOAuthClient_agentPool(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOAuthClientExists("tfe_oauth_client.foobar", oc), + testAccCheckTFEOAuthClientAttributes(oc), + resource.TestCheckResourceAttr( + "tfe_oauth_client.foobar", "service_provider", "github_enterprise"), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "agent_pool_id", ""), + ), + }, + }, + }) +} + func testAccCheckTFEOAuthClientExists( n string, oc *tfe.OAuthClient) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -183,3 +212,25 @@ hwIDAQAB EOT }`, rInt) } + +func testAccTFEOAuthClient_agentPool(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_agent_pool" "foobar" { + name = "agent-pool-test" + organization = tfe_organization.foobar.name +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.id + api_url = "https://githubenterprise.xxx" + http_url = "https://githubenterprise.xxx" + oauth_token = "%s" + service_provider = "github_enterprise" + agent_pool_id = tfe_agent_pool.foobar.id +}`, rInt, envGithubToken) +} From 4916ed876bfbf1bde4cf010820705958a9189c6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:51:57 -0600 Subject: [PATCH 261/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.44.0 to 1.45.0 (#1256) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.44.0 to 1.45.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.44.0...v1.45.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1850249a4..99677954a 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.44.0 + github.com/hashicorp/go-tfe v1.45.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index 498546861..1d3cb6581 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.44.0 h1:eQ9n2Ecfel6O5j03UW6B9LNsM1x6KbHErsjwSd9BLmg= -github.com/hashicorp/go-tfe v1.44.0/go.mod h1:3ZGX+wxeyp/JnP8qEZo8m3s0ggJ7H+L2BvJRpkRdtVU= +github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= +github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 699a3546a52ad11ea43493f9be65a2233fdb21c8 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 12 Feb 2024 18:14:44 -0700 Subject: [PATCH 262/420] Adds `ignore_additional_tag_names` to tfe_workspace resource A boolean value that, when set to true, allows additional unmanaged tags to be applied to this workspace outside of terraform without being overwritten by `tag_names` config. This creates exceptional behavior in terraform with respect to `tag_names` and is generally not recommended. Co-authored-by: mbillow --- CHANGELOG.md | 5 ++ internal/provider/resource_tfe_workspace.go | 10 +++- .../provider/resource_tfe_workspace_test.go | 57 +++++++++++++++++++ website/docs/r/workspace.html.markdown | 2 +- 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8459d0939..9ae4c6881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## UNRELEASED + +FEATURES: +* `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores tag_names _not_ defined by config to exist on the workspace without being overwritten when the resource is refreshed, by @brandonc and @mbillow + ## v0.52.0 FEATURES: diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index c8ce80a98..7db6c143f 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -209,6 +209,11 @@ func resourceTFEWorkspace() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, }, + "ignore_additional_tag_names": { + Type: schema.TypeBool, + Optional: true, + }, + "terraform_version": { Type: schema.TypeString, Optional: true, @@ -529,8 +534,11 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { d.Set("agent_pool_id", agentPoolID) var tagNames []interface{} + managedTags := d.Get("tag_names").(*schema.Set) for _, tagName := range workspace.TagNames { - tagNames = append(tagNames, tagName) + if managedTags.Contains(tagName) || !d.Get("ignore_additional_tag_names").(bool) { + tagNames = append(tagNames, tagName) + } } d.Set("tag_names", tagNames) diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index c48ab922f..cc6f3903a 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -1226,6 +1226,10 @@ func TestAccTFEWorkspace_patternsAndPrefixesConflicting(t *testing.T) { func TestAccTFEWorkspace_changeTags(t *testing.T) { workspace := &tfe.Workspace{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1339,6 +1343,44 @@ func TestAccTFEWorkspace_changeTags(t *testing.T) { Config: testAccTFEWorkspace_basicBadTag(rInt), ExpectError: regexp.MustCompile(`"-Hello" is not a valid tag name.`), }, + { + Config: testAccTFEWorkspace_ignoreAdditional(rInt), + }, + { + PreConfig: func() { + newTags := tfe.WorkspaceAddTagsOptions{Tags: []*tfe.Tag{{Name: "unmanaged"}}} + err := tfeClient.Workspaces.AddTags(context.Background(), workspace.ID, newTags) + if err != nil { + t.Fatal(err) + } + }, + Config: testAccTFEWorkspace_ignoreAdditional(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists( + "tfe_workspace.foobar", workspace, testAccProvider), + resource.TestCheckResourceAttr( + "tfe_workspace.foobar", "tag_names.#", "2"), + resource.TestCheckTypeSetElemAttr( + "tfe_workspace.foobar", "tag_names.*", "foo"), + resource.TestCheckTypeSetElemAttr( + "tfe_workspace.foobar", "tag_names.*", "bar"), + func(state *terraform.State) error { + r, err := tfeClient.Workspaces.ListTags(context.Background(), workspace.ID, &tfe.WorkspaceTagListOptions{}) + if err != nil { + return err + } + if len(r.Items) != 3 { + return fmt.Errorf("expected 3 tags, got %d", len(r.Items)) + } + for _, tag := range r.Items { + if tag.Name == "unmanaged" { + return nil + } + } + return fmt.Errorf("unmanaged tag not found on workspace") + }, + ), + }, }, }) } @@ -2781,6 +2823,21 @@ resource "tfe_workspace" "foobar" { }`, rInt) } +func testAccTFEWorkspace_ignoreAdditional(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} +resource "tfe_workspace" "foobar" { + name = "workspace-test" + organization = tfe_organization.foobar.id + auto_apply = true + tag_names = ["foo", "bar"] + ignore_additional_tag_names = true +}`, rInt) +} + func testAccTFEWorkspace_basicBadTag(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index e314fe4ce..260375ffd 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -113,7 +113,7 @@ The following arguments are supported: workspace will display their output as text logs. * `ssh_key_id` - (Optional) The ID of an SSH key to assign to the workspace. * `tag_names` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. -* `terraform_version` - (Optional) The version of Terraform to use for this +* `ignore_additional_tag_names` - (Optional) A boolean value that, when set to true, allows additional unmanaged tags to be applied to this workspace outside of terraform without being overwritten by `tag_names` config. This creates exceptional behavior in terraform with respect to `tag_names` and is not recommended. workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) (like `~> 1.0.0`); if you specify a constraint, the workspace will always use From 5e8cbdb0b17b08b62d8d13ea042ad448c985a1c2 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 26 Feb 2024 11:12:20 -0700 Subject: [PATCH 263/420] Update workspace.html.markdown --- CHANGELOG.md | 2 +- website/docs/r/workspace.html.markdown | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae4c6881..3150c73a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## UNRELEASED FEATURES: -* `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores tag_names _not_ defined by config to exist on the workspace without being overwritten when the resource is refreshed, by @brandonc and @mbillow +* `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) ## v0.52.0 diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 260375ffd..378aac39a 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -113,7 +113,12 @@ The following arguments are supported: workspace will display their output as text logs. * `ssh_key_id` - (Optional) The ID of an SSH key to assign to the workspace. * `tag_names` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. -* `ignore_additional_tag_names` - (Optional) A boolean value that, when set to true, allows additional unmanaged tags to be applied to this workspace outside of terraform without being overwritten by `tag_names` config. This creates exceptional behavior in terraform with respect to `tag_names` and is not recommended. +* `ignore_additional_tag_names` - (Optional) Explicitly ignores `tag_names` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `tag_names` and is not recommended. This value must be applied before it +will be used. +* `terraform_version` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) (like `~> 1.0.0`); if you specify a constraint, the workspace will always use From b7628ffb0257372023bf560c010dd3cfdebda97a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:42:21 -0600 Subject: [PATCH 264/420] Build(deps): Bump actions/download-artifact from 4.1.2 to 4.1.3 (#1262) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/eaceaf801fd36c7dee90939fad912460b18a1ffe...87c55149d96e628cc2ef7e6fc2aab372015aec85) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c405489e2..bfcb59d91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 16 - name: Download artifacts - uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 + uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 18148fe8c..0f9d6445e 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 + uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 with: name: terraform-provider-tfe From 9d08769fab20edc953626925f8ddd71179918738 Mon Sep 17 00:00:00 2001 From: hashimoon <98980386+hashimoon@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:55:51 -0800 Subject: [PATCH 265/420] [IPL-5689] Revert the fix for no changes detected when provider default org changes PR-1163 This fixes a bug that always forced a registry module to always be recreated when an organization is not present. --- CHANGELOG.md | 4 ++++ internal/provider/resource_tfe_registry_module.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3150c73a5..efa95563e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) +BUG FIXES: + +* `r/tfe_registry_module`: Fix registry module always triggering re-creation when an organization is not present, by @hashimoon [1263](https://github.com/hashicorp/terraform-provider-tfe/pull/1263) + ## v0.52.0 FEATURES: diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 825b79723..e1e874763 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -31,8 +31,6 @@ func resourceTFERegistryModule() *schema.Resource { StateContext: resourceTFERegistryModuleImporter, }, - CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, - Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, From f40ebbe64d4e5033cceeb6b49493920e23f70d3d Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Wed, 28 Feb 2024 14:28:27 -0800 Subject: [PATCH 266/420] adjust notification configuration test to not check for url string presence when the notification type is slack. The API made recent changes to stop exposing the url due to security concerns. I am okay deleting this specific check for the string url because if the URL was missing, the validation method validateSchemaAttributesForDestinationTypeSlack would be fail with the following error: URL is required with destination type of slack --- .../provider/resource_tfe_notification_configuration_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/provider/resource_tfe_notification_configuration_test.go b/internal/provider/resource_tfe_notification_configuration_test.go index 23ec532f7..75f4ccf6d 100644 --- a/internal/provider/resource_tfe_notification_configuration_test.go +++ b/internal/provider/resource_tfe_notification_configuration_test.go @@ -703,10 +703,6 @@ func testAccCheckTFENotificationConfigurationAttributesSlack(notificationConfigu return fmt.Errorf("Bad triggers: %v", notificationConfiguration.Triggers) } - if notificationConfiguration.URL != "http://example.com" { - return fmt.Errorf("Bad URL: %s", notificationConfiguration.URL) - } - return nil } } From 8e7673d99503a4f868b5e8c4ec32efb0de20ce7d Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Fri, 1 Mar 2024 09:29:54 -0500 Subject: [PATCH 267/420] description to data source and resource --- internal/provider/data_source_project.go | 6 ++++++ internal/provider/data_source_project_test.go | 3 +++ internal/provider/resource_tfe_project.go | 12 ++++++++++-- internal/provider/resource_tfe_project_test.go | 8 ++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/internal/provider/data_source_project.go b/internal/provider/data_source_project.go index e4c9cf99a..07a1c9b1d 100644 --- a/internal/provider/data_source_project.go +++ b/internal/provider/data_source_project.go @@ -28,6 +28,11 @@ func dataSourceTFEProject() *schema.Resource { Required: true, }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "organization": { Type: schema.TypeString, Optional: true, @@ -92,6 +97,7 @@ func dataSourceTFEProjectRead(ctx context.Context, d *schema.ResourceData, meta } d.Set("workspace_ids", workspaces) + d.Set("description", proj.Description) d.SetId(proj.ID) return nil } diff --git a/internal/provider/data_source_project_test.go b/internal/provider/data_source_project_test.go index a6fd442ba..792d53601 100644 --- a/internal/provider/data_source_project_test.go +++ b/internal/provider/data_source_project_test.go @@ -25,6 +25,8 @@ func TestAccTFEProjectDataSource_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( "data.tfe_project.foobar", "name", fmt.Sprintf("project-test-%d", rInt)), + resource.TestCheckResourceAttr( + "data.tfe_project.foobar", "description", fmt.Sprintf("project description")), resource.TestCheckResourceAttr( "data.tfe_project.foobar", "organization", orgName), resource.TestCheckResourceAttrSet("data.tfe_project.foobar", "id"), @@ -67,6 +69,7 @@ resource "tfe_organization" "foobar" { resource "tfe_project" "foobar" { name = "project-test-%d" + description = "project description" organization = tfe_organization.foobar.id } diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index 2762c5c47..5bc155c8d 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -46,6 +46,11 @@ func resourceTFEProject() *schema.Resource { ), }, + "description": { + Type: schema.TypeString, + Optional: true, + }, + "organization": { Type: schema.TypeString, Optional: true, @@ -66,7 +71,8 @@ func resourceTFEProjectCreate(ctx context.Context, d *schema.ResourceData, meta name := d.Get("name").(string) options := tfe.ProjectCreateOptions{ - Name: name, + Name: name, + Description: tfe.String(d.Get("description").(string)), } log.Printf("[DEBUG] Create new project: %s", name) @@ -95,6 +101,7 @@ func resourceTFEProjectRead(ctx context.Context, d *schema.ResourceData, meta in } d.Set("name", project.Name) + d.Set("description", project.Description) d.Set("organization", project.Organization.Name) return nil @@ -104,7 +111,8 @@ func resourceTFEProjectUpdate(ctx context.Context, d *schema.ResourceData, meta config := meta.(ConfiguredClient) options := tfe.ProjectUpdateOptions{ - Name: tfe.String(d.Get("name").(string)), + Name: tfe.String(d.Get("name").(string)), + Description: tfe.String(d.Get("description").(string)), } log.Printf("[DEBUG] Update configuration of project: %s", d.Id()) diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index 0dd424ae6..e77f03ea7 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -33,6 +33,8 @@ func TestAccTFEProject_basic(t *testing.T) { testAccCheckTFEProjectAttributes(project), resource.TestCheckResourceAttr( "tfe_project.foobar", "name", "projecttest"), + resource.TestCheckResourceAttr( + "tfe_project.foobar", "description", "project description"), resource.TestCheckResourceAttr( "tfe_project.foobar", "organization", fmt.Sprintf("tst-terraform-%d", rInt)), ), @@ -78,6 +80,8 @@ func TestAccTFEProject_update(t *testing.T) { testAccCheckTFEProjectAttributes(project), resource.TestCheckResourceAttr( "tfe_project.foobar", "name", "projecttest"), + resource.TestCheckResourceAttr( + "tfe_project.foobar", "description", "project description"), ), }, { @@ -88,6 +92,8 @@ func TestAccTFEProject_update(t *testing.T) { testAccCheckTFEProjectAttributesUpdated(project), resource.TestCheckResourceAttr( "tfe_project.foobar", "name", "project updated"), + resource.TestCheckResourceAttr( + "tfe_project.foobar", "description", "project description updated"), ), }, }, @@ -133,6 +139,7 @@ resource "tfe_organization" "foobar" { resource "tfe_project" "foobar" { organization = tfe_organization.foobar.name name = "project updated" + description = "project description updated" }`, rInt) } @@ -146,6 +153,7 @@ resource "tfe_organization" "foobar" { resource "tfe_project" "foobar" { organization = tfe_organization.foobar.name name = "projecttest" + description = "project description" }`, rInt) } From 0f8763de37e8caa9f09ecb6df8a1dc478a2e1774 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Fri, 1 Mar 2024 09:53:05 -0500 Subject: [PATCH 268/420] changelog, documentation --- CHANGELOG.md | 4 ++++ website/docs/r/project.html.markdown | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3150c73a5..7fc9e04a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## UNRELEASED +ENHANCEMENTS: +* `r/tfe_project`: Add `description` attribute, by @netramali [1270](https://github.com/hashicorp/terraform-provider-tfe/pull/1270) +* `d/tfe_project`: Add `description` attribute, by @netramali [1270](https://github.com/hashicorp/terraform-provider-tfe/pull/1270) + FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) diff --git a/website/docs/r/project.html.markdown b/website/docs/r/project.html.markdown index 40b419e5d..7c152ce85 100644 --- a/website/docs/r/project.html.markdown +++ b/website/docs/r/project.html.markdown @@ -31,6 +31,7 @@ The following arguments are supported: * `name` - (Required) Name of the project. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `description` - (Optional) A description for the project. ## Attributes Reference From df66c90a776addb06c47079301989d0aeba70c5e Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:59:19 -0500 Subject: [PATCH 269/420] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fc9e04a7..8c3ce5b36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ ## UNRELEASED ENHANCEMENTS: -* `r/tfe_project`: Add `description` attribute, by @netramali [1270](https://github.com/hashicorp/terraform-provider-tfe/pull/1270) -* `d/tfe_project`: Add `description` attribute, by @netramali [1270](https://github.com/hashicorp/terraform-provider-tfe/pull/1270) +* `r/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) +* `d/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) From 925ff845da64c62c0a805e1c8a7256237d6c2e72 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Fri, 1 Mar 2024 10:38:38 -0500 Subject: [PATCH 270/420] skip tests - feature is still feature flagged --- internal/provider/data_source_project_test.go | 1 + internal/provider/resource_tfe_project_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/provider/data_source_project_test.go b/internal/provider/data_source_project_test.go index 792d53601..2e9393298 100644 --- a/internal/provider/data_source_project_test.go +++ b/internal/provider/data_source_project_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccTFEProjectDataSource_basic(t *testing.T) { + skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() orgName := fmt.Sprintf("tst-terraform-%d", rInt) diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index e77f03ea7..faea2bb7f 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -17,6 +17,7 @@ import ( ) func TestAccTFEProject_basic(t *testing.T) { + skipUnlessBeta(t) project := &tfe.Project{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -64,6 +65,7 @@ func TestAccTFEProject_invalidName(t *testing.T) { } func TestAccTFEProject_update(t *testing.T) { + skipUnlessBeta(t) project := &tfe.Project{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() From 86475a6c58d65b890138f328918db507bfe2c6fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:17:23 -0600 Subject: [PATCH 271/420] Build(deps): Bump actions/cache from 4.0.0 to 4.0.1 (#1269) Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/13aacd865c20de90d75de3b17ebe84f7a17d57d2...ab5e6d0c87105b4c9c2047343972218f562e4319) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 0f9d6445e..5c13aae34 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -74,7 +74,7 @@ jobs: - name: Get yarn cache directory path id: global-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 id: global-cache with: path: ${{ steps.global-cache-dir-path.outputs.dir }} From e1a1f0a0dc3235afa91c059c7b00a9265210c8e1 Mon Sep 17 00:00:00 2001 From: Rolee Sinha <99283890+roleesinhaHC@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:53:36 -0700 Subject: [PATCH 272/420] Update resource_tfe_oauth_client_test.go --- internal/provider/resource_tfe_oauth_client_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index 24adc96ca..3e1da51e9 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -76,6 +76,7 @@ func TestAccTFEOAuthClient_rsaKeys(t *testing.T) { } func TestAccTFEOAuthClient_agentPool(t *testing.T) { + skipUnlessBeta(t); oc := &tfe.OAuthClient{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -96,8 +97,6 @@ func TestAccTFEOAuthClient_agentPool(t *testing.T) { testAccCheckTFEOAuthClientAttributes(oc), resource.TestCheckResourceAttr( "tfe_oauth_client.foobar", "service_provider", "github_enterprise"), - resource.TestCheckResourceAttr( - "tfe_workspace.foobar", "agent_pool_id", ""), ), }, }, From 401aa84c4273f1d2b910dbf47902dd3893f4c6dc Mon Sep 17 00:00:00 2001 From: Rolee Sinha <99283890+roleesinhaHC@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:16:53 -0700 Subject: [PATCH 273/420] Update resource_tfe_oauth_client.go --- internal/provider/resource_tfe_oauth_client.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index bca166a7e..3fc9c82ca 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -115,7 +115,6 @@ func resourceTFEOAuthClient() *schema.Resource { "agent_pool_id": { Type: schema.TypeString, Optional: true, - Computed: true, }, }, } From ccd0f9ade68c52b8fd139c1ae5e9ec6aa5a978ca Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Fri, 1 Mar 2024 12:27:25 -0700 Subject: [PATCH 274/420] updating json schema annotation --- go.mod | 2 +- go.sum | 2 ++ .../provider/resource_tfe_oauth_client.go | 2 +- .../resource_tfe_oauth_client_test.go | 27 +++++++++---------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 99677954a..86cca314b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.45.0 + github.com/hashicorp/go-tfe v1.46.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index 1d3cb6581..07d3359b0 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWq github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= +github.com/hashicorp/go-tfe v1.46.0 h1:IlFh96QoC9wYag8LR7J9g0iEILWPpZ+BTqTzABvBax8= +github.com/hashicorp/go-tfe v1.46.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index 3fc9c82ca..f13764638 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -114,7 +114,7 @@ func resourceTFEOAuthClient() *schema.Resource { "agent_pool_id": { Type: schema.TypeString, - Optional: true, + ForceNew: true, }, }, } diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index 3e1da51e9..97f42d31b 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -76,10 +76,8 @@ func TestAccTFEOAuthClient_rsaKeys(t *testing.T) { } func TestAccTFEOAuthClient_agentPool(t *testing.T) { - skipUnlessBeta(t); + skipUnlessBeta(t) oc := &tfe.OAuthClient{} - rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() - resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -91,7 +89,7 @@ func TestAccTFEOAuthClient_agentPool(t *testing.T) { CheckDestroy: testAccCheckTFEOAuthClientDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOAuthClient_agentPool(rInt), + Config: testAccTFEOAuthClient_agentPool(), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOAuthClientExists("tfe_oauth_client.foobar", oc), testAccCheckTFEOAuthClientAttributes(oc), @@ -212,24 +210,23 @@ EOT }`, rInt) } -func testAccTFEOAuthClient_agentPool(rInt int) string { +func testAccTFEOAuthClient_agentPool() string { return fmt.Sprintf(` -resource "tfe_organization" "foobar" { - name = "tst-terraform-%d" - email = "admin@company.com" +data "tfe_organization" "foobar" { + name = "xxx" } -resource "tfe_agent_pool" "foobar" { - name = "agent-pool-test" - organization = tfe_organization.foobar.name +data "tfe_agent_pool" "foobar" { + name = "xxx" + organization = data.tfe_organization.foobar.name } resource "tfe_oauth_client" "foobar" { - organization = tfe_organization.foobar.id - api_url = "https://githubenterprise.xxx" + organization = data.tfe_organization.foobar.name + api_url = "https://githubenterprise.xxx/api/v3" http_url = "https://githubenterprise.xxx" oauth_token = "%s" service_provider = "github_enterprise" - agent_pool_id = tfe_agent_pool.foobar.id -}`, rInt, envGithubToken) + agent_pool_id = data.tfe_agent_pool.foobar.id +}`, envGithubToken) } From e8350fae1592e898cef463bf139c82cd6c99cbf2 Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Fri, 1 Mar 2024 12:30:19 -0700 Subject: [PATCH 275/420] undoing go.mod and go.sum change --- go.mod | 2 +- go.sum | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 86cca314b..99677954a 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.46.0 + github.com/hashicorp/go-tfe v1.45.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index 07d3359b0..1d3cb6581 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,6 @@ github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWq github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= -github.com/hashicorp/go-tfe v1.46.0 h1:IlFh96QoC9wYag8LR7J9g0iEILWPpZ+BTqTzABvBax8= -github.com/hashicorp/go-tfe v1.46.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 11afa6efddf9b0a3b1d72057eabb49c96ab829a0 Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Fri, 1 Mar 2024 14:04:59 -0700 Subject: [PATCH 276/420] updating the go-tfe dependency --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 99677954a..86cca314b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.45.0 + github.com/hashicorp/go-tfe v1.46.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index 1d3cb6581..07d3359b0 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWq github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= +github.com/hashicorp/go-tfe v1.46.0 h1:IlFh96QoC9wYag8LR7J9g0iEILWPpZ+BTqTzABvBax8= +github.com/hashicorp/go-tfe v1.46.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 2012a34de4a998a45f116c29117461383bdf0b18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 09:38:36 -0600 Subject: [PATCH 277/420] Build(deps): Bump actions/download-artifact from 4.1.3 to 4.1.4 (#1273) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.3 to 4.1.4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/87c55149d96e628cc2ef7e6fc2aab372015aec85...c850b930e6ba138125429b7e5c93fc707a7f8427) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfcb59d91..7521e7b56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 16 - name: Download artifacts - uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 5c13aae34..d4791bba8 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: terraform-provider-tfe From 1663c26fe6bb0d7b5d0e53f923c9d6d638cafecb Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Mon, 4 Mar 2024 11:09:25 -0700 Subject: [PATCH 278/420] addressed review comments --- go.sum | 2 -- internal/provider/resource_tfe_oauth_client.go | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/go.sum b/go.sum index 07d3359b0..7181b87b6 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,6 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= -github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-tfe v1.46.0 h1:IlFh96QoC9wYag8LR7J9g0iEILWPpZ+BTqTzABvBax8= github.com/hashicorp/go-tfe v1.46.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index f13764638..bca166a7e 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -114,7 +114,8 @@ func resourceTFEOAuthClient() *schema.Resource { "agent_pool_id": { Type: schema.TypeString, - ForceNew: true, + Optional: true, + Computed: true, }, }, } From 40f7c1b8ea27c4e5eb2a425ef6d794bf9b6b3047 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:02:09 -0600 Subject: [PATCH 279/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.45.0 to 1.47.0 (#1276) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.45.0 to 1.47.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.45.0...v1.47.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 99677954a..8b00c10f5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.45.0 + github.com/hashicorp/go-tfe v1.47.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect @@ -61,7 +61,7 @@ require ( require ( github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 ) require ( diff --git a/go.sum b/go.sum index 1d3cb6581..795309a1c 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.45.0 h1:WCiQWUV7n1Fq/pKA9C3rhcSmUtSPTYBtE1kIJ9U0NSU= -github.com/hashicorp/go-tfe v1.45.0/go.mod h1:GRvhVp0mlNK/msPAvdeubWnV57avNoCmeaetcmvUyHY= +github.com/hashicorp/go-tfe v1.47.0 h1:WeQ1bVDDcU+U+kgcP341brmCO4fE7WW19euLS8Weazw= +github.com/hashicorp/go-tfe v1.47.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -157,8 +157,8 @@ github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= From 462ee776924fd5668f375b845795c302d146de5a Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Thu, 7 Mar 2024 10:33:02 -0500 Subject: [PATCH 280/420] format --- internal/provider/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 7c5a07c2e..650583b9c 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -126,7 +126,7 @@ func Provider() *schema.Provider { "tfe_policy_set": resourceTFEPolicySet(), "tfe_policy_set_parameter": resourceTFEPolicySetParameter(), "tfe_project": resourceTFEProject(), - "tfe_project_oauth_client": resourceTFEProjectOAuthClient(), + "tfe_project_oauth_client": resourceTFEProjectOAuthClient(), "tfe_project_policy_set": resourceTFEProjectPolicySet(), "tfe_project_variable_set": resourceTFEProjectVariableSet(), "tfe_registry_module": resourceTFERegistryModule(), From 85e1fe3bb91fe09dcaa1e01571cfbe4266febd93 Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Mon, 4 Mar 2024 09:02:37 -0800 Subject: [PATCH 281/420] update error message regarding the option force_delete, which can be used also for the case when a workspace has no resources but the state version is still being processed --- CHANGELOG.md | 2 ++ internal/provider/resource_tfe_workspace.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efa95563e..5aa3cd868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ FEATURES: BUG FIXES: * `r/tfe_registry_module`: Fix registry module always triggering re-creation when an organization is not present, by @hashimoon [1263](https://github.com/hashicorp/terraform-provider-tfe/pull/1263) +* `r/tfe_workspace`: Change the error message returned when a workspace cannot be safe-deleted to reflect that the error can happen when the latest state is still being processed @uturunku1 [1274](https://github.com/hashicorp/terraform-provider-tfe/pull/1274) + ## v0.52.0 diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 7db6c143f..f72155e9a 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -1005,7 +1005,7 @@ func resourceTFEWorkspaceImporter(ctx context.Context, d *schema.ResourceData, m func errWorkspaceSafeDeleteWithPermission(workspaceID string, err error) error { if err != nil { if strings.HasPrefix(err.Error(), "conflict") { - return fmt.Errorf("error deleting workspace %s: %w\nTo delete this workspace without destroying the managed resources, add force_delete = true to the resource config", workspaceID, err) + return fmt.Errorf("error deleting workspace %s: %w\nThis workspace may either have managed resources in state or has a latest state that's still being processed. Add force_delete = true to the resource config to delete this workspace", workspaceID, err) } return err } From 04bccb25ea752b85079170acdfcfa08bc4c270bc Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 11 Mar 2024 00:15:23 +0000 Subject: [PATCH 282/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown,r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown,r/sentinel_version.html.markdown,r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_provider.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/opa_version.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown,r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown,r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown,d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown,d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/registry_providers.html.markdown,d/registry_provider.html.markdown,d/registry_gpg_keys.html.markdown,d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown,d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/no_code_module.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- website/docs/cdktf/python/r/workspace.html.markdown | 7 ++++++- website/docs/cdktf/typescript/r/workspace.html.markdown | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index b7ff5cb80..99f3ba59a 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -137,6 +137,11 @@ The following arguments are supported: workspace will display their output as text logs. * `ssh_key_id` - (Optional) The ID of an SSH key to assign to the workspace. * `tag_names` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. +* `ignore_additional_tag_names` - (Optional) Explicitly ignores `tag_names` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `tag_names` and is not recommended. This value must be applied before it +will be used. * `terraform_version` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) @@ -186,4 +191,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 8d128a5bd..20f9ea001 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -143,6 +143,11 @@ The following arguments are supported: workspace will display their output as text logs. * `sshKeyId` - (Optional) The ID of an SSH key to assign to the workspace. * `tagNames` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. +* `ignore_additional_tag_names` - (Optional) Explicitly ignores `tagNames` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `tagNames` and is not recommended. This value must be applied before it +will be used. * `terraformVersion` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) @@ -192,4 +197,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file From a82ccc7eafe261a37f479dec7c0b3bb6d5b94ce6 Mon Sep 17 00:00:00 2001 From: roleesinhaHC Date: Mon, 11 Mar 2024 14:24:33 -0700 Subject: [PATCH 283/420] updating change log and docs --- CHANGELOG.md | 1 + website/docs/r/oauth_client.html.markdown | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa3cd868..d70238196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) +* `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @rolee.sinha [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255) BUG FIXES: diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index a49da1736..6ff0e6f9b 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -89,6 +89,7 @@ Link. * `service_provider` - (Required) The VCS provider being connected with. Valid options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. +* `agent_pool_id` - (Optional) An existing Agent pool id within the organization which has Private VCS support enabled via Premium SKU. ## Attributes Reference From 449e69345fd3bff0870c7e1585dd6961d6e39246 Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:20:08 -0400 Subject: [PATCH 284/420] Update data_source_project_test.go --- internal/provider/data_source_project_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/data_source_project_test.go b/internal/provider/data_source_project_test.go index 2e9393298..463f7de3a 100644 --- a/internal/provider/data_source_project_test.go +++ b/internal/provider/data_source_project_test.go @@ -27,7 +27,7 @@ func TestAccTFEProjectDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr( "data.tfe_project.foobar", "name", fmt.Sprintf("project-test-%d", rInt)), resource.TestCheckResourceAttr( - "data.tfe_project.foobar", "description", fmt.Sprintf("project description")), + "data.tfe_project.foobar", "description", "project description"), resource.TestCheckResourceAttr( "data.tfe_project.foobar", "organization", orgName), resource.TestCheckResourceAttrSet("data.tfe_project.foobar", "id"), From b132808503ed60f3b799b536851e2f14ef438ef9 Mon Sep 17 00:00:00 2001 From: Mark DeCrane Date: Mon, 11 Mar 2024 16:45:30 -0400 Subject: [PATCH 285/420] chore: upgrades for plugin, framework, mux, sdk --- go.mod | 32 ++++++++++++++++---------------- go.sum | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 8b00c10f5..e1f7dd409 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/agext/levenshtein v1.2.3 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -16,22 +16,22 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect - github.com/hashicorp/terraform-plugin-framework v1.5.0 + github.com/hashicorp/terraform-plugin-framework v1.6.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.21.0 - github.com/hashicorp/terraform-plugin-mux v0.14.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 + github.com/hashicorp/terraform-plugin-go v0.22.1 + github.com/hashicorp/terraform-plugin-mux v0.15.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hashicorp/terraform-svchost v0.1.1 - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.2 - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) require ( @@ -56,7 +56,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/grpc v1.61.0 // indirect + google.golang.org/grpc v1.62.1 // indirect ) require ( @@ -65,19 +65,19 @@ require ( ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/hashicorp/hc-install v0.6.2 // indirect + github.com/hashicorp/hc-install v0.6.3 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/kr/pretty v0.2.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/mod v0.14.0 // indirect + golang.org/x/mod v0.15.0 // indirect golang.org/x/sync v0.6.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 795309a1c..230ba725d 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= @@ -26,12 +28,15 @@ github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FM github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -80,6 +85,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M= github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= +github.com/hashicorp/hc-install v0.6.3 h1:yE/r1yJvWbtrJ0STwScgEnCanb0U9v7zp0Gbkmcoxqs= +github.com/hashicorp/hc-install v0.6.3/go.mod h1:KamGdbodYzlufbWh4r9NRo8y6GLHWZP2GBtdnms1Ln0= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= @@ -94,16 +101,24 @@ github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRy github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= +github.com/hashicorp/terraform-plugin-framework v1.6.1 h1:hw2XrmUu8d8jVL52ekxim2IqDc+2Kpekn21xZANARLU= +github.com/hashicorp/terraform-plugin-framework v1.6.1/go.mod h1:aJI+n/hBPhz1J+77GdgNfk5svW12y7fmtxe/5L5IuwI= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= +github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= +github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= +github.com/hashicorp/terraform-plugin-mux v0.15.0 h1:+/+lDx0WUsIOpkAmdwBIoFU8UP9o2eZASoOnLsWbKME= +github.com/hashicorp/terraform-plugin-mux v0.15.0/go.mod h1:9ezplb1Dyq394zQ+ldB0nvy/qbNAz3mMoHHseMTMaKo= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -134,6 +149,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -179,11 +196,15 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -194,8 +215,12 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -223,6 +248,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -256,12 +283,18 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 860fce22b6b2eb7a53d8c5becd22573ce5e3d005 Mon Sep 17 00:00:00 2001 From: Mark DeCrane Date: Tue, 12 Mar 2024 17:24:22 -0400 Subject: [PATCH 286/420] chore: run tidy --- go.sum | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/go.sum b/go.sum index 230ba725d..663f8d970 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= @@ -13,8 +11,6 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -26,17 +22,14 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= -github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= +github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -83,8 +76,6 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M= -github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= github.com/hashicorp/hc-install v0.6.3 h1:yE/r1yJvWbtrJ0STwScgEnCanb0U9v7zp0Gbkmcoxqs= github.com/hashicorp/hc-install v0.6.3/go.mod h1:KamGdbodYzlufbWh4r9NRo8y6GLHWZP2GBtdnms1Ln0= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -99,24 +90,16 @@ github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8J github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= -github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework v1.6.1 h1:hw2XrmUu8d8jVL52ekxim2IqDc+2Kpekn21xZANARLU= github.com/hashicorp/terraform-plugin-framework v1.6.1/go.mod h1:aJI+n/hBPhz1J+77GdgNfk5svW12y7fmtxe/5L5IuwI= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= -github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= -github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= github.com/hashicorp/terraform-plugin-mux v0.15.0 h1:+/+lDx0WUsIOpkAmdwBIoFU8UP9o2eZASoOnLsWbKME= github.com/hashicorp/terraform-plugin-mux v0.15.0/go.mod h1:9ezplb1Dyq394zQ+ldB0nvy/qbNAz3mMoHHseMTMaKo= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= @@ -147,8 +130,6 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -192,17 +173,10 @@ github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgr golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -210,22 +184,14 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -242,27 +208,16 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -271,7 +226,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -281,18 +235,12 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From eec4d77eb0d6a5bbb2905e72605d893e420cc9fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:19:01 -0500 Subject: [PATCH 287/420] Build(deps): Bump actions/checkout from 4.1.1 to 4.1.2 (#1283) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/b4ffde65f46336ab88eb53be808477a3936bae11...9bb56186c3b09b4f86b1c65136769dd318469633) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7521e7b56..8c000fe9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index d4791bba8..b157f3349 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 29e1a6986..aeb2998af 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index f4db5b344..0f3ba52e9 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d2f60f7d..e45101d3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: fetch-depth: 0 - name: Generate Release Notes From 441656a198d4b16d091d26bfde21358e6ef77b27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:19:41 -0500 Subject: [PATCH 288/420] Build(deps): Bump github.com/zclconf/go-cty from 1.14.2 to 1.14.3 (#1277) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.14.2...v1.14.3) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e1f7dd409..fc4657c9e 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/zclconf/go-cty v1.14.2 + github.com/zclconf/go-cty v1.14.3 golang.org/x/crypto v0.19.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect diff --git a/go.sum b/go.sum index 663f8d970..d4b9edbae 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= -github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho= +github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= From fa124c5ee48d42f22fa2a281747a86f59b65974d Mon Sep 17 00:00:00 2001 From: Lauren Date: Tue, 12 Mar 2024 17:45:50 -0500 Subject: [PATCH 289/420] refactor registry mod delete method (#1267) --- CHANGELOG.md | 3 ++ .../provider/resource_tfe_registry_module.go | 32 ++++++++++++++----- .../resource_tfe_registry_module_test.go | 1 + 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa3cd868..4813d6bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ BUG FIXES: * `r/tfe_workspace`: Change the error message returned when a workspace cannot be safe-deleted to reflect that the error can happen when the latest state is still being processed @uturunku1 [1274](https://github.com/hashicorp/terraform-provider-tfe/pull/1274) +ENHANCEMENTS: +* `r/tfe_registry_module`: Update `Delete` method to call `DeleteByName` when `module_provider` is not present, and `DeleteProvider` when `module_provider` exists @laurenolivia[1267](https://github.com/hashicorp/terraform-provider-tfe/pull/1267) + ## v0.52.0 FEATURES: diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index e1e874763..8c85b64be 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -10,6 +10,7 @@ package provider import ( "context" + "errors" "fmt" "log" "strings" @@ -414,15 +415,30 @@ func resourceTFERegistryModuleRead(d *schema.ResourceData, meta interface{}) err func resourceTFERegistryModuleDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(ConfiguredClient) - log.Printf("[DEBUG] Delete registry module: %s", d.Id()) - organization := d.Get("organization").(string) - name := d.Get("name").(string) - err := config.Client.RegistryModules.Delete(ctx, organization, name) - if err != nil { - if err == tfe.ErrResourceNotFound { - return nil + // Fields required to delete registry module by provider + // To delete by name, Provider field is not required + rModID := tfe.RegistryModuleID{ + Organization: d.Get("organization").(string), + Name: d.Get("name").(string), + Provider: d.Get("module_provider").(string), + Namespace: d.Get("namespace").(string), + RegistryName: tfe.RegistryName(d.Get("registry_name").(string)), + } + + if v, ok := d.GetOk("module_provider"); ok && v.(string) != "" { + log.Printf("[DEBUG] Delete registry module by provider: %s", d.Id()) + + err := config.Client.RegistryModules.DeleteProvider(ctx, rModID) + if err != nil && !errors.Is(err, tfe.ErrResourceNotFound) { + return fmt.Errorf("error deleting registry module provider: %w", err) + } + } else { + log.Printf("[DEBUG] Delete registry module by name: %s", d.Id()) + + err := config.Client.RegistryModules.DeleteByName(ctx, rModID) + if err != nil && !errors.Is(err, tfe.ErrResourceNotFound) { + return fmt.Errorf("Error deleting registry module %s: %w", d.Id(), err) } - return fmt.Errorf("Error deleting registry module %s: %w", d.Id(), err) } return nil diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index 6a1038f94..0a0d02515 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -803,6 +803,7 @@ func TestAccTFERegistryModule_invalidWithRegistryNameAndNoModuleProvider(t *test }, }) } + func testAccCheckTFERegistryModuleExists(n string, rmID tfe.RegistryModuleID, registryModule *tfe.RegistryModule) resource.TestCheckFunc { return func(s *terraform.State) error { config := testAccProvider.Meta().(ConfiguredClient) From 2d7e11fad675730bbc58872c4f3949ed3370eadb Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:47:59 -0400 Subject: [PATCH 290/420] Update resource_tfe_project_test.go --- internal/provider/resource_tfe_project_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index faea2bb7f..f2349bcdc 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -103,6 +103,7 @@ func TestAccTFEProject_update(t *testing.T) { } func TestAccTFEProject_import(t *testing.T) { + skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() project := &tfe.Project{} resource.Test(t, resource.TestCase{ From 9c8551dfc21ae4e0da88b73138024ab4f436100a Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:23:55 -0400 Subject: [PATCH 291/420] Update CHANGELOG.md Co-authored-by: Mark DeCrane --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3e39b602..c03dfc029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ENHANCEMENTS: * `r/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) -* `d/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) From 8eaf036093547ca2fbb7298cc6ec62683c3c462e Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:36:01 -0400 Subject: [PATCH 292/420] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c03dfc029..a3e39b602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ENHANCEMENTS: * `r/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) +* `d/tfe_project`: Add `description` attribute, by @netramali [1271](https://github.com/hashicorp/terraform-provider-tfe/pull/1271) FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) From e0b9a07bcb4cadd6cb82e0e24d962ad23665656b Mon Sep 17 00:00:00 2001 From: Rolee Sinha <99283890+roleesinhaHC@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:22:12 -0700 Subject: [PATCH 293/420] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d70238196..667febbf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) -* `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @rolee.sinha [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255) +* `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @roleesinhaHC [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255) BUG FIXES: From 154242268571482c304be9679886e53014f5e9ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:53:38 -0500 Subject: [PATCH 294/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.47.0 to 1.47.1 (#1287) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.47.0 to 1.47.1. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.47.0...v1.47.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fc4657c9e..f7e95eb8e 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.47.0 + github.com/hashicorp/go-tfe v1.47.1 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index d4b9edbae..3fdfc613f 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.47.0 h1:WeQ1bVDDcU+U+kgcP341brmCO4fE7WW19euLS8Weazw= -github.com/hashicorp/go-tfe v1.47.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= +github.com/hashicorp/go-tfe v1.47.1 h1:+DkqcPK6RGEsCC34vFau8/yOky4ST84o8AFdB6NbrJg= +github.com/hashicorp/go-tfe v1.47.1/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 61dccf0057565036ae97498c58def9abda6eab78 Mon Sep 17 00:00:00 2001 From: Mark DeCrane Date: Thu, 14 Mar 2024 11:29:15 -0400 Subject: [PATCH 295/420] Updating changelog, readme, docs for 0.53.0 release --- CHANGELOG.md | 2 ++ README.md | 5 ++--- website/docs/index.html.markdown | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4813d6bd3..d926f8156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## UNRELEASED +## v0.53.0 + FEATURES: * `r/tfe_workspace`: Add `ignore_additional_tag_names` which explicitly ignores `tag_names` _not_ defined by config so they will not be overwritten by the configured tags, by @brandonc and @mbillow [1254](https://github.com/hashicorp/terraform-provider-tfe/pull/1254) diff --git a/README.md b/README.md index 62f1af9ab..46be170f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ Terraform - # Terraform Cloud/Enterprise Provider The official Terraform provider for [Terraform Cloud/Enterprise](https://www.hashicorp.com/products/terraform). @@ -29,7 +28,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.51.1" + version = "~> 0.53.0" } } } @@ -45,7 +44,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.53.0" ... } ``` diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index dd9dfbf81..51add7bd3 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.52.0" + version = "~> 0.53.0" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.52.0" + version = "~> 0.53.0" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.52.0" + version = "~> 0.53.0" } # Create an organization From 93f0a4a59e73788fc2760d5c4ea05e55592d0bb1 Mon Sep 17 00:00:00 2001 From: Maed223 <72527044+Maed223@users.noreply.github.com> Date: Thu, 14 Mar 2024 16:15:08 +0000 Subject: [PATCH 296/420] cdktf: update documentation --- .../d/github_installation.html.markdown | 17 +- .../csharp/d/no_code_module.html.markdown | 42 +++ .../cdktf/csharp/d/organization.html.markdown | 9 +- .../cdktf/csharp/d/policy_set.html.markdown | 4 +- .../csharp/d/registry_gpg_key.html.markdown | 47 +++ .../csharp/d/registry_gpg_keys.html.markdown | 48 +++ .../csharp/d/registry_provider.html.markdown | 73 +++++ .../csharp/d/registry_providers.html.markdown | 94 ++++++ .../cdktf/csharp/d/workspace.html.markdown | 4 +- website/docs/cdktf/csharp/index.html.markdown | 8 +- .../r/admin_organization_settings.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 67 ++-- .../cdktf/csharp/r/opa_version.html.markdown | 68 ++++ .../cdktf/csharp/r/organization.html.markdown | 5 +- ...rganization_default_settings.html.markdown | 68 ++++ .../cdktf/csharp/r/policy_set.html.markdown | 35 +- .../csharp/r/registry_gpg_key.html.markdown | 48 +++ .../csharp/r/registry_module.html.markdown | 46 ++- .../csharp/r/registry_provider.html.markdown | 103 ++++++ .../csharp/r/sentinel_version.html.markdown | 68 ++++ .../r/team_project_access.html.markdown | 2 +- .../cdktf/csharp/r/workspace.html.markdown | 47 +-- .../csharp/r/workspace_settings.markdown | 145 +++++++++ .../go/d/github_installation.html.markdown | 17 +- .../cdktf/go/d/no_code_module.html.markdown | 42 +++ .../cdktf/go/d/organization.html.markdown | 9 +- .../docs/cdktf/go/d/policy_set.html.markdown | 4 +- .../cdktf/go/d/registry_gpg_key.html.markdown | 50 +++ .../go/d/registry_gpg_keys.html.markdown | 51 +++ .../go/d/registry_provider.html.markdown | 79 +++++ .../go/d/registry_providers.html.markdown | 103 ++++++ .../docs/cdktf/go/d/workspace.html.markdown | 4 +- website/docs/cdktf/go/index.html.markdown | 8 +- .../go/r/admin_organization_settings.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 71 ++--- .../docs/cdktf/go/r/opa_version.html.markdown | 71 +++++ .../cdktf/go/r/organization.html.markdown | 5 +- ...rganization_default_settings.html.markdown | 76 +++++ .../docs/cdktf/go/r/policy_set.html.markdown | 35 +- .../cdktf/go/r/registry_gpg_key.html.markdown | 48 +++ .../cdktf/go/r/registry_module.html.markdown | 53 +++- .../go/r/registry_provider.html.markdown | 111 +++++++ .../cdktf/go/r/sentinel_version.html.markdown | 71 +++++ .../go/r/team_project_access.html.markdown | 2 +- .../docs/cdktf/go/r/workspace.html.markdown | 49 +-- .../cdktf/go/r/workspace_settings.markdown | 169 ++++++++++ .../java/d/github_installation.html.markdown | 17 +- .../cdktf/java/d/no_code_module.html.markdown | 42 +++ .../cdktf/java/d/organization.html.markdown | 9 +- .../cdktf/java/d/policy_set.html.markdown | 4 +- .../java/d/registry_gpg_key.html.markdown | 46 +++ .../java/d/registry_gpg_keys.html.markdown | 47 +++ .../java/d/registry_provider.html.markdown | 71 +++++ .../java/d/registry_providers.html.markdown | 91 ++++++ .../docs/cdktf/java/d/workspace.html.markdown | 4 +- website/docs/cdktf/java/index.html.markdown | 8 +- .../r/admin_organization_settings.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 69 ++-- .../cdktf/java/r/opa_version.html.markdown | 67 ++++ .../cdktf/java/r/organization.html.markdown | 5 +- ...rganization_default_settings.html.markdown | 70 ++++ .../cdktf/java/r/policy_set.html.markdown | 35 +- .../java/r/registry_gpg_key.html.markdown | 48 +++ .../java/r/registry_module.html.markdown | 47 ++- .../java/r/registry_provider.html.markdown | 103 ++++++ .../java/r/sentinel_version.html.markdown | 67 ++++ .../java/r/team_project_access.html.markdown | 2 +- .../docs/cdktf/java/r/workspace.html.markdown | 49 +-- .../cdktf/java/r/workspace_settings.markdown | 149 +++++++++ .../cdktf/python/d/agent_pool.html.markdown | 17 +- .../d/github_installation.html.markdown | 32 +- .../cdktf/python/d/ip_ranges.html.markdown | 21 +- .../python/d/no_code_module.html.markdown | 33 +- .../cdktf/python/d/oauth_client.html.markdown | 47 ++- .../cdktf/python/d/organization.html.markdown | 17 +- .../d/organization_members.html.markdown | 22 +- .../d/organization_membership.html.markdown | 47 ++- .../d/organization_run_task.html.markdown | 17 +- .../python/d/organization_tags.html.markdown | 17 +- .../python/d/organizations.html.markdown | 17 +- .../docs/cdktf/python/d/outputs.html.markdown | 39 +-- .../cdktf/python/d/policy_set.html.markdown | 17 +- .../docs/cdktf/python/d/project.html.markdown | 17 +- .../python/d/registry_gpg_key.html.markdown | 17 +- .../python/d/registry_gpg_keys.html.markdown | 17 +- .../python/d/registry_provider.html.markdown | 32 +- .../python/d/registry_providers.html.markdown | 47 ++- .../python/d/saml_settings.html.markdown | 42 +-- .../docs/cdktf/python/d/slug.html.markdown | 22 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/d/team.html.markdown | 17 +- .../cdktf/python/d/team_access.html.markdown | 17 +- .../d/team_project_access.html.markdown | 17 +- .../docs/cdktf/python/d/teams.html.markdown | 17 +- .../cdktf/python/d/variable_set.html.markdown | 17 +- .../cdktf/python/d/variables.html.markdown | 43 ++- .../cdktf/python/d/workspace.html.markdown | 17 +- .../python/d/workspace_ids.html.markdown | 23 +- .../python/d/workspace_run_task.html.markdown | 17 +- website/docs/cdktf/python/index.html.markdown | 51 ++- .../r/admin_organization_settings.markdown | 74 ++--- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 72 ++--- .../cdktf/python/r/agent_token.html.markdown | 27 +- .../python/r/no_code_module.html.markdown | 56 ++-- .../notification_configuration.html.markdown | 96 +++--- .../cdktf/python/r/oauth_client.html.markdown | 47 ++- .../cdktf/python/r/opa_version.html.markdown | 17 +- .../cdktf/python/r/organization.html.markdown | 17 +- ...rganization_default_settings.html.markdown | 35 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../python/r/organization_token.html.markdown | 48 +-- .../docs/cdktf/python/r/policy.html.markdown | 32 +- .../cdktf/python/r/policy_set.html.markdown | 121 +++---- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 61 ++-- .../r/project_variable_set.html.markdown | 35 +- .../python/r/registry_gpg_key.html.markdown | 23 +- .../python/r/registry_module.html.markdown | 146 ++++----- .../python/r/registry_provider.html.markdown | 44 ++- .../cdktf/python/r/run_trigger.html.markdown | 33 +- .../python/r/saml_settings.html.markdown | 35 +- .../python/r/sentinel_policy.html.markdown | 17 +- .../python/r/sentinel_version.html.markdown | 17 +- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 32 +- .../cdktf/python/r/team_access.html.markdown | 27 +- .../cdktf/python/r/team_member.html.markdown | 22 +- .../cdktf/python/r/team_members.html.markdown | 63 ++-- .../r/team_organization_member.html.markdown | 29 +- .../r/team_organization_members.html.markdown | 72 ++--- .../r/team_project_access.html.markdown | 53 ++-- .../cdktf/python/r/team_token.html.markdown | 65 ++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 +++---- .../cdktf/python/r/variable_set.html.markdown | 115 +++---- .../cdktf/python/r/workspace.html.markdown | 49 ++- .../r/workspace_policy_set.html.markdown | 35 +- ...rkspace_policy_set_exclusion.html.markdown | 35 +- .../python/r/workspace_run.html.markdown | 110 +++---- .../python/r/workspace_run_task.html.markdown | 25 +- .../python/r/workspace_settings.markdown | 98 +++--- .../r/workspace_variable_set.html.markdown | 35 +- .../typescript/d/agent_pool.html.markdown | 21 +- .../d/github_installation.html.markdown | 58 ++-- .../typescript/d/ip_ranges.html.markdown | 29 +- .../typescript/d/no_code_module.html.markdown | 36 +-- .../typescript/d/oauth_client.html.markdown | 65 ++-- .../typescript/d/organization.html.markdown | 23 +- .../d/organization_members.html.markdown | 26 +- .../d/organization_membership.html.markdown | 89 +++--- .../d/organization_run_task.html.markdown | 31 +- .../d/organization_tags.html.markdown | 23 +- .../typescript/d/organizations.html.markdown | 21 +- .../cdktf/typescript/d/outputs.html.markdown | 51 +-- .../typescript/d/policy_set.html.markdown | 21 +- .../cdktf/typescript/d/project.html.markdown | 21 +- .../d/registry_gpg_key.html.markdown | 21 +- .../d/registry_gpg_keys.html.markdown | 21 +- .../d/registry_provider.html.markdown | 42 ++- .../d/registry_providers.html.markdown | 71 ++--- .../typescript/d/saml_settings.html.markdown | 41 +-- .../cdktf/typescript/d/slug.html.markdown | 28 +- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +- .../cdktf/typescript/d/team.html.markdown | 21 +- .../typescript/d/team_access.html.markdown | 23 +- .../d/team_project_access.html.markdown | 21 +- .../cdktf/typescript/d/teams.html.markdown | 21 +- .../typescript/d/variable_set.html.markdown | 21 +- .../typescript/d/variables.html.markdown | 79 ++--- .../typescript/d/workspace.html.markdown | 23 +- .../typescript/d/workspace_ids.html.markdown | 29 +- .../d/workspace_run_task.html.markdown | 21 +- .../docs/cdktf/typescript/index.html.markdown | 69 ++-- .../r/admin_organization_settings.markdown | 73 ++--- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 78 ++--- .../typescript/r/agent_token.html.markdown | 49 +-- .../typescript/r/no_code_module.html.markdown | 140 ++++---- .../notification_configuration.html.markdown | 224 +++++++------ .../typescript/r/oauth_client.html.markdown | 75 ++--- .../typescript/r/opa_version.html.markdown | 21 +- .../typescript/r/organization.html.markdown | 23 +- ...rganization_default_settings.html.markdown | 67 ++-- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 23 +- .../r/organization_run_task.html.markdown | 21 +- .../r/organization_token.html.markdown | 51 +-- .../cdktf/typescript/r/policy.html.markdown | 44 ++- .../typescript/r/policy_set.html.markdown | 124 +++----- .../r/policy_set_parameter.html.markdown | 48 +-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 60 ++-- .../r/project_variable_set.html.markdown | 60 ++-- .../r/registry_gpg_key.html.markdown | 24 +- .../r/registry_module.html.markdown | 300 ++++++++++-------- .../r/registry_provider.html.markdown | 84 ++--- .../typescript/r/run_trigger.html.markdown | 63 ++-- .../typescript/r/saml_settings.html.markdown | 38 +-- .../r/sentinel_policy.html.markdown | 25 +- .../r/sentinel_version.html.markdown | 21 +- .../cdktf/typescript/r/ssh_key.html.markdown | 21 +- .../cdktf/typescript/r/team.html.markdown | 40 +-- .../typescript/r/team_access.html.markdown | 33 +- .../typescript/r/team_member.html.markdown | 26 +- .../typescript/r/team_members.html.markdown | 68 ++-- .../r/team_organization_member.html.markdown | 47 ++- .../r/team_organization_members.html.markdown | 115 ++++--- .../r/team_project_access.html.markdown | 67 ++-- .../typescript/r/team_token.html.markdown | 56 ++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 ++++----- .../typescript/r/variable_set.html.markdown | 165 +++++----- .../typescript/r/workspace.html.markdown | 83 +++-- .../r/workspace_policy_set.html.markdown | 53 ++-- ...rkspace_policy_set_exclusion.html.markdown | 61 ++-- .../typescript/r/workspace_run.html.markdown | 192 ++++++----- .../r/workspace_run_task.html.markdown | 28 +- .../typescript/r/workspace_settings.markdown | 156 ++++----- .../r/workspace_variable_set.html.markdown | 57 ++-- 223 files changed, 6191 insertions(+), 4393 deletions(-) create mode 100644 website/docs/cdktf/csharp/d/no_code_module.html.markdown create mode 100644 website/docs/cdktf/csharp/d/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/csharp/d/registry_gpg_keys.html.markdown create mode 100644 website/docs/cdktf/csharp/d/registry_provider.html.markdown create mode 100644 website/docs/cdktf/csharp/d/registry_providers.html.markdown create mode 100644 website/docs/cdktf/csharp/r/opa_version.html.markdown create mode 100644 website/docs/cdktf/csharp/r/organization_default_settings.html.markdown create mode 100644 website/docs/cdktf/csharp/r/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/csharp/r/registry_provider.html.markdown create mode 100644 website/docs/cdktf/csharp/r/sentinel_version.html.markdown create mode 100644 website/docs/cdktf/csharp/r/workspace_settings.markdown create mode 100644 website/docs/cdktf/go/d/no_code_module.html.markdown create mode 100644 website/docs/cdktf/go/d/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/go/d/registry_gpg_keys.html.markdown create mode 100644 website/docs/cdktf/go/d/registry_provider.html.markdown create mode 100644 website/docs/cdktf/go/d/registry_providers.html.markdown create mode 100644 website/docs/cdktf/go/r/opa_version.html.markdown create mode 100644 website/docs/cdktf/go/r/organization_default_settings.html.markdown create mode 100644 website/docs/cdktf/go/r/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/go/r/registry_provider.html.markdown create mode 100644 website/docs/cdktf/go/r/sentinel_version.html.markdown create mode 100644 website/docs/cdktf/go/r/workspace_settings.markdown create mode 100644 website/docs/cdktf/java/d/no_code_module.html.markdown create mode 100644 website/docs/cdktf/java/d/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/java/d/registry_gpg_keys.html.markdown create mode 100644 website/docs/cdktf/java/d/registry_provider.html.markdown create mode 100644 website/docs/cdktf/java/d/registry_providers.html.markdown create mode 100644 website/docs/cdktf/java/r/opa_version.html.markdown create mode 100644 website/docs/cdktf/java/r/organization_default_settings.html.markdown create mode 100644 website/docs/cdktf/java/r/registry_gpg_key.html.markdown create mode 100644 website/docs/cdktf/java/r/registry_provider.html.markdown create mode 100644 website/docs/cdktf/java/r/sentinel_version.html.markdown create mode 100644 website/docs/cdktf/java/r/workspace_settings.markdown diff --git a/website/docs/cdktf/csharp/d/github_installation.html.markdown b/website/docs/cdktf/csharp/d/github_installation.html.markdown index 72fe93ac1..a562458bd 100644 --- a/website/docs/cdktf/csharp/d/github_installation.html.markdown +++ b/website/docs/cdktf/csharp/d/github_installation.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on the Github App Installation. --- + + # Data Source: tfe_github_app_installation Use this data source to get information about the Github App Installation. @@ -24,7 +26,7 @@ class MyConvertedCode : TerraformStack public MyConvertedCode(Construct scope, string name) : base(scope, name) { new DataTfeGithubAppInstallation.DataTfeGithubAppInstallation(this, "gha_installation", new DataTfeGithubAppInstallationConfig { - InstallationId = 12345 + InstallationId = 12345678 }); } } @@ -43,7 +45,7 @@ class MyConvertedCode : TerraformStack public MyConvertedCode(Construct scope, string name) : base(scope, name) { new DataTfeGithubAppInstallation.DataTfeGithubAppInstallation(this, "gha_installation", new DataTfeGithubAppInstallationConfig { - Name = "installation_name" + Name = "github_username_or_organization" }); } } @@ -51,11 +53,11 @@ class MyConvertedCode : TerraformStack ## Argument Reference -The following arguments are supported. At least one of `Name`, `InstallationId` must be set. +The following arguments are supported. At least one of `Name`, `InstallationId` must be set. + +* `InstallationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `Https://githubCom/settings/installations/12345678`. +* `Name` - (Optional) Name of the Github user or organization account that installed the app. -* `InstallationId` - (Optional) ID of the Github Installation as shown in Github. -* `Name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `InstallationId` or `Name`. ## Attributes Reference @@ -63,4 +65,5 @@ Must be one of: `InstallationId` or `Name`. In addition to all arguments above, the following attributes are exported: * `Id` - The internal ID of the Github Installation. This is different from the `InstallationId`. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/no_code_module.html.markdown b/website/docs/cdktf/csharp/d/no_code_module.html.markdown new file mode 100644 index 000000000..9d77a582e --- /dev/null +++ b/website/docs/cdktf/csharp/d/no_code_module.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `Id` - ID of the no-code module. +* `Organization` - Organization name that the no-code module belongs to. +* `Namespace` - Namespace name that the no-code module belongs to. +* `RegistryModuleId` - ID of the registry module for the no-code module. +* `VersionPin` - Version number the no-code module is pinned to. +* `Enabled` - Indicates if this no-code module is currently enabled + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/organization.html.markdown b/website/docs/cdktf/csharp/d/organization.html.markdown index f87ae042a..c4fc8f4fb 100644 --- a/website/docs/cdktf/csharp/d/organization.html.markdown +++ b/website/docs/cdktf/csharp/d/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an Organization. --- + + # Data Source: tfe_organization Use this data source to get information about an organization. @@ -31,13 +33,12 @@ class MyConvertedCode : TerraformStack ## Argument Reference The following arguments are supported: -* `Name` - (Required) Name of the organization. +* `Name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `Name` - Name of the organization. * `Email` - Admin email address. * `ExternalId` - An identifier for the organization. * `AssessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. @@ -45,5 +46,7 @@ In addition to all arguments above, the following attributes are exported: * `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `OwnersTeamSamlRoleId` - The name of the "owners" team. * `SendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `DefaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/policy_set.html.markdown b/website/docs/cdktf/csharp/d/policy_set.html.markdown index 71c2914c6..81d037b37 100644 --- a/website/docs/cdktf/csharp/d/policy_set.html.markdown +++ b/website/docs/cdktf/csharp/d/policy_set.html.markdown @@ -48,6 +48,8 @@ The following arguments are supported: * `Description` - Description of the policy set. * `Global` - Whether or not the policy set applies to all workspaces in the organization. * `Kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `AgentEnabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `PolicyToolVersion` - The policy tool version to run the evaluation against. * `Overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `WorkspaceIds` - IDs of the workspaces that use the policy set. * `ExcludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. @@ -67,4 +69,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/registry_gpg_key.html.markdown b/website/docs/cdktf/csharp/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..3114101b4 --- /dev/null +++ b/website/docs/cdktf/csharp/d/registry_gpg_key.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeRegistryGpgKey.DataTfeRegistryGpgKey(this, "example", new DataTfeRegistryGpgKeyConfig { + Id = "13DFECCA3B58CE4A", + Organization = "my-org-name" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Id` - (Required) ID of the GPG key. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `AsciiArmor` - ASCII-armored representation of the GPG key. +* `CreatedAt` - The time when the GPG key was created. +* `UpdatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/csharp/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..628ce6774 --- /dev/null +++ b/website/docs/cdktf/csharp/d/registry_gpg_keys.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeRegistryGpgKeys.DataTfeRegistryGpgKeys(this, "all", new DataTfeRegistryGpgKeysConfig { + Organization = "my-org-name" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `Keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `Id` - ID of the GPG key. + * `Organization` - Name of the organization. + * `AsciiArmor` - ASCII-armored representation of the GPG key. + * `CreatedAt` - The time when the GPG key was created. + * `UpdatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/registry_provider.html.markdown b/website/docs/cdktf/csharp/d/registry_provider.html.markdown new file mode 100644 index 000000000..fcdec26cd --- /dev/null +++ b/website/docs/cdktf/csharp/d/registry_provider.html.markdown @@ -0,0 +1,73 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new RegistryProvider.RegistryProvider(this, "example", new RegistryProviderConfig { + Name = "my-provider", + Organization = "my-org-name" + }); + } +} +``` + +A public provider: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new RegistryProvider.RegistryProvider(this, "example", new RegistryProviderConfig { + Name = "aws", + Namespace = "hashicorp", + Organization = "my-org-name", + RegistryName = "public" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `Public` or `Private`. Defaults to `Private`. +* `Namespace` - (Optional) The namespace of the provider. Required if `RegistryName` is `Public`, otherwise it can't be configured, and it will be set to same value as the `Organization`. +* `Name` - (Required) Name of the provider. + +## Attributes Reference + +* `Id` - ID of the provider. +* `CreatedAt` - The time when the provider was created. +* `UpdatedAt` - The time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/registry_providers.html.markdown b/website/docs/cdktf/csharp/d/registry_providers.html.markdown new file mode 100644 index 000000000..f3e82e314 --- /dev/null +++ b/website/docs/cdktf/csharp/d/registry_providers.html.markdown @@ -0,0 +1,94 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + + + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeRegistryProviders.DataTfeRegistryProviders(this, "all", new DataTfeRegistryProvidersConfig { + Organization = "my-org-name" + }); + } +} +``` + +All private providers: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeRegistryProviders.DataTfeRegistryProviders(this, "private", new DataTfeRegistryProvidersConfig { + Organization = "my-org-name", + RegistryName = "private" + }); + } +} +``` + +Providers with "hashicorp" in their namespace or name: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new DataTfeRegistryProviders.DataTfeRegistryProviders(this, "hashicorp", new DataTfeRegistryProvidersConfig { + Organization = "my-org-name", + Search = "hashicorp" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether to list only public or private providers. Must be either `Public` or `Private`. +* `Search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `Providers` - List of the providers. Each element contains the following attributes: + * `Id` - ID of the provider. + * `Organization` - Name of the organization. + * `RegistryName` - Whether this is a publicly maintained provider or private. + * `Namespace` - Namespace of the provider. + * `Name` - Name of the provider. + * `CreatedAt` - Time when the provider was created. + * `UpdatedAt` - Time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/workspace.html.markdown b/website/docs/cdktf/csharp/d/workspace.html.markdown index eacbfd771..baef07cdf 100644 --- a/website/docs/cdktf/csharp/d/workspace.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace.html.markdown @@ -73,7 +73,7 @@ In addition to all arguments above, the following attributes are exported: * `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `VcsRepo` - Settings for the workspace's VCS repository. * `WorkingDirectory` - A relative path that Terraform will execute within. -* `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `Remote`, `Local`, or `Agent`. +* `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`TfeWorkspaceSettings` resource](tfe_workspace_settings) for details. * `HtmlUrl` - The URL to the browsable HTML overview of the workspace @@ -88,4 +88,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index cea2a6a1c..c87eddf03 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.51.1" + version = "~> 0.53.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.53.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.51.1" + version = "~> 0.53.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/admin_organization_settings.markdown b/website/docs/cdktf/csharp/r/admin_organization_settings.markdown index f9f49c9d2..76ce2f2e8 100644 --- a/website/docs/cdktf/csharp/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/csharp/r/admin_organization_settings.markdown @@ -5,6 +5,8 @@ description: |- Manages admin settings for an organization (Terraform Enterprise Only). --- + + # tfe_admin_organization_settings Manage admin settings for an organization. This resource requires the @@ -64,8 +66,4 @@ The following arguments are supported: * `SsoEnabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown index b04692099..87264830a 100644 --- a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -17,36 +17,38 @@ for Business account. ## Example Usage -Basic usage: - -```csharp -using Constructs; -using HashiCorp.Cdktf; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -using Gen.Providers.Tfe; -class MyConvertedCode : TerraformStack -{ - public MyConvertedCode(Construct scope, string name) : base(scope, name) - { - var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { - Email = "admin@company.com", - Name = "my-org-name" - }); - var tfeWorkspaceTestWorkspace = new Workspace.Workspace(this, "test-workspace", new WorkspaceConfig { - Name = "my-workspace-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name) - }); - var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { - Name = "my-agent-pool-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name), - OrganizationScoped = false - }); - new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig { - AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), - AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTestWorkspace.Id) } - }); - } +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -66,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/opa_version.html.markdown b/website/docs/cdktf/csharp/r/opa_version.html.markdown new file mode 100644 index 000000000..3445e35ce --- /dev/null +++ b/website/docs/cdktf/csharp/r/opa_version.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + + + +# tfe_opa_version + +Manage OPA versions available on Terraform Enterprise. + +## Example Usage + +Basic Usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new OpaVersion.OpaVersion(this, "test", new OpaVersionConfig { + Sha = "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + Url = "https://tfe-host.com/path/to/opa", + Version = "0.58.0-custom" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `Url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `Sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `Official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `Deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `DeprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `Deprecated` is true. + +## Attributes Reference + +* `Id` The ID of the OPA version + +## Import + +OPA versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization.html.markdown b/website/docs/cdktf/csharp/r/organization.html.markdown index da087c241..9731348cc 100644 --- a/website/docs/cdktf/csharp/r/organization.html.markdown +++ b/website/docs/cdktf/csharp/r/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Manages organizations. --- + + # tfe_organization Manages organizations. @@ -46,6 +48,7 @@ The following arguments are supported: * `OwnersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `SendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `AggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `SendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. * `AssessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `AllowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. @@ -62,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown b/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown new file mode 100644 index 000000000..b3e87d051 --- /dev/null +++ b/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_settings +description: |- + Sets the workspace defaults for an organization +--- + + + +# tfe_organization_default_settings + +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). + +## Example Usage + +Basic usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeAgentPoolMyAgents = new AgentPool.AgentPool(this, "my_agents", new AgentPoolConfig { + Name = "agent_smiths", + Organization = Token.AsString(tfeOrganizationTest.Name) + }); + var tfeOrganizationDefaultSettingsOrgDefault = + new OrganizationDefaultSettings.OrganizationDefaultSettings(this, "org_default", new OrganizationDefaultSettingsConfig { + DefaultAgentPoolId = Token.AsString(tfeAgentPoolMyAgents.Id), + DefaultExecutionMode = "agent", + Organization = Token.AsString(tfeOrganizationTest.Name) + }); + new Workspace.Workspace(this, "my_workspace", new WorkspaceConfig { + DependsOn = new [] { tfeOrganizationDefaultSettingsOrgDefault }, + Name = "my-workspace" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `DefaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `Remote`, `Local` or`Agent`. +* `DefaultAgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `DefaultExecutionMode` to be set to `Agent`. This value _must not_ be provided if `DefaultExecutionMode` is set to any other value. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/policy_set.html.markdown b/website/docs/cdktf/csharp/r/policy_set.html.markdown index c153e085c..ce16d3adb 100644 --- a/website/docs/cdktf/csharp/r/policy_set.html.markdown +++ b/website/docs/cdktf/csharp/r/policy_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages policy sets. --- + + # tfe_policy_set Policies are rules enforced on Terraform runs. Two policy-as-code frameworks are @@ -21,12 +23,14 @@ Basic usage (VCS-based policy set): ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] vcs_repo { identifier = "my-org-name/my-policy-set-repository" @@ -41,12 +45,14 @@ Using manually-specified policies: ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } ``` @@ -81,6 +87,9 @@ The following arguments are supported: * `Kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `Sentinel` if not provided. Valid values are `Sentinel` and `Opa`. A policy set can only have policies that have the same underlying kind. +* `AgentEnabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `PolicyToolVersion` - (Optional) The policy tool version to run the evaluation against. * `Overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `False`. Only valid for OPA policies. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -126,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/registry_gpg_key.html.markdown b/website/docs/cdktf/csharp/r/registry_gpg_key.html.markdown new file mode 100644 index 000000000..00c924dd0 --- /dev/null +++ b/website/docs/cdktf/csharp/r/registry_gpg_key.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Manages private registry GPG keys. +--- + + + +# tfe_registry_gpg_key + +Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. + +The provided GPG key must be ASCII-armored, i.e. starting with: +"`-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n...`". + +## Example Usage + +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") +} +``` + +## Argument Reference + +The following arguments are supported: + +* `AsciiArmor` - (Required) ASCII-armored representation of the GPG key. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `Id` - ID of the GPG key. +* `CreatedAt` - The time when the GPG key was created. +* `UpdatedAt` - The time when the GPG key was last updated. + +## Import + +Keys can be imported; use `/` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index 1fb935029..d79ea5c63 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -47,6 +47,44 @@ class MyConvertedCode : TerraformStack } ``` +Create private registry module with tests enabled: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeOauthClientTestOauthClient = new OauthClient.OauthClient(this, "test-oauth-client", new OauthClientConfig { + ApiUrl = "https://api.github.com", + HttpUrl = "https://github.com", + OauthToken = "my-vcs-provider-token", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name), + ServiceProvider = "github" + }); + new RegistryModule.RegistryModule(this, "test-registry-module", new RegistryModuleConfig { + TestConfig = new [] { new RegistryModuleTestConfig { + TestsEnabled = true + } }, + VcsRepo = new RegistryModuleVcsRepo { + Branch = "main", + DisplayIdentifier = "my-org-name/terraform-provider-name", + Identifier = "my-org-name/terraform-provider-name", + OauthTokenId = Token.AsString(tfeOauthClientTestOauthClient.OauthTokenId) + } + }); + } +} +``` + Create private registry module with GitHub App: ```csharp @@ -176,6 +214,9 @@ The following arguments are supported: * `Namespace` - (Optional) The namespace of a public registry module. It can be used if `ModuleProvider` is set and `RegistryName` is public. * `RegistryName` - (Optional) Whether the registry module is private or public. It can be used if `ModuleProvider` is set. +The `TestConfig` block supports +* `TestsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `VcsRepo` block supports: * `DisplayIdentifier` - (Required) The display identifier for your VCS repository. @@ -186,6 +227,8 @@ The `VcsRepo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. +* `Branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `Branch` is set, `Tags` will be returned as `False`. +* `Tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `Tags` is set to `True`, the `Branch` must be set to an empty value. ## Attributes Reference @@ -194,6 +237,7 @@ The `VcsRepo` block supports: * `Name` - The name of registry module. * `Organization` - The name of the organization associated with the registry module. * `Namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `PublishingMechanism` - The publishing mechanism used when releasing new versions of the module. * `RegistryName` - The registry name of the registry module depicting whether the registry module is private or public. * `NoCode` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. @@ -212,4 +256,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/registry_provider.html.markdown b/website/docs/cdktf/csharp/r/registry_provider.html.markdown new file mode 100644 index 000000000..f6295952d --- /dev/null +++ b/website/docs/cdktf/csharp/r/registry_provider.html.markdown @@ -0,0 +1,103 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + + + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationExample = new Organization.Organization(this, "example", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeRegistryProviderExample = + new RegistryProvider.RegistryProvider(this, "example_1", new RegistryProviderConfig { + Name = "my-provider", + Organization = Token.AsString(tfeOrganizationExample.Name) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.OverrideLogicalId("example"); + } +} +``` + +Create public provider: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationExample = new Organization.Organization(this, "example", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeRegistryProviderExample = + new RegistryProvider.RegistryProvider(this, "example_1", new RegistryProviderConfig { + Name = "aws", + Namespace = "hashicorp", + Organization = Token.AsString(tfeOrganizationExample.Name), + RegistryName = "public" + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.OverrideLogicalId("example"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `Public` or `Private`. Defaults to `Private`. +* `Namespace` - (Optional) The namespace of the provider. Required if `RegistryName` is `Public`, otherwise it can't be configured, and it will be set to same value as the `Organization`. +* `Name` - (Required) Name of the provider. + +## Attributes Reference + +* `Id` - ID of the provider. +* `CreatedAt` - The time when the provider was created. +* `UpdatedAt` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/sentinel_version.html.markdown b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown new file mode 100644 index 000000000..b1c40adaf --- /dev/null +++ b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown @@ -0,0 +1,68 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + + + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + new SentinelVersion.SentinelVersion(this, "test", new SentinelVersionConfig { + Sha = "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", + Url = "https://tfe-host.com/path/to/sentinel.zip", + Version = "0.24.0-custom" + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `Sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `Official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `Deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `DeprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `Deprecated` is true. + +## Attributes Reference + +* `Id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team_project_access.html.markdown b/website/docs/cdktf/csharp/r/team_project_access.html.markdown index 2be7db365..24536719d 100644 --- a/website/docs/cdktf/csharp/r/team_project_access.html.markdown +++ b/website/docs/cdktf/csharp/r/team_project_access.html.markdown @@ -141,4 +141,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index 8eae67322..e7cf18ea1 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -11,6 +11,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -40,7 +42,7 @@ class MyConvertedCode : TerraformStack } ``` -With `ExecutionMode` of `Agent`: +Usage with vcs_repo: ```csharp using Constructs; @@ -56,15 +58,22 @@ class MyConvertedCode : TerraformStack Email = "admin@company.com", Name = "my-org-name" }); - var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { - Name = "my-agent-pool-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + var tfeOauthClientTest = new OauthClient.OauthClient(this, "test", new OauthClientConfig { + ApiUrl = "https://api.github.com", + HttpUrl = "https://github.com", + OauthToken = "oauth_token_id", + Organization = tfeOrganizationTestOrganization, + ServiceProvider = "github" }); - new Workspace.Workspace(this, "test", new WorkspaceConfig { - AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), - ExecutionMode = "agent", - Name = "my-workspace-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + new Workspace.Workspace(this, "parent", new WorkspaceConfig { + Name = "parent-ws", + Organization = tfeOrganizationTestOrganization, + QueueAllRuns = false, + VcsRepo = new WorkspaceVcsRepo { + Branch = "main", + Identifier = "my-org-name/vcs-repository", + OauthTokenId = Token.AsString(tfeOauthClientTest.OauthTokenId) + } }); } } @@ -75,20 +84,13 @@ class MyConvertedCode : TerraformStack The following arguments are supported: * `Name` - (Required) Name of the workspace. -* `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` - to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value or if `Operations` is - provided. +* `AgentPoolId` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. * `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. * `Description` - (Optional) A description for the workspace. -* `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. - Defaults to `Remote`. Using Terraform Enterprise, only `Remote`and `Local` - execution modes are valid. When set to `Local`, the workspace will be used - for state storage only. This value _must not_ be provided if `Operations` - is provided. +* `ExecutionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `True`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -132,6 +134,11 @@ The following arguments are supported: workspace will display their output as text logs. * `SshKeyId` - (Optional) The ID of an SSH key to assign to the workspace. * `TagNames` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. +* `IgnoreAdditionalTagNames` - (Optional) Explicitly ignores `TagNames` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `TagNames` and is not recommended. This value must be applied before it +will be used. * `TerraformVersion` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) @@ -166,7 +173,7 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The workspace ID. * `ResourceCount` - The number of resources managed by the workspace. -* `HtmlUrl` - The URL to the browsable HTML overview of the workspace +* `HtmlUrl` - The URL to the browsable HTML overview of the workspace. ## Import @@ -181,4 +188,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_settings.markdown b/website/docs/cdktf/csharp/r/workspace_settings.markdown new file mode 100644 index 000000000..3199f9e63 --- /dev/null +++ b/website/docs/cdktf/csharp/r/workspace_settings.markdown @@ -0,0 +1,145 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + + + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `Overwrites` argument. + +## Example Usage + +Basic usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeWorkspaceTest = new Workspace.Workspace(this, "test", new WorkspaceConfig { + Name = "my-workspace-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + }); + new WorkspaceSettings.WorkspaceSettings(this, "test-settings", new WorkspaceSettingsConfig { + ExecutionMode = "local", + WorkspaceId = Token.AsString(tfeWorkspaceTest.Id) + }); + } +} +``` + +With `ExecutionMode` of `Agent`: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeWorkspaceTest = new Workspace.Workspace(this, "test", new WorkspaceConfig { + Name = "my-workspace-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + }); + var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { + Name = "my-agent-pool-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + }); + var tfeAgentPoolAllowedWorkspacesTest = + new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test_3", new AgentPoolAllowedWorkspacesConfig { + AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), + AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTest.Id) } + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeAgentPoolAllowedWorkspacesTest.OverrideLogicalId("test"); + new WorkspaceSettings.WorkspaceSettings(this, "test-settings", new WorkspaceSettingsConfig { + AgentPoolId = Token.AsString(tfeAgentPoolAllowedWorkspacesTest.AgentPoolId), + ExecutionMode = "agent", + WorkspaceId = Token.AsString(tfeWorkspaceTest.Id) + }); + } +} +``` + +This resource may be used as a data source when no optional arguments are defined: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var dataTfeWorkspaceTest = new DataTfeWorkspace.DataTfeWorkspace(this, "test", new DataTfeWorkspaceConfig { + Name = "my-workspace-name", + Organization = "my-org-name" + }); + var tfeWorkspaceSettingsTest = + new WorkspaceSettings.WorkspaceSettings(this, "test_1", new WorkspaceSettingsConfig { + WorkspaceId = Token.AsString(dataTfeWorkspaceTest.Id) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceSettingsTest.OverrideLogicalId("test"); + new TerraformOutput(this, "workspace-explicit-local-execution", new TerraformOutputConfig { + Value = Fn.Alltrue(Token.AsAny(new [] { Op.Eq(tfeWorkspaceSettingsTest.ExecutionMode, "local"), PropertyAccess(tfeWorkspaceSettingsTest.Overwrites, new [] { "0", "\"execution_mode\"" }) })) + }); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `WorkspaceId` - (Required) ID of the workspace. +* `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` + to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. +* `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `Id` - The workspace ID. +* `Overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `ExecutionMode` - Set to `True` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `False` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `AgentPool` - Set to `True` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `False` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/github_installation.html.markdown b/website/docs/cdktf/go/d/github_installation.html.markdown index 941c10e9e..56d3c18f9 100644 --- a/website/docs/cdktf/go/d/github_installation.html.markdown +++ b/website/docs/cdktf/go/d/github_installation.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on the Github App Installation. --- + + # Data Source: tfe_github_app_installation Use this data source to get information about the Github App Installation. @@ -27,7 +29,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { this := &myConvertedCode{} cdktf.NewTerraformStack_Override(this, scope, name) dataTfeGithubAppInstallation.NewDataTfeGithubAppInstallation(this, jsii.String("gha_installation"), &dataTfeGithubAppInstallationConfig{ - installationId: jsii.Number(12345), + installationId: jsii.Number(12345678), }) return this } @@ -49,7 +51,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { this := &myConvertedCode{} cdktf.NewTerraformStack_Override(this, scope, name) dataTfeGithubAppInstallation.NewDataTfeGithubAppInstallation(this, jsii.String("gha_installation"), &dataTfeGithubAppInstallationConfig{ - name: jsii.String("installation_name"), + name: jsii.String("github_username_or_organization"), }) return this } @@ -57,11 +59,11 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { ## Argument Reference -The following arguments are supported. At least one of `Name`, `InstallationId` must be set. +The following arguments are supported. At least one of `Name`, `InstallationId` must be set. + +* `InstallationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `Https://githubCom/settings/installations/12345678`. +* `Name` - (Optional) Name of the Github user or organization account that installed the app. -* `InstallationId` - (Optional) ID of the Github Installation as shown in Github. -* `Name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `InstallationId` or `Name`. ## Attributes Reference @@ -69,4 +71,5 @@ Must be one of: `InstallationId` or `Name`. In addition to all arguments above, the following attributes are exported: * `Id` - The internal ID of the Github Installation. This is different from the `InstallationId`. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/no_code_module.html.markdown b/website/docs/cdktf/go/d/no_code_module.html.markdown new file mode 100644 index 000000000..9d77a582e --- /dev/null +++ b/website/docs/cdktf/go/d/no_code_module.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `Id` - ID of the no-code module. +* `Organization` - Organization name that the no-code module belongs to. +* `Namespace` - Namespace name that the no-code module belongs to. +* `RegistryModuleId` - ID of the registry module for the no-code module. +* `VersionPin` - Version number the no-code module is pinned to. +* `Enabled` - Indicates if this no-code module is currently enabled + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/organization.html.markdown b/website/docs/cdktf/go/d/organization.html.markdown index ad64043cc..dba59c1a3 100644 --- a/website/docs/cdktf/go/d/organization.html.markdown +++ b/website/docs/cdktf/go/d/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an Organization. --- + + # Data Source: tfe_organization Use this data source to get information about an organization. @@ -34,13 +36,12 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { ## Argument Reference The following arguments are supported: -* `Name` - (Required) Name of the organization. +* `Name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `Name` - Name of the organization. * `Email` - Admin email address. * `ExternalId` - An identifier for the organization. * `AssessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. @@ -48,5 +49,7 @@ In addition to all arguments above, the following attributes are exported: * `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `OwnersTeamSamlRoleId` - The name of the "owners" team. * `SendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `DefaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/policy_set.html.markdown b/website/docs/cdktf/go/d/policy_set.html.markdown index b2e4ddee0..6b24d9df5 100644 --- a/website/docs/cdktf/go/d/policy_set.html.markdown +++ b/website/docs/cdktf/go/d/policy_set.html.markdown @@ -51,6 +51,8 @@ The following arguments are supported: * `Description` - Description of the policy set. * `Global` - Whether or not the policy set applies to all workspaces in the organization. * `Kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `AgentEnabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `PolicyToolVersion` - The policy tool version to run the evaluation against. * `Overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `WorkspaceIds` - IDs of the workspaces that use the policy set. * `ExcludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. @@ -70,4 +72,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/registry_gpg_key.html.markdown b/website/docs/cdktf/go/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..ed45eddce --- /dev/null +++ b/website/docs/cdktf/go/d/registry_gpg_key.html.markdown @@ -0,0 +1,50 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeRegistryGpgKey" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeRegistryGpgKey.NewDataTfeRegistryGpgKey(this, jsii.String("example"), &dataTfeRegistryGpgKeyConfig{ + id: jsii.String("13DFECCA3B58CE4A"), + organization: jsii.String("my-org-name"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Id` - (Required) ID of the GPG key. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `AsciiArmor` - ASCII-armored representation of the GPG key. +* `CreatedAt` - The time when the GPG key was created. +* `UpdatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/go/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..8e09b0a64 --- /dev/null +++ b/website/docs/cdktf/go/d/registry_gpg_keys.html.markdown @@ -0,0 +1,51 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeRegistryGpgKeys" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeRegistryGpgKeys.NewDataTfeRegistryGpgKeys(this, jsii.String("all"), &dataTfeRegistryGpgKeysConfig{ + organization: jsii.String("my-org-name"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `Keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `Id` - ID of the GPG key. + * `Organization` - Name of the organization. + * `AsciiArmor` - ASCII-armored representation of the GPG key. + * `CreatedAt` - The time when the GPG key was created. + * `UpdatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/registry_provider.html.markdown b/website/docs/cdktf/go/d/registry_provider.html.markdown new file mode 100644 index 000000000..593b3e261 --- /dev/null +++ b/website/docs/cdktf/go/d/registry_provider.html.markdown @@ -0,0 +1,79 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/registryProvider" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + registryProvider.NewRegistryProvider(this, jsii.String("example"), ®istryProviderConfig{ + name: jsii.String("my-provider"), + organization: jsii.String("my-org-name"), + }) + return this +} +``` + +A public provider: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/registryProvider" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + registryProvider.NewRegistryProvider(this, jsii.String("example"), ®istryProviderConfig{ + name: jsii.String("aws"), + namespace: jsii.String("hashicorp"), + organization: jsii.String("my-org-name"), + registryName: jsii.String("public"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `Public` or `Private`. Defaults to `Private`. +* `Namespace` - (Optional) The namespace of the provider. Required if `RegistryName` is `Public`, otherwise it can't be configured, and it will be set to same value as the `Organization`. +* `Name` - (Required) Name of the provider. + +## Attributes Reference + +* `Id` - ID of the provider. +* `CreatedAt` - The time when the provider was created. +* `UpdatedAt` - The time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/registry_providers.html.markdown b/website/docs/cdktf/go/d/registry_providers.html.markdown new file mode 100644 index 000000000..67caf9bd9 --- /dev/null +++ b/website/docs/cdktf/go/d/registry_providers.html.markdown @@ -0,0 +1,103 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + + + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeRegistryProviders" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeRegistryProviders.NewDataTfeRegistryProviders(this, jsii.String("all"), &dataTfeRegistryProvidersConfig{ + organization: jsii.String("my-org-name"), + }) + return this +} +``` + +All private providers: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeRegistryProviders" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeRegistryProviders.NewDataTfeRegistryProviders(this, jsii.String("private"), &dataTfeRegistryProvidersConfig{ + organization: jsii.String("my-org-name"), + registryName: jsii.String("private"), + }) + return this +} +``` + +Providers with "hashicorp" in their namespace or name: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeRegistryProviders" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeRegistryProviders.NewDataTfeRegistryProviders(this, jsii.String("hashicorp"), &dataTfeRegistryProvidersConfig{ + organization: jsii.String("my-org-name"), + search: jsii.String("hashicorp"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether to list only public or private providers. Must be either `Public` or `Private`. +* `Search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `Providers` - List of the providers. Each element contains the following attributes: + * `Id` - ID of the provider. + * `Organization` - Name of the organization. + * `RegistryName` - Whether this is a publicly maintained provider or private. + * `Namespace` - Namespace of the provider. + * `Name` - Name of the provider. + * `CreatedAt` - Time when the provider was created. + * `UpdatedAt` - Time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/workspace.html.markdown b/website/docs/cdktf/go/d/workspace.html.markdown index df1d3ac00..81084b9c6 100644 --- a/website/docs/cdktf/go/d/workspace.html.markdown +++ b/website/docs/cdktf/go/d/workspace.html.markdown @@ -76,7 +76,7 @@ In addition to all arguments above, the following attributes are exported: * `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `VcsRepo` - Settings for the workspace's VCS repository. * `WorkingDirectory` - A relative path that Terraform will execute within. -* `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `Remote`, `Local`, or `Agent`. +* `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`TfeWorkspaceSettings` resource](tfe_workspace_settings) for details. * `HtmlUrl` - The URL to the browsable HTML overview of the workspace @@ -91,4 +91,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index cea2a6a1c..c87eddf03 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.51.1" + version = "~> 0.53.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.53.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` token = var.token - version = "~> 0.51.1" + version = "~> 0.53.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/admin_organization_settings.markdown b/website/docs/cdktf/go/r/admin_organization_settings.markdown index f9f49c9d2..76ce2f2e8 100644 --- a/website/docs/cdktf/go/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/go/r/admin_organization_settings.markdown @@ -5,6 +5,8 @@ description: |- Manages admin settings for an organization (Terraform Enterprise Only). --- + + # tfe_admin_organization_settings Manage admin settings for an organization. This resource requires the @@ -64,8 +66,4 @@ The following arguments are supported: * `SsoEnabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown index 2a99c7204..87264830a 100644 --- a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -17,44 +17,38 @@ for Business account. ## Example Usage -Basic usage: - -```go -import constructs "github.com/aws/constructs-go/constructs" -import "github.com/hashicorp/terraform-cdk-go/cdktf" -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import "github.com/aws-samples/dummy/gen/providers/tfe/organization" -import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" -import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" -import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" -type myConvertedCode struct { - terraformStack +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] } -func newMyConvertedCode(scope construct, name *string) *myConvertedCode { - this := &myConvertedCode{} - cdktf.NewTerraformStack_Override(this, scope, name) - tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ - email: jsii.String("admin@company.com"), - name: jsii.String("my-org-name"), - }) - tfeWorkspaceTestWorkspace := workspace.NewWorkspace(this, jsii.String("test-workspace"), &workspaceConfig{ - name: jsii.String("my-workspace-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), - }) - tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ - name: jsii.String("my-agent-pool-name"), - organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), - organizationScoped: jsii.Boolean(false), - }) - agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test-allowed-workspaces"), &agentPoolAllowedWorkspacesConfig{ - agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), - allowedWorkspaceIds: []*string{ - cdktf.Token_*AsString(tfeWorkspaceTestWorkspace.id), - }, - }) - return this +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -74,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/opa_version.html.markdown b/website/docs/cdktf/go/r/opa_version.html.markdown new file mode 100644 index 000000000..3404fc6b2 --- /dev/null +++ b/website/docs/cdktf/go/r/opa_version.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + + + +# tfe_opa_version + +Manage OPA versions available on Terraform Enterprise. + +## Example Usage + +Basic Usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/opaVersion" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + opaVersion.NewOpaVersion(this, jsii.String("test"), &opaVersionConfig{ + sha: jsii.String("e75ac73deb69a6b3aa667cb0b8b731aee79e2904"), + url: jsii.String("https://tfe-host.com/path/to/opa"), + version: jsii.String("0.58.0-custom"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `Url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `Sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `Official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `Deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `DeprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `Deprecated` is true. + +## Attributes Reference + +* `Id` The ID of the OPA version + +## Import + +OPA versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization.html.markdown b/website/docs/cdktf/go/r/organization.html.markdown index 382d4b4db..18aa8b09a 100644 --- a/website/docs/cdktf/go/r/organization.html.markdown +++ b/website/docs/cdktf/go/r/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Manages organizations. --- + + # tfe_organization Manages organizations. @@ -49,6 +51,7 @@ The following arguments are supported: * `OwnersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `SendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `AggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `SendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. * `AssessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `AllowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. @@ -65,4 +68,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization_default_settings.html.markdown b/website/docs/cdktf/go/r/organization_default_settings.html.markdown new file mode 100644 index 000000000..4fb9e6bea --- /dev/null +++ b/website/docs/cdktf/go/r/organization_default_settings.html.markdown @@ -0,0 +1,76 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_settings +description: |- + Sets the workspace defaults for an organization +--- + + + +# tfe_organization_default_settings + +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). + +## Example Usage + +Basic usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" +import "github.com/aws-samples/dummy/gen/providers/tfe/organizationDefaultSettings" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTest := organization.NewOrganization(this, jsii.String("test"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeAgentPoolMyAgents := agentPool.NewAgentPool(this, jsii.String("my_agents"), &agentPoolConfig{ + name: jsii.String("agent_smiths"), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), + }) + tfeOrganizationDefaultSettingsOrgDefault := + organizationDefaultSettings.NewOrganizationDefaultSettings(this, jsii.String("org_default"), &organizationDefaultSettingsConfig{ + defaultAgentPoolId: cdktf.Token_*AsString(tfeAgentPoolMyAgents.id), + defaultExecutionMode: jsii.String("agent"), + organization: cdktf.Token_*AsString(tfeOrganizationTest.name), + }) + workspace.NewWorkspace(this, jsii.String("my_workspace"), &workspaceConfig{ + dependsOn: []iTerraformDependable{ + tfeOrganizationDefaultSettingsOrgDefault, + }, + name: jsii.String("my-workspace"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `DefaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `Remote`, `Local` or`Agent`. +* `DefaultAgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `DefaultExecutionMode` to be set to `Agent`. This value _must not_ be provided if `DefaultExecutionMode` is set to any other value. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/policy_set.html.markdown b/website/docs/cdktf/go/r/policy_set.html.markdown index c153e085c..ce16d3adb 100644 --- a/website/docs/cdktf/go/r/policy_set.html.markdown +++ b/website/docs/cdktf/go/r/policy_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages policy sets. --- + + # tfe_policy_set Policies are rules enforced on Terraform runs. Two policy-as-code frameworks are @@ -21,12 +23,14 @@ Basic usage (VCS-based policy set): ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] vcs_repo { identifier = "my-org-name/my-policy-set-repository" @@ -41,12 +45,14 @@ Using manually-specified policies: ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } ``` @@ -81,6 +87,9 @@ The following arguments are supported: * `Kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `Sentinel` if not provided. Valid values are `Sentinel` and `Opa`. A policy set can only have policies that have the same underlying kind. +* `AgentEnabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `PolicyToolVersion` - (Optional) The policy tool version to run the evaluation against. * `Overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `False`. Only valid for OPA policies. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -126,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/registry_gpg_key.html.markdown b/website/docs/cdktf/go/r/registry_gpg_key.html.markdown new file mode 100644 index 000000000..00c924dd0 --- /dev/null +++ b/website/docs/cdktf/go/r/registry_gpg_key.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Manages private registry GPG keys. +--- + + + +# tfe_registry_gpg_key + +Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. + +The provided GPG key must be ASCII-armored, i.e. starting with: +"`-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n...`". + +## Example Usage + +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") +} +``` + +## Argument Reference + +The following arguments are supported: + +* `AsciiArmor` - (Required) ASCII-armored representation of the GPG key. +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `Id` - ID of the GPG key. +* `CreatedAt` - The time when the GPG key was created. +* `UpdatedAt` - The time when the GPG key was last updated. + +## Import + +Keys can be imported; use `/` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index ba24cd66d..5ea05e661 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -52,6 +52,51 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { } ``` +Create private registry module with tests enabled: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/oauthClient" +import "github.com/aws-samples/dummy/gen/providers/tfe/registryModule" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeOauthClientTestOauthClient := oauthClient.NewOauthClient(this, jsii.String("test-oauth-client"), &oauthClientConfig{ + apiUrl: jsii.String("https://api.github.com"), + httpUrl: jsii.String("https://github.com"), + oauthToken: jsii.String("my-vcs-provider-token"), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + serviceProvider: jsii.String("github"), + }) + registryModule.NewRegistryModule(this, jsii.String("test-registry-module"), ®istryModuleConfig{ + testConfig: []interface{}{ + ®istryModuleTestConfig{ + testsEnabled: jsii.Boolean(true), + }, + }, + vcsRepo: ®istryModuleVcsRepo{ + branch: jsii.String("main"), + displayIdentifier: jsii.String("my-org-name/terraform-provider-name"), + identifier: jsii.String("my-org-name/terraform-provider-name"), + oauthTokenId: cdktf.Token_*AsString(tfeOauthClientTestOauthClient.oauthTokenId), + }, + }) + return this +} +``` + Create private registry module with GitHub App: ```go @@ -199,6 +244,9 @@ The following arguments are supported: * `Namespace` - (Optional) The namespace of a public registry module. It can be used if `ModuleProvider` is set and `RegistryName` is public. * `RegistryName` - (Optional) Whether the registry module is private or public. It can be used if `ModuleProvider` is set. +The `TestConfig` block supports +* `TestsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `VcsRepo` block supports: * `DisplayIdentifier` - (Required) The display identifier for your VCS repository. @@ -209,6 +257,8 @@ The `VcsRepo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. +* `Branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `Branch` is set, `Tags` will be returned as `False`. +* `Tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `Tags` is set to `True`, the `Branch` must be set to an empty value. ## Attributes Reference @@ -217,6 +267,7 @@ The `VcsRepo` block supports: * `Name` - The name of registry module. * `Organization` - The name of the organization associated with the registry module. * `Namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `PublishingMechanism` - The publishing mechanism used when releasing new versions of the module. * `RegistryName` - The registry name of the registry module depicting whether the registry module is private or public. * `NoCode` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. @@ -235,4 +286,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/registry_provider.html.markdown b/website/docs/cdktf/go/r/registry_provider.html.markdown new file mode 100644 index 000000000..8cdf415fd --- /dev/null +++ b/website/docs/cdktf/go/r/registry_provider.html.markdown @@ -0,0 +1,111 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + + + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/registryProvider" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationExample := organization.NewOrganization(this, jsii.String("example"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeRegistryProviderExample := + registryProvider.NewRegistryProvider(this, jsii.String("example_1"), ®istryProviderConfig{ + name: jsii.String("my-provider"), + organization: cdktf.Token_AsString(tfeOrganizationExample.name), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.OverrideLogicalId(jsii.String("example")) + return this +} +``` + +Create public provider: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/registryProvider" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationExample := organization.NewOrganization(this, jsii.String("example"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeRegistryProviderExample := + registryProvider.NewRegistryProvider(this, jsii.String("example_1"), ®istryProviderConfig{ + name: jsii.String("aws"), + namespace: jsii.String("hashicorp"), + organization: cdktf.Token_AsString(tfeOrganizationExample.name), + registryName: jsii.String("public"), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.OverrideLogicalId(jsii.String("example")) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `RegistryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `Public` or `Private`. Defaults to `Private`. +* `Namespace` - (Optional) The namespace of the provider. Required if `RegistryName` is `Public`, otherwise it can't be configured, and it will be set to same value as the `Organization`. +* `Name` - (Required) Name of the provider. + +## Attributes Reference + +* `Id` - ID of the provider. +* `CreatedAt` - The time when the provider was created. +* `UpdatedAt` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/sentinel_version.html.markdown b/website/docs/cdktf/go/r/sentinel_version.html.markdown new file mode 100644 index 000000000..d3e4dc21f --- /dev/null +++ b/website/docs/cdktf/go/r/sentinel_version.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + + + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/sentinelVersion" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + sentinelVersion.NewSentinelVersion(this, jsii.String("test"), &sentinelVersionConfig{ + sha: jsii.String("e75ac73deb69a6b3aa667cb0b8b731aee79e2904"), + url: jsii.String("https://tfe-host.com/path/to/sentinel.zip"), + version: jsii.String("0.24.0-custom"), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `Version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `Sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `Official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `Deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `DeprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `Deprecated` is true. + +## Attributes Reference + +* `Id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team_project_access.html.markdown b/website/docs/cdktf/go/r/team_project_access.html.markdown index ea298cee3..c64cfb21c 100644 --- a/website/docs/cdktf/go/r/team_project_access.html.markdown +++ b/website/docs/cdktf/go/r/team_project_access.html.markdown @@ -155,4 +155,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index 9f91e668a..ec6f8d392 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -11,6 +11,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -47,7 +49,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { } ``` -With `ExecutionMode` of `Agent`: +Usage with vcs_repo: ```go import constructs "github.com/aws/constructs-go/constructs" @@ -55,7 +57,7 @@ import "github.com/hashicorp/terraform-cdk-go/cdktf" /*Provider bindings are generated by running cdktf get. See https://cdk.tf/provider-generation for more details.*/ import "github.com/aws-samples/dummy/gen/providers/tfe/organization" -import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" +import "github.com/aws-samples/dummy/gen/providers/tfe/oauthClient" import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" type myConvertedCode struct { terraformStack @@ -68,15 +70,22 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { email: jsii.String("admin@company.com"), name: jsii.String("my-org-name"), }) - tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ - name: jsii.String("my-agent-pool-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + tfeOauthClientTest := oauthClient.NewOauthClient(this, jsii.String("test"), &oauthClientConfig{ + apiUrl: jsii.String("https://api.github.com"), + httpUrl: jsii.String("https://github.com"), + oauthToken: jsii.String("oauth_token_id"), + organization: tfeOrganizationTestOrganization, + serviceProvider: jsii.String("github"), }) - workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ - agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), - executionMode: jsii.String("agent"), - name: jsii.String("my-workspace-name"), - organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), + workspace.NewWorkspace(this, jsii.String("parent"), &workspaceConfig{ + name: jsii.String("parent-ws"), + organization: tfeOrganizationTestOrganization, + queueAllRuns: jsii.Boolean(false), + vcsRepo: &workspaceVcsRepo{ + branch: jsii.String("main"), + identifier: jsii.String("my-org-name/vcs-repository"), + oauthTokenId: cdktf.Token_AsString(tfeOauthClientTest.oauthTokenId), + }, }) return this } @@ -87,20 +96,13 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { The following arguments are supported: * `Name` - (Required) Name of the workspace. -* `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` - to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value or if `Operations` is - provided. +* `AgentPoolId` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `AllowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. * `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. * `Description` - (Optional) A description for the workspace. -* `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `Remote`, `Local` or`Agent`. - Defaults to `Remote`. Using Terraform Enterprise, only `Remote`and `Local` - execution modes are valid. When set to `Local`, the workspace will be used - for state storage only. This value _must not_ be provided if `Operations` - is provided. +* `ExecutionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `True`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -144,6 +146,11 @@ The following arguments are supported: workspace will display their output as text logs. * `SshKeyId` - (Optional) The ID of an SSH key to assign to the workspace. * `TagNames` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. +* `IgnoreAdditionalTagNames` - (Optional) Explicitly ignores `TagNames` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `TagNames` and is not recommended. This value must be applied before it +will be used. * `TerraformVersion` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) @@ -178,7 +185,7 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The workspace ID. * `ResourceCount` - The number of resources managed by the workspace. -* `HtmlUrl` - The URL to the browsable HTML overview of the workspace +* `HtmlUrl` - The URL to the browsable HTML overview of the workspace. ## Import @@ -193,4 +200,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_settings.markdown b/website/docs/cdktf/go/r/workspace_settings.markdown new file mode 100644 index 000000000..3b5cd4d88 --- /dev/null +++ b/website/docs/cdktf/go/r/workspace_settings.markdown @@ -0,0 +1,169 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + + + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `Overwrites` argument. + +## Example Usage + +Basic usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspaceSettings" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + }) + workspaceSettings.NewWorkspaceSettings(this, jsii.String("test-settings"), &workspaceSettingsConfig{ + executionMode: jsii.String("local"), + workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), + }) + return this +} +``` + +With `ExecutionMode` of `Agent`: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspaceSettings" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + }) + tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ + name: jsii.String("my-agent-pool-name"), + organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), + }) + tfeAgentPoolAllowedWorkspacesTest := + agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test_3"), &agentPoolAllowedWorkspacesConfig{ + agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: []*string{ + cdktf.Token_*AsString(tfeWorkspaceTest.id), + }, + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeAgentPoolAllowedWorkspacesTest.OverrideLogicalId(jsii.String("test")) + workspaceSettings.NewWorkspaceSettings(this, jsii.String("test-settings"), &workspaceSettingsConfig{ + agentPoolId: cdktf.Token_*AsString(tfeAgentPoolAllowedWorkspacesTest.agentPoolId), + executionMode: jsii.String("agent"), + workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), + }) + return this +} +``` + +This resource may be used as a data source when no optional arguments are defined: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/dataTfeWorkspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspaceSettings" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + dataTfeWorkspaceTest := dataTfeWorkspace.NewDataTfeWorkspace(this, jsii.String("test"), &dataTfeWorkspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: jsii.String("my-org-name"), + }) + tfeWorkspaceSettingsTest := + workspaceSettings.NewWorkspaceSettings(this, jsii.String("test_1"), &workspaceSettingsConfig{ + workspaceId: cdktf.Token_AsString(dataTfeWorkspaceTest.id), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceSettingsTest.OverrideLogicalId(jsii.String("test")) + cdktf.NewTerraformOutput(this, jsii.String("workspace-explicit-local-execution"), &TerraformOutputConfig{ + Value: cdktf.Fn_Alltrue(cdktf.Token_AsAny([]interface{}{ + cdktf.Op_Eq(tfeWorkspaceSettingsTest.executionMode, jsii.String("local")), + cdktf.propertyAccess(tfeWorkspaceSettingsTest.overwrites, []interface{}{ + jsii.String("0"), + jsii.String("\"execution_mode\""), + }), + })), + }) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `WorkspaceId` - (Required) ID of the workspace. +* `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` + to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. +* `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `Id` - The workspace ID. +* `Overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `ExecutionMode` - Set to `True` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `False` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `AgentPool` - Set to `True` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `False` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/github_installation.html.markdown b/website/docs/cdktf/java/d/github_installation.html.markdown index fe6335717..846c465b5 100644 --- a/website/docs/cdktf/java/d/github_installation.html.markdown +++ b/website/docs/cdktf/java/d/github_installation.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on the Github App Installation. --- + + # Data Source: tfe_github_app_installation Use this data source to get information about the Github App Installation. @@ -23,7 +25,7 @@ public class MyConvertedCode extends TerraformStack { public MyConvertedCode(Construct scope, String name) { super(scope, name); new DataTfeGithubAppInstallation(this, "gha_installation", new DataTfeGithubAppInstallationConfig() - .installationId(12345) + .installationId(12345678) ); } } @@ -41,7 +43,7 @@ public class MyConvertedCode extends TerraformStack { public MyConvertedCode(Construct scope, String name) { super(scope, name); new DataTfeGithubAppInstallation(this, "gha_installation", new DataTfeGithubAppInstallationConfig() - .name("installation_name") + .name("github_username_or_organization") ); } } @@ -49,11 +51,11 @@ public class MyConvertedCode extends TerraformStack { ## Argument Reference -The following arguments are supported. At least one of `name`, `installationId` must be set. +The following arguments are supported. At least one of `name`, `installationId` must be set. + +* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://githubCom/settings/installations/12345678`. +* `name` - (Optional) Name of the Github user or organization account that installed the app. -* `installationId` - (Optional) ID of the Github Installation as shown in Github. -* `name` - (Optional) Name of the Github Installation as shown in Github. - Must be one of: `installationId` or `name`. ## Attributes Reference @@ -61,4 +63,5 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/no_code_module.html.markdown b/website/docs/cdktf/java/d/no_code_module.html.markdown new file mode 100644 index 000000000..e8a11ff3b --- /dev/null +++ b/website/docs/cdktf/java/d/no_code_module.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_no_code_module" +description: |- + Get information on a no-code module. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to read the details of an existing No-Code-Allowed module. + +## Example Usage + +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the no-code module. + +## Attributes Reference + +* `id` - ID of the no-code module. +* `organization` - Organization name that the no-code module belongs to. +* `namespace` - Namespace name that the no-code module belongs to. +* `registryModuleId` - ID of the registry module for the no-code module. +* `versionPin` - Version number the no-code module is pinned to. +* `enabled` - Indicates if this no-code module is currently enabled + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/organization.html.markdown b/website/docs/cdktf/java/d/organization.html.markdown index c0d5a0764..c91e00ea9 100644 --- a/website/docs/cdktf/java/d/organization.html.markdown +++ b/website/docs/cdktf/java/d/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an Organization. --- + + # Data Source: tfe_organization Use this data source to get information about an organization. @@ -30,13 +32,12 @@ public class MyConvertedCode extends TerraformStack { ## Argument Reference The following arguments are supported: -* `name` - (Required) Name of the organization. +* `name` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `name` - Name of the organization. * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. @@ -44,5 +45,7 @@ In addition to all arguments above, the following attributes are exported: * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/policy_set.html.markdown b/website/docs/cdktf/java/d/policy_set.html.markdown index a5973dda4..8f4062649 100644 --- a/website/docs/cdktf/java/d/policy_set.html.markdown +++ b/website/docs/cdktf/java/d/policy_set.html.markdown @@ -47,6 +47,8 @@ The following arguments are supported: * `description` - Description of the policy set. * `global` - Whether or not the policy set applies to all workspaces in the organization. * `kind` - The policy-as-code framework for the policy. Valid values are "sentinel" and "opa". +* `agentEnabled` - Whether or not the policy set is run as a policy evaluation within the agent. True by default for all "opa" policy sets. +* `policyToolVersion` - The policy tool version to run the evaluation against. * `overridable` - Whether users can override this policy when it fails during a run. Only valid for OPA policies. * `workspaceIds` - IDs of the workspaces that use the policy set. * `excludedWorkspaceIds` - IDs of the workspaces that do not use the policy set. @@ -66,4 +68,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/registry_gpg_key.html.markdown b/website/docs/cdktf/java/d/registry_gpg_key.html.markdown new file mode 100644 index 000000000..3f881a74e --- /dev/null +++ b/website/docs/cdktf/java/d/registry_gpg_key.html.markdown @@ -0,0 +1,46 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Get information on a private registry GPG key. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about a private registry GPG key. + +## Example Usage + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeRegistryGpgKey.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeRegistryGpgKey(this, "example", new DataTfeRegistryGpgKeyConfig() + .id("13DFECCA3B58CE4A") + .organization("my-org-name") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Required) ID of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `asciiArmor` - ASCII-armored representation of the GPG key. +* `createdAt` - The time when the GPG key was created. +* `updatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/java/d/registry_gpg_keys.html.markdown new file mode 100644 index 000000000..dad2e79f1 --- /dev/null +++ b/website/docs/cdktf/java/d/registry_gpg_keys.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_keys" +description: |- + Get information on private registry GPG keys of an organization. +--- + + + +# Data Source: tfe_registry_gpg_key + +Use this data source to get information about all private registry GPG keys of an organization. + +## Example Usage + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeRegistryGpgKeys.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeRegistryGpgKeys(this, "all", new DataTfeRegistryGpgKeysConfig() + .organization("my-org-name") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `keys` - List of GPG keys in the organization. Each element contains the following attributes: + * `id` - ID of the GPG key. + * `organization` - Name of the organization. + * `asciiArmor` - ASCII-armored representation of the GPG key. + * `createdAt` - The time when the GPG key was created. + * `updatedAt` - The time when the GPG key was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/registry_provider.html.markdown b/website/docs/cdktf/java/d/registry_provider.html.markdown new file mode 100644 index 000000000..99d663d27 --- /dev/null +++ b/website/docs/cdktf/java/d/registry_provider.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Get information on a public or private provider in the private registry. +--- + + + +# Data Source: tfe_registry_provider + +Use this data source to get information about a public or private provider in the private registry. + +## Example Usage + +A private provider: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.registryProvider.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new RegistryProvider(this, "example", new RegistryProviderConfig() + .name("my-provider") + .organization("my-org-name") + ); + } +} +``` + +A public provider: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.registryProvider.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new RegistryProvider(this, "example", new RegistryProviderConfig() + .name("aws") + .namespace("hashicorp") + .organization("my-org-name") + .registryName("public") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registryName` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `createdAt` - The time when the provider was created. +* `updatedAt` - The time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/registry_providers.html.markdown b/website/docs/cdktf/java/d/registry_providers.html.markdown new file mode 100644 index 000000000..535051836 --- /dev/null +++ b/website/docs/cdktf/java/d/registry_providers.html.markdown @@ -0,0 +1,91 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_providers" +description: |- + Get information on public and private providers in the private registry. +--- + + + +# Data Source: tfe_registry_providers + +Use this data source to get information about public and private providers in the private registry. + +## Example Usage + +All providers: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeRegistryProviders.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeRegistryProviders(this, "all", new DataTfeRegistryProvidersConfig() + .organization("my-org-name") + ); + } +} +``` + +All private providers: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeRegistryProviders.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeRegistryProviders(this, "private", new DataTfeRegistryProvidersConfig() + .organization("my-org-name") + .registryName("private") + ); + } +} +``` + +Providers with "hashicorp" in their namespace or name: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeRegistryProviders.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new DataTfeRegistryProviders(this, "hashicorp", new DataTfeRegistryProvidersConfig() + .organization("my-org-name") + .search("hashicorp") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether to list only public or private providers. Must be either `public` or `private`. +* `search` - (Optional) A query string to do a fuzzy search on provider name and namespace. + +## Attributes Reference + +* `providers` - List of the providers. Each element contains the following attributes: + * `id` - ID of the provider. + * `organization` - Name of the organization. + * `registryName` - Whether this is a publicly maintained provider or private. + * `namespace` - Namespace of the provider. + * `name` - Name of the provider. + * `createdAt` - Time when the provider was created. + * `updatedAt` - Time when the provider was last updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/workspace.html.markdown b/website/docs/cdktf/java/d/workspace.html.markdown index 371cf05ba..c2757acbe 100644 --- a/website/docs/cdktf/java/d/workspace.html.markdown +++ b/website/docs/cdktf/java/d/workspace.html.markdown @@ -72,7 +72,7 @@ In addition to all arguments above, the following attributes are exported: * `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. -* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. Possible values include `remote`, `local`, or `agent`. +* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfeWorkspaceSettings` resource](tfe_workspace_settings) for details. * `htmlUrl` - The URL to the browsable HTML overview of the workspace @@ -87,4 +87,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index 43998b27c..f5fc97051 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.51.1" + version = "~> 0.53.0" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.51.1" + version = "~> 0.53.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` token = var.token - version = "~> 0.51.1" + version = "~> 0.53.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/admin_organization_settings.markdown b/website/docs/cdktf/java/r/admin_organization_settings.markdown index bfcd410d0..1aaced2ae 100644 --- a/website/docs/cdktf/java/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/java/r/admin_organization_settings.markdown @@ -5,6 +5,8 @@ description: |- Manages admin settings for an organization (Terraform Enterprise Only). --- + + # tfe_admin_organization_settings Manage admin settings for an organization. This resource requires the @@ -64,8 +66,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown index b98fae86d..78e686b1f 100644 --- a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_agent_pool_allowed_workspaces -Adds and removes allowed workspaces on an agent pool +Adds and removes allowed workspaces on an agent pool. ~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud for Business account. @@ -17,38 +17,38 @@ for Business account. ## Example Usage -Basic usage: - -```java -import software.constructs.*; -import com.hashicorp.cdktf.*; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import gen.providers.tfe.organization.*; -import gen.providers.tfe.workspace.*; -import gen.providers.tfe.agentPool.*; -import gen.providers.tfe.agentPoolAllowedWorkspaces.*; -public class MyConvertedCode extends TerraformStack { - public MyConvertedCode(Construct scope, String name) { - super(scope, name); - Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() - .email("admin@company.com") - .name("my-org-name") - ); - Workspace tfeWorkspaceTestWorkspace = new Workspace(this, "test-workspace", new WorkspaceConfig() - .name("my-workspace-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) - ); - AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() - .name("my-agent-pool-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) - .organizationScoped(false) - ); - new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig() - .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) - .allowedWorkspaceIds(List.of(Token.asString(tfeWorkspaceTestWorkspace.getId()))) - ); - } +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -68,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/opa_version.html.markdown b/website/docs/cdktf/java/r/opa_version.html.markdown new file mode 100644 index 000000000..73ad963fc --- /dev/null +++ b/website/docs/cdktf/java/r/opa_version.html.markdown @@ -0,0 +1,67 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_opa_version" +description: |- + Manages OPA versions +--- + + + +# tfe_opa_version + +Manage OPA versions available on Terraform Enterprise. + +## Example Usage + +Basic Usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.opaVersion.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new OpaVersion(this, "test", new OpaVersionConfig() + .sha("e75ac73deb69a6b3aa667cb0b8b731aee79e2904") + .url("https://tfe-host.com/path/to/opa") + .version("0.58.0-custom") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. +* `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". +* `deprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the OPA version + +## Import + +OPA versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_opa_version.test 0.58.0 +``` + +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization.html.markdown b/website/docs/cdktf/java/r/organization.html.markdown index a7ee9dcde..28d572537 100644 --- a/website/docs/cdktf/java/r/organization.html.markdown +++ b/website/docs/cdktf/java/r/organization.html.markdown @@ -5,6 +5,8 @@ description: |- Manages organizations. --- + + # tfe_organization Manages organizations. @@ -45,6 +47,7 @@ The following arguments are supported: * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +* `aggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `sendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. * `assessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. @@ -61,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization_default_settings.html.markdown b/website/docs/cdktf/java/r/organization_default_settings.html.markdown new file mode 100644 index 000000000..b973f6bd3 --- /dev/null +++ b/website/docs/cdktf/java/r/organization_default_settings.html.markdown @@ -0,0 +1,70 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_default_settings +description: |- + Sets the workspace defaults for an organization +--- + + + +# tfe_organization_default_settings + +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). + +## Example Usage + +Basic usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.agentPool.*; +import gen.providers.tfe.organizationDefaultSettings.*; +import gen.providers.tfe.workspace.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTest = new Organization(this, "test", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + AgentPool tfeAgentPoolMyAgents = new AgentPool(this, "my_agents", new AgentPoolConfig() + .name("agent_smiths") + .organization(Token.asString(tfeOrganizationTest.getName())) + ); + OrganizationDefaultSettings tfeOrganizationDefaultSettingsOrgDefault = + new OrganizationDefaultSettings(this, "org_default", new OrganizationDefaultSettingsConfig() + .defaultAgentPoolId(Token.asString(tfeAgentPoolMyAgents.getId())) + .defaultExecutionMode("agent") + .organization(Token.asString(tfeOrganizationTest.getName())) + ); + new Workspace(this, "my_workspace", new WorkspaceConfig() + .dependsOn(List.of(tfeOrganizationDefaultSettingsOrgDefault)) + .name("my-workspace") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `defaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. +* `defaultAgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `defaultExecutionMode` to be set to `agent`. This value _must not_ be provided if `defaultExecutionMode` is set to any other value. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + + +## Import + +Organization default execution mode can be imported; use `` as the import ID. For example: + +```shell +terraform import tfe_organization_default_execution_mode.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/policy_set.html.markdown b/website/docs/cdktf/java/r/policy_set.html.markdown index 2998a1e98..3a3a14959 100644 --- a/website/docs/cdktf/java/r/policy_set.html.markdown +++ b/website/docs/cdktf/java/r/policy_set.html.markdown @@ -5,6 +5,8 @@ description: |- Manages policy sets. --- + + # tfe_policy_set Policies are rules enforced on Terraform runs. Two policy-as-code frameworks are @@ -21,12 +23,14 @@ Basic usage (VCS-based policy set): ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] vcs_repo { identifier = "my-org-name/my-policy-set-repository" @@ -41,12 +45,14 @@ Using manually-specified policies: ```hcl resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } ``` @@ -81,6 +87,9 @@ The following arguments are supported: * `kind` - (Optional) The policy-as-code framework associated with the policy. Defaults to `sentinel` if not provided. Valid values are `sentinel` and `opa`. A policy set can only have policies that have the same underlying kind. +* `agentEnabled` - (Optional) Whether or not the policy set is run as a policy evaluation within the agent. + True by default for all "opa" policy sets. +* `policyToolVersion` - (Optional) The policy tool version to run the evaluation against. * `overridable` - (Optional) Whether or not users can override this policy when it fails during a run. Defaults to `false`. Only valid for OPA policies. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. @@ -126,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/registry_gpg_key.html.markdown b/website/docs/cdktf/java/r/registry_gpg_key.html.markdown new file mode 100644 index 000000000..851e98f10 --- /dev/null +++ b/website/docs/cdktf/java/r/registry_gpg_key.html.markdown @@ -0,0 +1,48 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_gpg_key" +description: |- + Manages private registry GPG keys. +--- + + + +# tfe_registry_gpg_key + +Manages a public key of the GPG key pair used to sign releases of private providers in the private registry. + +The provided GPG key must be ASCII-armored, i.e. starting with: +"`-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n...`". + +## Example Usage + +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") +} +``` + +## Argument Reference + +The following arguments are supported: + +* `asciiArmor` - (Required) ASCII-armored representation of the GPG key. +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. + +## Attributes Reference + +* `id` - ID of the GPG key. +* `createdAt` - The time when the GPG key was created. +* `updatedAt` - The time when the GPG key was last updated. + +## Import + +Keys can be imported; use `/` as the import ID. For +example: + +```shell +terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 17f153627..7b4570b1a 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -48,6 +48,45 @@ public class MyConvertedCode extends TerraformStack { } ``` +Create private registry module with tests enabled: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.oauthClient.*; +import gen.providers.tfe.registryModule.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + OauthClient tfeOauthClientTestOauthClient = new OauthClient(this, "test-oauth-client", new OauthClientConfig() + .apiUrl("https://api.github.com") + .httpUrl("https://github.com") + .oauthToken("my-vcs-provider-token") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + .serviceProvider("github") + ); + new RegistryModule(this, "test-registry-module", new RegistryModuleConfig() + .testConfig(List.of(new RegistryModuleTestConfig() + .testsEnabled(true) + )) + .vcsRepo(new RegistryModuleVcsRepo() + .branch("main") + .displayIdentifier("my-org-name/terraform-provider-name") + .identifier("my-org-name/terraform-provider-name") + .oauthTokenId(Token.asString(tfeOauthClientTestOauthClient.getOauthTokenId())) + ) + ); + } +} +``` + Create private registry module with GitHub App: ```java @@ -179,6 +218,9 @@ The following arguments are supported: * `namespace` - (Optional) The namespace of a public registry module. It can be used if `moduleProvider` is set and `registryName` is public. * `registryName` - (Optional) Whether the registry module is private or public. It can be used if `moduleProvider` is set. +The `testConfig` block supports +* `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. + The `vcsRepo` block supports: * `displayIdentifier` - (Required) The display identifier for your VCS repository. @@ -189,6 +231,8 @@ The `vcsRepo` block supports: and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. +* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. +* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. ## Attributes Reference @@ -197,6 +241,7 @@ The `vcsRepo` block supports: * `name` - The name of registry module. * `organization` - The name of the organization associated with the registry module. * `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. +* `publishingMechanism` - The publishing mechanism used when releasing new versions of the module. * `registryName` - The registry name of the registry module depicting whether the registry module is private or public. * `noCode` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. Use the tfe_no_code_module resource instead. @@ -215,4 +260,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/registry_provider.html.markdown b/website/docs/cdktf/java/r/registry_provider.html.markdown new file mode 100644 index 000000000..5ef512fff --- /dev/null +++ b/website/docs/cdktf/java/r/registry_provider.html.markdown @@ -0,0 +1,103 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_registry_provider" +description: |- + Manages public and private providers in the private registry. +--- + + + +# tfe_registry_provider + +Manages public and private providers in the private registry. + +## Example Usage + +Create private provider: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.registryProvider.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationExample = new Organization(this, "example", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + RegistryProvider tfeRegistryProviderExample = + new RegistryProvider(this, "example_1", new RegistryProviderConfig() + .name("my-provider") + .organization(Token.asString(tfeOrganizationExample.getName())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.overrideLogicalId("example"); + } +} +``` + +Create public provider: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.registryProvider.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationExample = new Organization(this, "example", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + RegistryProvider tfeRegistryProviderExample = + new RegistryProvider(this, "example_1", new RegistryProviderConfig() + .name("aws") + .namespace("hashicorp") + .organization(Token.asString(tfeOrganizationExample.getName())) + .registryName("public") + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeRegistryProviderExample.overrideLogicalId("example"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `registryName` - (Optional) Whether this is a publicly maintained provider or private. Must be either `public` or `private`. Defaults to `private`. +* `namespace` - (Optional) The namespace of the provider. Required if `registryName` is `public`, otherwise it can't be configured, and it will be set to same value as the `organization`. +* `name` - (Required) Name of the provider. + +## Attributes Reference + +* `id` - ID of the provider. +* `createdAt` - The time when the provider was created. +* `updatedAt` - The time when the provider was last updated. + +## Import + +Providers can be imported; use `///` as the import ID. + +For example a private provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/private/my-org-name/my-provider +``` + +Or a public provider: + +```shell +terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/sentinel_version.html.markdown b/website/docs/cdktf/java/r/sentinel_version.html.markdown new file mode 100644 index 000000000..4dfbecd80 --- /dev/null +++ b/website/docs/cdktf/java/r/sentinel_version.html.markdown @@ -0,0 +1,67 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_sentinel_version" +description: |- + Manages Sentinel versions +--- + + + +# tfe_sentinel_version + +Manage Sentinel versions available on Terraform Cloud/Enterprise. + +## Example Usage + +Basic Usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.sentinelVersion.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + new SentinelVersion(this, "test", new SentinelVersionConfig() + .sha("e75ac73deb69a6b3aa667cb0b8b731aee79e2904") + .url("https://tfe-host.com/path/to/sentinel.zip") + .version("0.24.0-custom") + ); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `version` - (Required) A semantic version string in N.N.N or N.N.N-bundleName format. +* `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. +* `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. +* `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". +* `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". +* `deprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. + +## Attributes Reference + +* `id` The ID of the Sentinel version + +## Import + +Sentinel versions can be imported; use `` or `` as the import ID. For example: + +```shell +terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr +``` + +```shell +terraform import tfe_sentinel_version.test 0.24.0 +``` + +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team_project_access.html.markdown b/website/docs/cdktf/java/r/team_project_access.html.markdown index bb3d6a831..c776470a9 100644 --- a/website/docs/cdktf/java/r/team_project_access.html.markdown +++ b/website/docs/cdktf/java/r/team_project_access.html.markdown @@ -143,4 +143,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index 548fdd526..dbc42ef46 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -11,6 +11,8 @@ description: |- Provides a workspace resource. +~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `executionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -40,7 +42,7 @@ public class MyConvertedCode extends TerraformStack { } ``` -With `executionMode` of `agent`: +Usage with vcs_repo: ```java import software.constructs.*; @@ -48,7 +50,7 @@ import com.hashicorp.cdktf.*; /*Provider bindings are generated by running cdktf get. See https://cdk.tf/provider-generation for more details.*/ import gen.providers.tfe.organization.*; -import gen.providers.tfe.agentPool.*; +import gen.providers.tfe.oauthClient.*; import gen.providers.tfe.workspace.*; public class MyConvertedCode extends TerraformStack { public MyConvertedCode(Construct scope, String name) { @@ -57,15 +59,22 @@ public class MyConvertedCode extends TerraformStack { .email("admin@company.com") .name("my-org-name") ); - AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() - .name("my-agent-pool-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + OauthClient tfeOauthClientTest = new OauthClient(this, "test", new OauthClientConfig() + .apiUrl("https://api.github.com") + .httpUrl("https://github.com") + .oauthToken("oauth_token_id") + .organization(tfeOrganizationTestOrganization) + .serviceProvider("github") ); - new Workspace(this, "test", new WorkspaceConfig() - .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) - .executionMode("agent") - .name("my-workspace-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + new Workspace(this, "parent", new WorkspaceConfig() + .name("parent-ws") + .organization(tfeOrganizationTestOrganization) + .queueAllRuns(false) + .vcsRepo(new WorkspaceVcsRepo() + .branch("main") + .identifier("my-org-name/vcs-repository") + .oauthTokenId(Token.asString(tfeOauthClientTest.getOauthTokenId())) + ) ); } } @@ -76,20 +85,13 @@ public class MyConvertedCode extends TerraformStack { The following arguments are supported: * `name` - (Required) Name of the workspace. -* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` - to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value or if `operations` is - provided. +* `agentPoolId` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `allowDestroyPlan` - (Optional) Whether destroy plans can be queued on the workspace. * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. * `description` - (Optional) A description for the workspace. -* `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or`agent`. - Defaults to `remote`. Using Terraform Enterprise, only `remote`and `local` - execution modes are valid. When set to `local`, the workspace will be used - for state storage only. This value _must not_ be provided if `operations` - is provided. +* `executionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files in a VCS push. Defaults to `true`. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a @@ -133,6 +135,11 @@ The following arguments are supported: workspace will display their output as text logs. * `sshKeyId` - (Optional) The ID of an SSH key to assign to the workspace. * `tagNames` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. +* `ignoreAdditionalTagNames` - (Optional) Explicitly ignores `tagNames` +_not_ defined by config so they will not be overwritten by the configured +tags. This creates exceptional behavior in terraform with respect +to `tagNames` and is not recommended. This value must be applied before it +will be used. * `terraformVersion` - (Optional) The version of Terraform to use for this workspace. This can be either an exact version or a [version constraint](https://developer.hashicorp.com/terraform/language/expressions/version-constraints) @@ -167,7 +174,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `resourceCount` - The number of resources managed by the workspace. -* `htmlUrl` - The URL to the browsable HTML overview of the workspace +* `htmlUrl` - The URL to the browsable HTML overview of the workspace. ## Import @@ -182,4 +189,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_settings.markdown b/website/docs/cdktf/java/r/workspace_settings.markdown new file mode 100644 index 000000000..f1b7262d3 --- /dev/null +++ b/website/docs/cdktf/java/r/workspace_settings.markdown @@ -0,0 +1,149 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_workspace_setting" +description: |- + Manages workspace settings. +--- + + + +# tfe_workspace_settings + +Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument. + +## Example Usage + +Basic usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.workspace.*; +import gen.providers.tfe.workspaceSettings.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + Workspace tfeWorkspaceTest = new Workspace(this, "test", new WorkspaceConfig() + .name("my-workspace-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + ); + new WorkspaceSettings(this, "test-settings", new WorkspaceSettingsConfig() + .executionMode("local") + .workspaceId(Token.asString(tfeWorkspaceTest.getId())) + ); + } +} +``` + +With `executionMode` of `agent`: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.workspace.*; +import gen.providers.tfe.agentPool.*; +import gen.providers.tfe.agentPoolAllowedWorkspaces.*; +import gen.providers.tfe.workspaceSettings.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + Workspace tfeWorkspaceTest = new Workspace(this, "test", new WorkspaceConfig() + .name("my-workspace-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + ); + AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() + .name("my-agent-pool-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + ); + AgentPoolAllowedWorkspaces tfeAgentPoolAllowedWorkspacesTest = + new AgentPoolAllowedWorkspaces(this, "test_3", new AgentPoolAllowedWorkspacesConfig() + .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) + .allowedWorkspaceIds(List.of(Token.asString(tfeWorkspaceTest.getId()))) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); + new WorkspaceSettings(this, "test-settings", new WorkspaceSettingsConfig() + .agentPoolId(Token.asString(tfeAgentPoolAllowedWorkspacesTest.getAgentPoolId())) + .executionMode("agent") + .workspaceId(Token.asString(tfeWorkspaceTest.getId())) + ); + } +} +``` + +This resource may be used as a data source when no optional arguments are defined: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.dataTfeWorkspace.*; +import gen.providers.tfe.workspaceSettings.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + DataTfeWorkspace dataTfeWorkspaceTest = new DataTfeWorkspace(this, "test", new DataTfeWorkspaceConfig() + .name("my-workspace-name") + .organization("my-org-name") + ); + WorkspaceSettings tfeWorkspaceSettingsTest = + new WorkspaceSettings(this, "test_1", new WorkspaceSettingsConfig() + .workspaceId(Token.asString(dataTfeWorkspaceTest.getId())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceSettingsTest.overrideLogicalId("test"); + TerraformOutput.Builder.create(this, "workspace-explicit-local-execution") + .value(Fn.alltrue(Token.asAny(List.of(Op.eq(tfeWorkspaceSettingsTest.getExecutionMode(), "local"), propertyAccess(tfeWorkspaceSettingsTest.getOverwrites(), List.of("0", "\"execution_mode\"")))))) + .build(); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `workspaceId` - (Required) ID of the workspace. +* `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` + to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. +* `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) + to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The workspace ID. +* `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. + - `executionMode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) + - `agentPool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + +## Import + +Workspaces can be imported; use `` or `/` as the +import ID. For example: + +```shell +terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd +``` + +```shell +terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index df964f4cc..7293e009c 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeAgentPool(self, "test", + tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 2d5ab9fd9..30c40a42b 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345678 ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding a Github App Installation by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="github_username_or_organization" ) ``` @@ -66,4 +60,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index 545b0540a..d51c305d5 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,20 +14,17 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformOutput, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - addresses = DataTfeIpRanges(self, "addresses") - TerraformOutput(self, "notifications_ips", - value=addresses.notifications + data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") + cdktf.TerraformOutput(self, "notifications_ips", + value=data_tfe_ip_ranges_addresses.notifications ) ``` @@ -45,4 +42,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/no_code_module.html.markdown b/website/docs/cdktf/python/d/no_code_module.html.markdown index 76a3c8037..72ccc9fb9 100644 --- a/website/docs/cdktf/python/d/no_code_module.html.markdown +++ b/website/docs/cdktf/python/d/no_code_module.html.markdown @@ -13,28 +13,15 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_no_code_module import DataTfeNoCodeModule -from imports.tfe.no_code_module import NoCodeModule -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - foobar = NoCodeModule(self, "foobar", - organization=Token.as_string(tfe_organization_foobar.id), - registry_module=Token.as_string(tfe_registry_module_foobar.id) - ) - data_tfe_no_code_module_foobar = DataTfeNoCodeModule(self, "foobar_1", - id=foobar.id - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - data_tfe_no_code_module_foobar.override_logical_id("foobar") +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} ``` ## Argument Reference @@ -52,4 +39,4 @@ The following arguments are supported: * `version_pin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 79b1e70ef..4aec1ba13 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its service provider ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -102,4 +93,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index e28ac7661..41cb64aea 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization import DataTfeOrganization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganization(self, "foo", + tfe.data_tfe_organization.DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -49,4 +46,4 @@ In addition to all arguments above, the following attributes are exported: * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index d27f10272..73670ef47 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - bar = Organization(self, "bar", + tfe_organization_bar = tfe.organization.Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - DataTfeOrganizationMembers(self, "foo", - organization=bar.name + tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", + organization=cdktf.Token.as_string(tfe_organization_bar.name) ) ``` @@ -52,4 +48,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index 5d34fc000..cc1def6d2 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,18 +22,15 @@ be updated manually. ### Fetch by email ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -42,18 +39,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by username ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -62,18 +56,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by organization membership ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -98,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index f4057ee90..8429aa128 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationRunTask(self, "example", + tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -50,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 35e8ecf05..4fffc37f9 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationTags(self, "example", + tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -47,4 +44,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index 40acebd22..292e9c76f 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organizations import DataTfeOrganizations -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizations(self, "foo") + tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -44,4 +41,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 81fff84bc..07a84479c 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -20,29 +20,20 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.random.id import Id -from imports.tfe.data_tfe_outputs import DataTfeOutputs -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - foo = DataTfeOutputs(self, "foo", - organization="my-org", - workspace="my-workspace" - ) - Id(self, "vpc_id", - byte_length=8, - keepers={ - "bar": foo.values.bar - } - ) +```hcl +data "tfe_outputs" "foo" { + organization = "my-org" + workspace = "my-workspace" +} + +resource "random_id" "vpc_id" { + keepers = { + # Generate a new ID any time the value of 'bar' in workspace 'my-org/my-workspace' changes. + bar = data.tfe_outputs.foo.values.bar + } + + byte_length = 8 +} ``` ## Argument Reference @@ -59,4 +50,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index f07549b13..1a5e415fc 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_policy_set import DataTfePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfePolicySet(self, "test", + tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -69,4 +66,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 7d521d696..4a596f35f 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_project import DataTfeProject -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeProject(self, "foo", + tfe.data_tfe_project.DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown index a89adf1e9..3c1958eca 100644 --- a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_gpg_key import DataTfeRegistryGpgKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryGpgKey(self, "example", + tfe.data_tfe_registry_gpg_key.DataTfeRegistryGpgKey(self, "example", id="13DFECCA3B58CE4A", organization="my-org-name" ) @@ -44,4 +41,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown index 3320a1c75..381cfb0e9 100644 --- a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_gpg_keys import DataTfeRegistryGpgKeys -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryGpgKeys(self, "all", + tfe.data_tfe_registry_gpg_keys.DataTfeRegistryGpgKeys(self, "all", organization="my-org-name" ) ``` @@ -45,4 +42,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_provider.html.markdown b/website/docs/cdktf/python/d/registry_provider.html.markdown index f77027dfb..1bc8c11a0 100644 --- a/website/docs/cdktf/python/d/registry_provider.html.markdown +++ b/website/docs/cdktf/python/d/registry_provider.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a public or private provider in th A private provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - RegistryProvider(self, "example", + tfe.registry_provider.RegistryProvider(self, "example", name="my-provider", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): A public provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - RegistryProvider(self, "example", + tfe.registry_provider.RegistryProvider(self, "example", name="aws", namespace="hashicorp", organization="my-org-name", @@ -70,4 +64,4 @@ The following arguments are supported: * `created_at` - The time when the provider was created. * `updated_at` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_providers.html.markdown b/website/docs/cdktf/python/d/registry_providers.html.markdown index c423eb4ba..03eec5f49 100644 --- a/website/docs/cdktf/python/d/registry_providers.html.markdown +++ b/website/docs/cdktf/python/d/registry_providers.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about public and private providers in th All providers: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "all", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "all", organization="my-org-name" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): All private providers: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "private", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "private", organization="my-org-name", registry_name="private" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): Providers with "hashicorp" in their namespace or name: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "hashicorp", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "hashicorp", organization="my-org-name", search="hashicorp" ) @@ -91,4 +82,4 @@ The following arguments are supported: * `created_at` - Time when the provider was created. * `updated_at` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index f103ca385..338f92bfc 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,31 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - DataTfeSamlSettings(self, "foo", - provider=admin - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -74,4 +64,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index c4f0c8a54..6537c5f55 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeSlug(self, "test", + data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=Token.as_string_map(test) + slug=cdktf.Token.as_string_map(data_tfe_slug_test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -51,4 +47,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index d5d2e6bba..e95a873b6 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ssh_key import DataTfeSshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeSshKey(self, "test", + tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 620317566..3e4f2c5e4 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team import DataTfeTeam -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeam(self, "test", + tfe.data_tfe_team.DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index d0e17f1f6..9755cf929 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_access import DataTfeTeamAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamAccess(self, "test", + tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -55,4 +52,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index b6e18fa24..503c9eb11 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamProjectAccess(self, "test", + tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index 6580fd5fb..d812caa3c 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_teams import DataTfeTeams -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeams(self, "foo", + tfe.data_tfe_teams.DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -42,4 +39,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 27fae8882..3db389fb4 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeVariableSet(self, "test", + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -52,4 +49,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index cd3625403..86ecde0ac 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,24 +16,20 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variables import DataTfeVariables -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - workspace_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -42,24 +38,21 @@ class MyConvertedCode(TerraformStack): For variable set variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -from imports.tfe.data_tfe_variables import DataTfeVariables -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeVariableSet(self, "test", + data_tfe_variable_set_test = + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - variable_set_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -87,4 +80,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index a60c39267..f58885718 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspace(self, "test", + tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -88,4 +85,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index ca8b5f27a..31ac562e9 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceIds(self, "all", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "app-frontend", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "prod-apps", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - DataTfeWorkspaceIds(self, "prod-only", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -64,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 84261df7d..a278338f7 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceRunTask(self, "foobar", + tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 94170cc21..5630e1b1b 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,13 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.53.0" + } + } +} ``` As this provider is still at version zero, you should constrain the acceptable @@ -89,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.52.0" + version = "~> 0.53.0" ... } ``` @@ -98,27 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name, *, email, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - Organization(self, "org", - email=email, - name=name - ) +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + token = var.token + version = "~> 0.53.0" +} + +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -138,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 43e9e3b4e..4ecb2b61b 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,45 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.admin_organization_settings import AdminOrganizationSettings -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - a_module_consumer = Organization(self, "a-module-consumer", - email="admin@company.com", - name="my-other-org" - ) - a_module_producer = Organization(self, "a-module-producer", - email="admin@company.com", - name="my-org" - ) - AdminOrganizationSettings(self, "test-settings", - access_beta_tools=False, - global_module_sharing=False, - module_sharing_consumer_organizations=[a_module_consumer.name], - organization=a_module_producer.name, - provider="${tfe.admin}", - workspace_limit=15 - ) +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" +} + +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -72,4 +66,4 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index f0997789c..7f5d6afd1 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,25 +18,21 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - AgentPool(self, "test-agent-pool", + tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), organization_scoped=True ) ``` @@ -67,4 +63,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index b3908db0f..b122ffaf7 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -19,45 +19,37 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test_organization = Organization(self, "test-organization", - email="admin@company.com", - name="my-org-name" - ) - test_workspace = Workspace(self, "test-workspace", - name="my-workspace-name", - organization=test_organization.name - ) - test_agent_pool = AgentPool(self, "test-agent-pool", - name="my-agent-pool-name", - organization=test_organization.name, - organization_scoped=False - ) - allowed = AgentPoolAllowedWorkspaces(self, "allowed", - agent_pool_id=test_agent_pool.id, - allowed_workspace_ids=Token.as_list("${[ for key, value in ${" + - Fn.lookup_nested(test, ["*", "id"]) + "} : value]}") - ) - WorkspaceSettings(self, "test-workspace-settings", - agent_pool_id=allowed.id, - execution_mode="agent", - workspace_id=test_workspace.id - ) +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +} ``` ## Argument Reference @@ -76,4 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 0a6b17a56..7cc7972c4 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,29 +17,24 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_token import AgentToken -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - AgentToken(self, "test-agent-token", - agent_pool_id=test_agent_pool.id, + tfe.agent_token.AgentToken(self, "test-agent-token", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), description="my-agent-token-name" ) ``` @@ -57,4 +52,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index a35a6503c..797abcd7c 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,33 +16,28 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -51,33 +46,28 @@ class MyConvertedCode(TerraformStack): Creating a no-code module with variable options: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -119,4 +109,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index d6e1694af..d84e282c3 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,36 +19,32 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -57,43 +53,41 @@ class MyConvertedCode(TerraformStack): With `destination_type` of `email`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -102,45 +96,43 @@ class MyConvertedCode(TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -188,4 +180,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index a0d2139ef..f739902ae 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -47,18 +44,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -77,18 +71,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -130,4 +121,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opa_version.html.markdown b/website/docs/cdktf/python/r/opa_version.html.markdown index a6beba2e4..82787ff8a 100644 --- a/website/docs/cdktf/python/r/opa_version.html.markdown +++ b/website/docs/cdktf/python/r/opa_version.html.markdown @@ -16,18 +16,15 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.opa_version import OpaVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OpaVersion(self, "test", + tfe.opa_version.OpaVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/opa", version="0.58.0-custom" @@ -65,4 +62,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index babd13d88..4d983a3d8 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Organization(self, "test", + tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -65,4 +62,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown index b96435924..5e64a6c1b 100644 --- a/website/docs/cdktf/python/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -16,35 +16,30 @@ Primarily, this is used to set the default execution mode of an organization. Se Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -from imports.tfe.organization_default_settings import OrganizationDefaultSettings -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - my_agents = AgentPool(self, "my_agents", + tfe_agent_pool_my_agents = tfe.agent_pool.AgentPool(self, "my_agents", name="agent_smiths", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) - org_default = OrganizationDefaultSettings(self, "org_default", - default_agent_pool_id=my_agents.id, + tfe_organization_default_settings_org_default = + tfe.organization_default_settings.OrganizationDefaultSettings(self, "org_default", + default_agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_my_agents.id), default_execution_mode="agent", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) - Workspace(self, "my_workspace", - depends_on=[org_default], + tfe.workspace.Workspace(self, "my_workspace", + depends_on=[tfe_organization_default_settings_org_default], name="my-workspace" ) ``` @@ -67,4 +62,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 93f7c20b1..1582dadb2 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationMembership(self, "test", + tfe.organization_membership.OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -69,4 +66,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 5e606ea7c..492a62139 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_module_sharing import OrganizationModuleSharing -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationModuleSharing(self, "test", + tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -43,4 +40,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 0f562bca2..535677464 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_run_task import OrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationRunTask(self, "example", + tfe.organization_run_task.OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -63,4 +60,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 02e9544c7..66f833f7b 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationToken(self, "test", + tfe.organization_token.OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -49,28 +46,15 @@ never expire. When a token has an expiry: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - # For a more precise conversion please use the --provider flag in convert. - example = Rotating(self, "example", - rotation_days=30 - ) - OrganizationToken(self, "test", - expired_at=Token.as_string(example.rotation_rfc3339), - organization=Token.as_string(org.name) - ) +```hcl +resource "time_rotating" "example" { + rotation_days = 30 +} + +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -87,4 +71,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 3e794c4d2..5da71d87c 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -45,18 +42,15 @@ class MyConvertedCode(TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -97,4 +91,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 83e93767f..3bb9ac5db 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,89 +21,58 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - agent_enabled=Token.as_boolean("true"), - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policies_path="policies/my-policy-set", - policy_tool_version="0.24.1", - vcs_repo=PolicySetVcsRepo( - branch="main", - identifier="my-org-name/my-policy-set-repository", - ingress_submodules=False, - oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) - ), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id + } +} ``` Using manually-specified policies: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - agent_enabled=Token.as_boolean("true"), - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], - policy_tool_version="0.24.1", - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] +} ``` Manually uploaded policy set, in lieu of VCS: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test = DataTfeSlug(self, "test", - source_path="policies/my-policy-set" - ) - tfe_policy_set_test = PolicySet(self, "test_1", - description="A brand new policy set", - name="my-policy-set", - organization="my-org-name", - slug=Token.as_string_map(test), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_policy_set_test.override_logical_id("test") +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -166,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 5904442c7..9758004e6 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,32 +16,28 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.policy_set_parameter import PolicySetParameter -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = + tfe.policy_set_parameter.PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=Token.as_string(tfe_policy_set_test.id), + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -73,4 +69,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 106e20258..0763e2626 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,25 +16,21 @@ Provides a project resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Project(self, "test", + tfe.project.Project(self, "test", name="projectname", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -59,4 +55,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index 85ad3e390..fda2dad7a 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -15,44 +15,27 @@ Adds and removes policy sets from a project Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.project import Project -from imports.tfe.project_policy_set import ProjectPolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test = Organization(self, "test", - email="admin@company.com", - name="my-org-name" - ) - tfe_policy_set_test = PolicySet(self, "test_1", - description="Some description.", - name="my-policy-set", - organization=test.name - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_policy_set_test.override_logical_id("test") - tfe_project_test = Project(self, "test_2", - name="my-project-name", - organization=test.name - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - project_id=Token.as_string(tfe_project_test.id) - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_project_policy_set_test.override_logical_id("test") +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_project" "test" { + name = "my-project-name" + organization = tfe_organization.test.name +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "Some description." + organization = tfe_organization.test.name +} + +resource "tfe_project_policy_set" "test" { + policy_set_id = tfe_policy_set.test.id + project_id = tfe_project.test.id +} ``` ## Argument Reference @@ -74,4 +57,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 648c90db8..da5561bc7 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,40 +16,35 @@ Adds and removes variable sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_3", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -74,4 +69,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown index e087f01bb..256e03929 100644 --- a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -16,22 +16,11 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.registry_gpg_key import RegistryGpgKey -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - RegistryGpgKey(self, "example", - ascii_armor=Token.as_string(Fn.file("my-public-key.asc")), - organization="my-org-name" - ) +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") +} ``` ## Argument Reference @@ -56,4 +45,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 9aadf00f2..91e05ab11 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,35 +16,30 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -52,31 +47,26 @@ class MyConvertedCode(TerraformStack): Create private registry module with tests enabled: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", test_config=[RegistryModuleTestConfig( tests_enabled=True ) @@ -85,7 +75,7 @@ class MyConvertedCode(TerraformStack): branch="main", display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -93,31 +83,27 @@ class MyConvertedCode(TerraformStack): Create private registry module with GitHub App: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", + data_tfe_github_app_installation_gha_installation = + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - RegistryModule(self, "petstore", - organization=test_organization.name, + tfe.registry_module.RegistryModule(self, "petstore", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=Token.as_string(gha_installation.id), + github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -126,26 +112,22 @@ class MyConvertedCode(TerraformStack): Create private registry module without VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-private-registry-module", + tfe.registry_module.RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="private" ) ``` @@ -153,27 +135,23 @@ class MyConvertedCode(TerraformStack): Create public registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-public-registry-module", + tfe.registry_module.RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) ``` @@ -181,33 +159,29 @@ class MyConvertedCode(TerraformStack): Create no-code provisioning registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", + tfe_registry_module_test_no_code_provisioning_registry_module = + tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) - NoCodeModule(self, "foobar", - organization=test_organization.id, - registry_module=test_no_code_provisioning_registry_module.id + tfe.no_code_module.NoCodeModule(self, "foobar", + organization=cdktf.Token.as_string(tfe_organization_test_organization.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) ) ``` @@ -265,4 +239,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_provider.html.markdown b/website/docs/cdktf/python/r/registry_provider.html.markdown index 5fdd3ac45..4090c9498 100644 --- a/website/docs/cdktf/python/r/registry_provider.html.markdown +++ b/website/docs/cdktf/python/r/registry_provider.html.markdown @@ -16,25 +16,22 @@ Manages public and private providers in the private registry. Create private provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import RegistryProvider -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - example = Organization(self, "example", + tfe_organization_example = tfe.organization.Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = RegistryProvider(self, "example_1", + tfe_registry_provider_example = + tfe.registry_provider.RegistryProvider(self, "example_1", name="my-provider", - organization=example.name + organization=cdktf.Token.as_string(tfe_organization_example.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_provider_example.override_logical_id("example") @@ -43,26 +40,23 @@ class MyConvertedCode(TerraformStack): Create public provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe. import RegistryProvider -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - example = Organization(self, "example", + tfe_organization_example = tfe.organization.Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = RegistryProvider(self, "example_1", + tfe_registry_provider_example = + tfe.registry_provider.RegistryProvider(self, "example_1", name="aws", namespace="hashicorp", - organization=example.name, + organization=cdktf.Token.as_string(tfe_organization_example.name), registry_name="public" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -100,4 +94,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index 1ef9fc6f8..f4dd3b56c 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,34 +19,29 @@ to up to 20 source workspaces. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.run_trigger import RunTrigger -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_sourceable = Workspace(self, "test-sourceable", + tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - test_workspace = Workspace(self, "test-workspace", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - RunTrigger(self, "test", - sourceable_id=test_sourceable.id, - workspace_id=test_workspace.id + tfe.run_trigger.RunTrigger(self, "test", + sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) ) ``` @@ -70,4 +65,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index 3842ee3c9..0fa49386c 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,28 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.provider import TfeProvider -from imports.tfe.saml_settings import SamlSettings -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=admin_token.string_value - ) - SamlSettings(self, "this", - idp_cert="foobarCertificate", - slo_endpoint_url="https://example.com/slo_endpoint_url", - sso_endpoint_url="https://example.com/sso_endpoint_url" - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -75,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index 39b7518af..73d0ed16c 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_policy import SentinelPolicy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelPolicy(self, "test", + tfe.sentinel_policy.SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_version.html.markdown b/website/docs/cdktf/python/r/sentinel_version.html.markdown index f1cf14543..c94cc8b4d 100644 --- a/website/docs/cdktf/python/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_version.html.markdown @@ -16,18 +16,15 @@ Manage Sentinel versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_version import SentinelVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelVersion(self, "test", + tfe.sentinel_version.SentinelVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/sentinel.zip", version="0.24.0-custom" @@ -65,4 +62,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 777ce33f4..177974c7f 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.ssh_key import SshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SshKey(self, "test", + tfe.ssh_key.SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -52,4 +49,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 8986aeff9..bec6f6a88 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): Organization Permission usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -97,4 +91,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index a52e519f8..ab50b1a2d 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_access import TeamAccess -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = TeamAccess(self, "test_2", + tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", access="read", - team_id=test.id, - workspace_id=Token.as_string(tfe_workspace_test.id) + team_id=cdktf.Token.as_string(tfe_team_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -82,4 +77,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index e0e91ab64..e146c6558 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_member import TeamMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = TeamMember(self, "test_1", - team_id=test.id, + tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -65,4 +61,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 405b4b098..7f8e1ac35 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -51,30 +47,23 @@ class MyConvertedCode(TerraformStack): With a set of usernames: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - all_usernames = Fn.toset(["user1", "user2"]) - test = Team(self, "test", - name="my-team-name", - organization="my-org-name" - ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, - usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_team_members_test.override_logical_id("test") +```hcl +locals { + all_usernames = toset([ + "user1", + "user2", + ]) +} + +resource "tfe_team" "test" { + name = "my-team-name" + organization = "my-org-name" +} + +resource "tfe_team_members" "test" { + team_id = tfe_team.test.id + usernames = [for user in local.all_usernames : user] +} ``` ## Argument Reference @@ -96,4 +85,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 048cfa5d9..5353364f6 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,32 +24,29 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_member import TeamOrganizationMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_1", + tfe_team_test = tfe.team.Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", - organization_membership_id=test.id, - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = + tfe.team_organization_member.TeamOrganizationMember(self, "test_2", + organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -75,4 +72,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 7895bcf61..04ced9cca 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,36 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - sample = OrganizationMembership(self, "sample", + tfe_organization_membership_sample = + tfe.organization_membership.OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_2", + tfe_team_test = tfe.team.Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[test.id, sample.id], - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.id), + cdktf.Token.as_string(tfe_organization_membership_sample.id) + ], + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -62,38 +63,35 @@ class MyConvertedCode(TerraformStack): With a set of organization members: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformIterator, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) + all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" + ]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - all_membership_for_each_iterator = TerraformIterator.from_list( - Token.as_any(all_users)) - OrganizationMembership(self, "all_membership", - email=Token.as_string(all_membership_for_each_iterator.key), + tfe_organization_membership_all_membership_for_each_iterator = + cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) + tfe.organization_membership.OrganizationMembership(self, "all_membership", + email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), organization="my-org-name", - for_each=all_membership_for_each_iterator + for_each=tfe_organization_membership_all_membership_for_each_iterator ) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", - organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=test.id + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", + organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -115,4 +113,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 6a9a2b5c2..826b49805 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,31 +16,27 @@ Associate a team to permissions on a project. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - admin = Team(self, "admin", + tfe_team_admin = tfe.team.Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = + tfe.team_project_access.TeamProjectAccess(self, "admin_2", access="admin", - project_id=test.id, - team_id=admin.id + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_admin.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -88,36 +84,31 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - dev = Team(self, "dev", + tfe_team_dev = tfe.team.Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - TeamProjectAccess(self, "custom", + tfe.team_project_access.TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=test.id, - team_id=dev.id, + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_dev.id), workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -146,4 +137,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index d3a7c2688..81354724f 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = TeamToken(self, "test_1", - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -55,35 +51,20 @@ never expire. When a token has an expiry: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - # For a more precise conversion please use the --provider flag in convert. - test = Team(self, "test", - name="my-team-name", - organization="my-org-name" - ) - example = Rotating(self, "example", - rotation_days=30 - ) - tfe_team_token_test = TeamToken(self, "test_2", - expired_at=Token.as_string(example.rotation_rfc3339), - team_id=test.id - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_team_token_test.override_logical_id("test") +```hcl +resource "tfe_team" "test" { + name = "my-team-name" + organization = "my-org-name" +} + +resource "time_rotating" "example" { + rotation_days = 30 +} + +resource "tfe_team_token" "test" { + team_id = tfe_team.test.id + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -99,4 +80,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 010e15457..5d19d8f3e 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.terraform_version import TerraformVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - TerraformVersion(self, "test", + tfe.terraform_version.TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -65,4 +62,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index a606daed4..a32fa5e33 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,35 +16,30 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = Variable(self, "test_2", + tfe_variable_test = tfe.variable.Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -53,44 +48,39 @@ class MyConvertedCode(TerraformStack): Basic usage for variable sets: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -129,41 +119,33 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - sensitive_var = Variable(self, "sensitive_var", - category="terraform", - key="sensitive_key", - sensitive=True, - value="sensitive_value", - workspace_id=workspace.id - ) - visible_var = Variable(self, "visible_var", - category="terraform", - key="visible_key", - sensitive=False, - value="visible_value", - workspace_id=workspace.id - ) - Workspace(self, "sensitive_workspace", - name="workspace-${" + sensitive_var.value + "}", - organization="organization name" - ) - Workspace(self, "visible_workspace", - name="workspace-${" + visible_var.readable_value + "}", - organization="organization name" - ) +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" +} + ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -189,4 +171,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index f5e16a6bd..524373524 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,159 +16,142 @@ Creates, updates and destroys variable sets. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="projectname", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_3", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_5", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` Create a priority variable set: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Variable set applied to all workspaces.", name="Global Varset", - organization=test.name, + organization=cdktf.Token.as_string(tfe_organization_test.name), priority=True ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -198,4 +181,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 99f3ba59a..606d02e9b 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -20,25 +20,21 @@ Provides a workspace resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Workspace(self, "test", + tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), tag_names=["test", "app"] ) ``` @@ -46,38 +42,33 @@ class MyConvertedCode(TerraformStack): Usage with vcs_repo: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - Workspace(self, "parent", + tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) ``` @@ -191,4 +182,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index bbf800503..733784218 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set import WorkspacePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = + tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index ab821e937..5f052b546 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = + tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -76,4 +71,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index 200047332..e79741bc7 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,52 +24,46 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - child = Workspace(self, "child", + tfe_workspace_child = tfe.workspace.Workspace(self, "child", name="child-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - ws_run_parent = WorkspaceRun(self, "ws_run_parent", + tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -82,64 +76,58 @@ class MyConvertedCode(TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) - WorkspaceRun(self, "ws_run_child", + tfe.workspace_run.WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[ws_run_parent], + depends_on=[tfe_workspace_run_ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=child.id + workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) ) ``` With manual confirmation: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -147,49 +135,43 @@ class MyConvertedCode(TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` With no retries: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -199,7 +181,7 @@ class MyConvertedCode(TerraformStack): retry=False, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` @@ -228,4 +210,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index b27948513..450d01813 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,23 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.workspace_run_task import WorkspaceRunTask -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - WorkspaceRunTask(self, "example", - enforcement_level="advisory", - task_id=tfe_organization_run_task.example.id, - workspace_id=tfe_workspace.example.id - ) +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" +} ``` ## Argument Reference @@ -58,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index 3825237d4..b2982ff8d 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -16,105 +16,91 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = Workspace(self, "test", + tfe_workspace_test = tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - WorkspaceSettings(self, "test-settings", + tfe.workspace_settings.WorkspaceSettings(self, "test-settings", execution_mode="local", - workspace_id=test.id + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) ``` With `execution_mode` of `agent`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = Workspace(self, "test", + tfe_workspace_test = tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - tfe_agent_pool_allowed_workspaces_test = AgentPoolAllowedWorkspaces(self, "test_3", - agent_pool_id=test_agent_pool.id, - allowed_workspace_ids=[test.id] + tfe_agent_pool_allowed_workspaces_test = + tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test_3", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + allowed_workspace_ids=[cdktf.Token.as_string(tfe_workspace_test.id)] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_agent_pool_allowed_workspaces_test.override_logical_id("test") - WorkspaceSettings(self, "test-settings", - agent_pool_id=Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), + tfe.workspace_settings.WorkspaceSettings(self, "test-settings", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), execution_mode="agent", - workspace_id=test.id + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) ``` This resource may be used as a data source when no optional arguments are defined: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformOutput, Op, Fn, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - tfe_workspace_settings_test = WorkspaceSettings(self, "test_1", - workspace_id=Token.as_string(test.id) + tfe_workspace_settings_test = + tfe.workspace_settings.WorkspaceSettings(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_settings_test.override_logical_id("test") - TerraformOutput(self, "workspace-explicit-local-execution", - value=Fn.alltrue( - Token.as_any([ - Op.eq(tfe_workspace_settings_test.execution_mode, "local"), - Fn.lookup_nested(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" + cdktf.TerraformOutput(self, "workspace-explicit-local-execution", + value=cdktf.Fn.alltrue( + cdktf.Token.as_any([ + cdktf.Op.eq(tfe_workspace_settings_test.execution_mode, "local"), + cdktf.property_access(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" ]) ])) ) @@ -152,4 +138,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index 0d3f249f3..de6cad570 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes variable sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index 679a0d95e..ffbc8593d 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeAgentPool(this, "test", { + new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index de4de22b5..7aefb2d43 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,20 +16,21 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - installationId: 12345678, - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + installationId: 12345678, + } + ); } } @@ -38,20 +39,21 @@ class MyConvertedCode extends TerraformStack { ### Finding a Github App Installation by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - name: "github_username_or_organization", - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "github_username_or_organization", + } + ); } } @@ -61,7 +63,7 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported. At least one of `name`, `installationId` must be set. -* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. +* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://githubCom/settings/installations/12345678`. * `name` - (Optional) Name of the Github user or organization account that installed the app. Must be one of: `installationId` or `name`. @@ -72,4 +74,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 93428bb23..3aef65fe1 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,20 +14,21 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformOutput, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const addresses = new DataTfeIpRanges(this, "addresses", {}); - new TerraformOutput(this, "notifications_ips", { - value: addresses.notifications, + const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( + this, + "addresses", + {} + ); + new cdktf.TerraformOutput(this, "notifications_ips", { + value: dataTfeIpRangesAddresses.notifications, }); } } @@ -48,4 +49,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/no_code_module.html.markdown b/website/docs/cdktf/typescript/d/no_code_module.html.markdown index e680d7bd9..e8a11ff3b 100644 --- a/website/docs/cdktf/typescript/d/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/d/no_code_module.html.markdown @@ -13,35 +13,15 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeNoCodeModule } from "./.gen/providers/tfe/data-tfe-no-code-module"; -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const foobar = new NoCodeModule(this, "foobar", { - organization: Token.asString(tfeOrganizationFoobar.id), - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); - const dataTfeNoCodeModuleFoobar = new DataTfeNoCodeModule( - this, - "foobar_1", - { - id: foobar.id, - } - ); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - dataTfeNoCodeModuleFoobar.overrideLogicalId("foobar"); - } +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id } +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} ``` ## Argument Reference @@ -59,4 +39,4 @@ The following arguments are supported: * `versionPin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index 30064e5c7..fd3cee123 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -38,18 +35,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -61,18 +55,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its service provider ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -92,9 +83,9 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, - `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or - `gitlab_enterprise_edition`. + must be one of: `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, + `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or + `gitlabEnterpriseEdition`. ## Attributes Reference @@ -111,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 7f2b0b3fc..2ceb1b703 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganization(this, "foo", { + new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -45,11 +42,11 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. -* `collaboratorAuthPolicy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. +* `collaboratorAuthPolicy` - Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index bc6075dcf..290c8836c 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const bar = new Organization(this, "bar", { + const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new DataTfeOrganizationMembers(this, "foo", { - organization: bar.name, + new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { + organization: cdktf.Token.asString(tfeOrganizationBar.name), }); } } @@ -55,4 +51,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index 1f6b95439..a5a620a28 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,21 +22,22 @@ be updated manually. ### Fetch by email ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - email: "user@company.com", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + email: "user@company.com", + organization: "my-org-name", + } + ); } } @@ -45,21 +46,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by username ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - username: "my-username", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + username: "my-username", + } + ); } } @@ -68,21 +70,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by organization membership ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + } + ); } } @@ -107,4 +110,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index eb3ef17ab..1ee342ef1 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,21 +16,22 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationRunTask(this, "example", { - name: "task-name", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( + this, + "example", + { + name: "task-name", + organization: "my-org-name", + } + ); } } @@ -53,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index fa7618293..d608cc1e3 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationTags(this, "example", { + new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -49,5 +46,5 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag -* `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file +* `workspaceCount` - The number of workspaces the tag is associate with + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 82fbe35c5..31989059d 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizations(this, "foo", {}); + new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); } } @@ -47,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 2586d6d5f..9b23d1a90 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -16,32 +16,37 @@ that are known to be non-sensitive. ## Example Usage -Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as seen below: +Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as seen below: -In the example below, assume we have outputs defined in a `my-org/my-workspace`: +In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Id } from "./.gen/providers/random/id"; -import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as random from "./.gen/providers/random"; +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foo = new DataTfeOutputs(this, "foo", { - organization: "my-org", - workspace: "my-workspace", - }); - new Id(this, "vpc_id", { - byteLength: 8, - keepers: { - bar: foo.values.bar, - }, + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. + For a more precise conversion please use the --provider flag in convert.*/ + const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( + this, + "foo", + { + organization: "my-org", + workspace: "my-workspace", + } + ); + new random.id.Id(this, "vpc_id", { + byte_length: 8, + keepers: [ + { + bar: dataTfeOutputsFoo.values.bar, + }, + ], }); } } @@ -62,4 +67,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 519edc03a..85028b02e 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfePolicySet(this, "test", { + new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -72,4 +69,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index a6059773f..5f30b68c5 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeProject(this, "foo", { + new tfe.dataTfeProject.DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown index f85d500f4..265d57fbc 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/data-tfe-registry-gpg-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryGpgKey(this, "example", { + new tfe.dataTfeRegistryGpgKey.DataTfeRegistryGpgKey(this, "example", { id: "13DFECCA3B58CE4A", organization: "my-org-name", }); @@ -47,4 +44,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown index 67edda778..83d0e0d82 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/data-tfe-registry-gpg-keys"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryGpgKeys(this, "all", { + new tfe.dataTfeRegistryGpgKeys.DataTfeRegistryGpgKeys(this, "all", { organization: "my-org-name", }); } @@ -48,4 +45,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_provider.html.markdown b/website/docs/cdktf/typescript/d/registry_provider.html.markdown index 63cf354e6..d5bd8c2c2 100644 --- a/website/docs/cdktf/typescript/d/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_provider.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a public or private provider in th A private provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new RegistryProvider(this, "example", { + new tfe.registryProvider.RegistryProvider(this, "example", { name: "my-provider", organization: "my-org-name", }); @@ -39,22 +36,19 @@ class MyConvertedCode extends TerraformStack { A public provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new RegistryProvider(this, "example", { + new tfe.registryProvider.RegistryProvider(this, "example", { name: "aws", namespace: "hashicorp", organization: "my-org-name", - registry_name: "public", + registryName: "public", }); } } @@ -76,4 +70,4 @@ The following arguments are supported: * `createdAt` - The time when the provider was created. * `updatedAt` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_providers.html.markdown b/website/docs/cdktf/typescript/d/registry_providers.html.markdown index 9750ab164..aaf6fb892 100644 --- a/website/docs/cdktf/typescript/d/registry_providers.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_providers.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about public and private providers in th All providers: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "all", { + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "all", { organization: "my-org-name", }); } @@ -38,20 +35,17 @@ class MyConvertedCode extends TerraformStack { All private providers: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "private", { + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "private", { organization: "my-org-name", - registry_name: "private", + registryName: "private", }); } } @@ -61,21 +55,22 @@ class MyConvertedCode extends TerraformStack { Providers with "hashicorp" in their namespace or name: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "hashicorp", { - organization: "my-org-name", - search: "hashicorp", - }); + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders( + this, + "hashicorp", + { + organization: "my-org-name", + search: "hashicorp", + } + ); } } @@ -100,4 +95,4 @@ The following arguments are supported: * `createdAt` - Time when the provider was created. * `updatedAt` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 0f2535cb1..eac1110a0 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,34 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new DataTfeSamlSettings(this, "foo", { - provider: admin, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token } +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -77,4 +64,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 84a8bf12d..af7210b06 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -13,7 +13,7 @@ intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files be sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows -resources such as `tfe_policy_set` track the files and upload a new gzip compressed +resources such as `tfePolicySet` track the files and upload a new gzip compressed tar file containing configuration files (a Terraform "slug") when those files change. ## Example Usage @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeSlug(this, "test", { + const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: Token.asStringMap(test), + slug: cdktf.Token.asStringMap(dataTfeSlugTest), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -54,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 0a783fac4..0d701abdd 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeSshKey(this, "test", { + new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 95b80260f..51606205e 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeam(this, "test", { + new tfe.dataTfeTeam.DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index e74140956..8cd9aea95 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamAccess(this, "test", { + new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -53,9 +50,9 @@ The `permissions` block contains: * `runs` - The permission granted to runs. Valid values are `read`, `plan`, or `apply` * `variables` - The permissions granted to variables. Valid values are `none`, `read`, or `write` -* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `read-outputs`, `read`, or `write` +* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `readOutputs`, `read`, or `write` * `sentinelMocks` - The permissions granted to Sentinel mocks. Valid values are `none` or `read` * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index b53b01c7b..65ed3def9 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamProjectAccess(this, "test", { + new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index a882c09e3..d19832163 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeams(this, "foo", { + new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index 3ff81d38e..c5bab02a4 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeVariableSet(this, "test", { + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -55,4 +52,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 09ecfabe9..93b932f9d 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,25 +16,29 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -45,25 +49,26 @@ class MyConvertedCode extends TerraformStack { For variable set variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - variableSetId: Token.asString(test.id), - }); + const dataTfeVariableSetTest = + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -93,4 +98,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 5a491e8d7..99a8e55a8 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspace(this, "test", { + new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -76,7 +73,7 @@ In addition to all arguments above, the following attributes are exported: * `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. -* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. +* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfeWorkspaceSettings` resource](tfe_workspace_settings) for details. * `htmlUrl` - The URL to the browsable HTML overview of the workspace @@ -91,4 +88,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 31628da96..3f83d01b9 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceIds(this, "all", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "app-frontend", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "prod-apps", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new DataTfeWorkspaceIds(this, "prod-only", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -55,7 +52,7 @@ The following arguments are supported. At least one of `names` or `tagNames` mus match a valid workspace will be omitted from the results, but are not an error. To select _all_ workspaces for an organization, provide a list with a single - asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*-prod]`, `[test-*]`, `[*dev*]`. + asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*Prod]`, `[test-*]`, `[*dev*]`. * `tagNames` - (Optional) A list of tag names to search for. * `excludeTags` - (Optional) A list of tag names to exclude when searching. * `organization` - (Required) Name of the organization. @@ -67,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 5d1a71a5b..7aa26820c 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceRunTask(this, "foobar", { + new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 13c0b5f4f..f5fc97051 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -43,8 +43,8 @@ There are several ways to provide the required token: - **Set the `token` argument in the provider configuration.** You can set the `token` argument in the provider configuration. Use an input variable for the token. -- **Set the `TFE_TOKEN` environment variable:** The provider can read the -`TFE_TOKEN` environment variable and the token stored there to authenticate. +- **Set the `tfeToken` environment variable:** The provider can read the +`tfeToken` environment variable and the token stored there to authenticate. When configuring the input variable for either of these options, mark them as sensitive. @@ -62,9 +62,9 @@ Terraform on your local command line, it can automatically discover the credenti [`terraform login`](https://developer.hashicorp.com/terraform/cli/commands/login). - **Set a `credentials` block in your CLI config file (.terraformrc):** See the [CLI Configuration File documentation](/docs/commands/cli-config.html). -If you used the `TF_CLI_CONFIG_FILE` environment variable to specify a +If you used the `tfCliConfigFile` environment variable to specify a non-default location for .terraformrc, the provider will also use that location. -Using a `credentials_helper` block is not supported. +Using a `credentialsHelper` block is not supported. ## Versions @@ -73,26 +73,24 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.53.0" + } } } - ``` As this provider is still at version zero, you should constrain the acceptable provider versions on the minor version. -The above snippet using `required_providers` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: +The above snippet using `requiredProviders` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: ```hcl provider "tfe" { - version = "~> 0.52.0" + version = "~> 0.53.0" ... } ``` @@ -101,34 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -interface MyConfig { - email: any; - name: any; -} -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string, config: MyConfig) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - new Organization(this, "org", { - email: config.email, - name: config.name, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + token = var.token + version = "~> 0.53.0" } +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -137,15 +118,15 @@ The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the - `TFE_HOSTNAME` environment variable. + `tfeHostname` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. - Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` + Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` environment variable. * `organization` - (Optional) The default organization that resources should belong to. If provided, it's usually possible to omit resource-specific `organization` arguments. Ensure that the organization already exists prior to using this argument. - This can also be specified using the `TFE_ORGANIZATION` environment variable. + This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index fbbaca18a..1aaced2ae 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,48 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - const aModuleConsumer = new Organization(this, "a-module-consumer", { - email: "admin@company.com", - name: "my-other-org", - }); - const aModuleProducer = new Organization(this, "a-module-producer", { - email: "admin@company.com", - name: "my-org", - }); - new AdminOrganizationSettings(this, "test-settings", { - accessBetaTools: false, - globalModuleSharing: false, - moduleSharingConsumerOrganizations: [aModuleConsumer.name], - organization: aModuleProducer.name, - provider: "${tfe.admin}", - workspaceLimit: 15, - }); - } +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" } +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -75,4 +66,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 1e9d0c0f2..40f488f24 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new AgentPool(this, "test-agent-pool", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.agentPool.AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index f532fa426..78e686b1f 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -17,53 +17,39 @@ for Business account. ## Example Usage -In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. - -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.name, - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - organizationScoped: false, - }); - const allowed = new AgentPoolAllowedWorkspaces(this, "allowed", { - agentPoolId: testAgentPool.id, - allowedWorkspaceIds: Token.asList( - "${[ for key, value in ${" + - Fn.lookupNested(test, ["*", "id"]) + - "} : value]}" - ), - }); - new WorkspaceSettings(this, "test-workspace-settings", { - agentPoolId: allowed.id, - executionMode: "agent", - workspaceId: testWorkspace.id, - }); - } +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] } +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +} ``` ## Argument Reference @@ -82,4 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index a9b84db50..e37e6da4d 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,29 +17,32 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentToken } from "./.gen/providers/tfe/agent-token"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.id, - }); - new AgentToken(this, "test-agent-token", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.agentToken.AgentToken(this, "test-agent-token", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), description: "my-agent-token-name", }); } @@ -60,4 +63,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index 0e9040064..f740a6434 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,34 +16,41 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -54,46 +61,53 @@ class MyConvertedCode extends TerraformStack { Creating a no-code module with variable options: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -127,4 +141,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index a4d382fde..81ee6208b 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { - name: "my-workspace-name", - organization: test.id, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_2", + "test", { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: Token.asString(tfeWorkspaceTest.id), + email: "admin@company.com", + name: "my-org-name", } ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,52 +64,50 @@ class MyConvertedCode extends TerraformStack { With `destinationType` of `email`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -117,60 +115,58 @@ class MyConvertedCode extends TerraformStack { ``` -(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `email_users`: +(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -188,22 +184,22 @@ The following arguments are supported: * `generic` * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later * `slack` - * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value - _must not_ be provided if `destinationType` is `generic`, `microsoft-teams`, or `slack`. + _must not_ be provided if `destinationType` is `generic`, `microsoftTeams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided - if `destinationType` is `generic`, `microsoft-teams`, or `slack`. + if `destinationType` is `generic`, `microsoftTeams`, or `slack`. * `enabled` - (Optional) Whether the notification configuration should be enabled or not. Disabled configurations will not send any notifications. Defaults to `false`. * `token` - (Optional) A write-only secure token for the notification configuration, which can be used by the receiving server to verify request authenticity when configured for notification configurations with a destination type of `generic`. Defaults to `null`. - This value _must not_ be provided if `destinationType` is `email`, `microsoft-teams`, or `slack`. + This value _must not_ be provided if `destinationType` is `email`, `microsoftTeams`, or `slack`. * `triggers` - (Optional) The array of triggers for which this notification configuration will - send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` - `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, or `assessment:failed`. + send notifications. Valid values are `run:created`, `run:planning`, `run:needsAttention`, `run:applying` + `run:completed`, `run:errored`, `assessment:checkFailure`, `assessment:drifted`, or `assessment:failed`. If omitted, no notification triggers are configured. -* `url` - (Required if `destinationType` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification +* `url` - (Required if `destinationType` is `generic`, `microsoftTeams`, or `slack`) The HTTP or HTTPS URL of the notification configuration where notification requests will be made. This value _must not_ be provided if `destinationType` is `email`. * `workspaceId` - (Required) The id of the workspace that owns the notification configuration. @@ -220,4 +216,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 1a3b53615..da2e6cca5 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -50,18 +47,15 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -84,18 +78,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -119,27 +110,27 @@ The following arguments are supported: * `name` - (Optional) Display name for the OAuth Client. Defaults to the `serviceProvider` if not supplied. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `apiUrl` - (Required) The base URL of your VCS provider's API (e.g. - `https://api.github.com` or `https://ghe.example.com/api/v3`). + `https://apiGithubCom` or `https://gheExampleCom/api/v3`). * `httpUrl` - (Required) The homepage of your VCS provider (e.g. - `https://github.com` or `https://ghe.example.com`). -* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghp_xxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. -* `privateKey` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account + `https://githubCom` or `https://gheExampleCom`). +* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghpXxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. +* `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for BitBucket Server, this secret is the +* `secret` - (Required for `bitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the the text of the SSH private key associated with your BitBucket Server Application Link. -* `rsaPublicKey` - (Required for `bitbucket_server`) Required for BitBucket +* `rsaPublicKey` - (Required for `bitbucketServer`) Required for BitBucket Server in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your BitBucket Server Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, - `gitlab_community_edition`, or `gitlab_enterprise_edition`. + options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, `github`, `githubEnterprise`, `gitlabHosted`, + `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown index e1d634b0d..1dc2735fc 100644 --- a/website/docs/cdktf/typescript/r/opa_version.html.markdown +++ b/website/docs/cdktf/typescript/r/opa_version.html.markdown @@ -16,18 +16,15 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OpaVersion } from "./.gen/providers/tfe/opa-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OpaVersion(this, "test", { + new tfe.opaVersion.OpaVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/opa", version: "0.58.0-custom", @@ -68,4 +65,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 3ba278ef1..e8adfbb3a 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Organization(this, "test", { + new tfe.organization.Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -47,7 +44,7 @@ The following arguments are supported: * `sessionRememberMinutes` - (Optional) Session expiration. Defaults to `20160`. * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` - or `two_factor_mandatory`). Defaults to `password`. + or `twoFactorMandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. @@ -68,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown index cf68a6606..76da8d7fd 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -9,42 +9,49 @@ description: |- # tfe_organization_default_settings -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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). +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). ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationDefaultSettings } from "./.gen/providers/tfe/organization-default-settings"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const myAgents = new AgentPool(this, "my_agents", { - name: "agent_smiths", - organization: test.name, - }); - const orgDefault = new OrganizationDefaultSettings(this, "org_default", { - defaultAgentPoolId: myAgents.id, - defaultExecutionMode: "agent", - organization: test.name, - }); - new Workspace(this, "my_workspace", { - dependsOn: [orgDefault], + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolMyAgents = new tfe.agentPool.AgentPool( + this, + "my_agents", + { + name: "agent_smiths", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + } + ); + const tfeOrganizationDefaultSettingsOrgDefault = + new tfe.organizationDefaultSettings.OrganizationDefaultSettings( + this, + "org_default", + { + defaultAgentPoolId: cdktf.Token.asString(tfeAgentPoolMyAgents.id), + defaultExecutionMode: "agent", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + } + ); + new tfe.workspace.Workspace(this, "my_workspace", { + dependsOn: [tfeOrganizationDefaultSettingsOrgDefault], name: "my-workspace", }); } @@ -70,4 +77,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 094241ddd..1ba96fccd 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationMembership(this, "test", { + new tfe.organizationMembership.OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -72,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 23972ab15..7a8d6f4bc 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -12,25 +12,22 @@ description: |- Manage module sharing for an organization. This resource requires the use of an admin token and is for Terraform Enterprise only. --> **NOTE:** `tfe_organization_module_sharing` is deprecated in favor of using `tfe_admin_organization_settings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. +-> **NOTE:** `tfeOrganizationModuleSharing` is deprecated in favor of using `tfeAdminOrganizationSettings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationModuleSharing(this, "test", { + new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -46,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index a52e2e0b8..af88749b5 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationRunTask(this, "example", { + new tfe.organizationRunTask.OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 273e96979..13d4d4730 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationToken(this, "test", { + new tfe.organizationToken.OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -52,31 +49,15 @@ never expire. When a token has an expiry: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - For a more precise conversion please use the --provider flag in convert.*/ - const example = new Rotating(this, "example", { - rotation_days: 30, - }); - new OrganizationToken(this, "test", { - expiredAt: Token.asString(example.rotationRfc3339), - organization: Token.asString(org.name), - }); - } +```hcl +resource "time_rotating" "example" { + rotation_days = 30 } +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -93,4 +74,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index e9edf7291..d99b59da7 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -48,18 +45,15 @@ class MyConvertedCode extends TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -86,8 +80,8 @@ The following arguments are supported: needs to run within your Rego code. Required for all OPA policies. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values for Sentinel are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults - to `soft-mandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults + values for Sentinel are `advisory`, `hardMandatory` and `softMandatory`. Defaults + to `softMandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults to `advisory`. ## Attributes Reference @@ -103,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 6c3c74812..3a3a14959 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,98 +21,58 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - agentEnabled: Token.asBoolean("true"), - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policiesPath: "policies/my-policy-set", - policyToolVersion: "0.24.1", - vcsRepo: { - branch: "main", - identifier: "my-org-name/my-policy-set-repository", - ingressSubmodules: false, - oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), - }, - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id } } - ``` Using manually-specified policies: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - agentEnabled: Token.asBoolean("true"), - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policyIds: [Token.asString(tfeSentinelPolicyTest.id)], - policyToolVersion: "0.24.1", - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - } +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } - ``` Manually uploaded policy set, in lieu of VCS: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new DataTfeSlug(this, "test", { - sourcePath: "policies/my-policy-set", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { - description: "A brand new policy set", - name: "my-policy-set", - organization: "my-org-name", - slug: Token.asStringMap(test), - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfePolicySetTest.overrideLogicalId("test"); - } +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" } +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -143,10 +103,10 @@ The following arguments are supported: new resource if changed. This value _must not_ be provided if `policyIds` are provided. * `workspaceIds` - (Optional) A list of workspace IDs. This value _must not_ be provided if `global` is provided. -* `slug` - (Optional) A reference to the `tfe_slug` data source that contains +* `slug` - (Optional) A reference to the `tfeSlug` data source that contains the `sourcePath` to where the local policies are located. This is used when policies are located locally, and can only be used when there is no VCS repo or -explicit Policy IDs. This _requires_ the usage of the `tfe_slug` data source. +explicit Policy IDs. This _requires_ the usage of the `tfeSlug` data source. -> **Note:** When neither `vcsRepo` or `policyIds` is not specified, the current default is to create an empty non-VCS policy set. @@ -175,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index 9acedef19..f7d672c9d 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = + new tfe.policySetParameter.PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 98f69dc50..06087bc21 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Project(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.project.Project(this, "test", { name: "projectname", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 87d6f764d..596bb5179 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -15,47 +15,27 @@ Adds and removes policy sets from a project Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { - description: "Some description.", - name: "my-policy-set", - organization: test.name, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new Project(this, "test_2", { - name: "my-project-name", - organization: test.name, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - projectId: Token.asString(tfeProjectTest.id), - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeProjectPolicySetTest.overrideLogicalId("test"); - } +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" } +resource "tfe_project" "test" { + name = "my-project-name" + organization = tfe_organization.test.name +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "Some description." + organization = tfe_organization.test.name +} + +resource "tfe_project_policy_set" "test" { + policy_set_id = tfe_policy_set.test.id + project_id = tfe_project.test.id +} ``` ## Argument Reference @@ -77,4 +57,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index cdb622020..46d8cdd71 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -15,47 +15,27 @@ Adds and removes variable sets from a project Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { - name: "my-project-name", - organization: test.name, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { - description: "Some description.", - name: "Test Varset", - organization: test.name, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeProjectVariableSetTest.overrideLogicalId("test"); - } +```hcl +resource "tfe_organization" "test" { + name = "my-org-name" + email = "admin@company.com" } +resource "tfe_project" "test" { + name = "my-project-name" + organization = tfe_organization.test.name +} + +resource "tfe_variable_set" "test" { + name = "Test Varset" + description = "Some description." + organization = tfe_organization.test.name +} + +resource "tfe_project_variable_set" "test" { + variable_set_id = tfe_variable_set.test.id + project_id = tfe_project.test.id +} ``` ## Argument Reference @@ -77,4 +57,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index 3d4c9f943..851e98f10 100644 --- a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -16,25 +16,11 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryGpgKey } from "./.gen/providers/tfe/registry-gpg-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new RegistryGpgKey(this, "example", { - asciiArmor: Token.asString(Fn.file("my-public-key.asc")), - organization: "my-org-name", - }); - } +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") } - ``` ## Argument Reference @@ -59,4 +45,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 1404322a4..137232711 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,35 +16,42 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -55,31 +62,36 @@ class MyConvertedCode extends TerraformStack { Create private registry module with tests enabled: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { testConfig: [ { testsEnabled: true, @@ -89,7 +101,9 @@ class MyConvertedCode extends TerraformStack { branch: "main", displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -100,35 +114,37 @@ class MyConvertedCode extends TerraformStack { Create private registry module with GitHub App: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const ghaInstallation = new DataTfeGithubAppInstallation( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "gha_installation", + "test-organization", { - name: "YOUR_GH_NAME", + email: "admin@company.com", + name: "my-org-name", } ); - new RegistryModule(this, "petstore", { - organization: testOrganization.name, + const dataTfeGithubAppInstallationGhaInstallation = + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "YOUR_GH_NAME", + } + ); + new tfe.registryModule.RegistryModule(this, "petstore", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: Token.asString(ghaInstallation.id), + githubAppInstallationId: cdktf.Token.asString( + dataTfeGithubAppInstallationGhaInstallation.id + ), identifier: "GH_NAME/REPO_NAME", }, }); @@ -140,28 +156,34 @@ class MyConvertedCode extends TerraformStack { Create private registry module without VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-private-registry-module", { - moduleProvider: "my_provider", - name: "another_test_module", - organization: testOrganization.name, - registryName: "private", - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule( + this, + "test-private-registry-module", + { + moduleProvider: "my_provider", + name: "another_test_module", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "private", + } + ); } } @@ -170,27 +192,27 @@ class MyConvertedCode extends TerraformStack { Create public registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-public-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), registryName: "public", }); } @@ -201,37 +223,41 @@ class MyConvertedCode extends TerraformStack { Create no-code provisioning registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testNoCodeProvisioningRegistryModule = new RegistryModule( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "test-no-code-provisioning-registry-module", + "test-organization", { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: testOrganization.name, - registryName: "public", + email: "admin@company.com", + name: "my-org-name", } ); - new NoCodeModule(this, "foobar", { - organization: testOrganization.id, - registryModule: testNoCodeProvisioningRegistryModule.id, + const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = + new tfe.registryModule.RegistryModule( + this, + "test-no-code-provisioning-registry-module", + { + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "public", + } + ); + new tfe.noCodeModule.NoCodeModule(this, "foobar", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + registryModule: cdktf.Token.asString( + tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id + ), }); } } @@ -292,4 +318,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_provider.html.markdown b/website/docs/cdktf/typescript/r/registry_provider.html.markdown index f295de485..3094a32f4 100644 --- a/website/docs/cdktf/typescript/r/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_provider.html.markdown @@ -16,26 +16,27 @@ Manages public and private providers in the private registry. Create private provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const example = new Organization(this, "example", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { - name: "my-provider", - organization: example.name, - }); + const tfeOrganizationExample = new tfe.organization.Organization( + this, + "example", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryProviderExample = + new tfe.registryProvider.RegistryProvider(this, "example_1", { + name: "my-provider", + organization: cdktf.Token.asString(tfeOrganizationExample.name), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -46,28 +47,29 @@ class MyConvertedCode extends TerraformStack { Create public provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const example = new Organization(this, "example", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { - name: "aws", - namespace: "hashicorp", - organization: example.name, - registry_name: "public", - }); + const tfeOrganizationExample = new tfe.organization.Organization( + this, + "example", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryProviderExample = + new tfe.registryProvider.RegistryProvider(this, "example_1", { + name: "aws", + namespace: "hashicorp", + organization: cdktf.Token.asString(tfeOrganizationExample.name), + registryName: "public", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -106,4 +108,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 24f65857b..dcfe00943 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,34 +19,41 @@ to up to 20 source workspaces. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testSourceable = new Workspace(this, "test-sourceable", { - name: "my-sourceable-workspace-name", - organization: testOrganization.id, - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.id, - }); - new RunTrigger(this, "test", { - sourceableId: testSourceable.id, - workspaceId: testWorkspace.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( + this, + "test-sourceable", + { + name: "my-sourceable-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.runTrigger.RunTrigger(this, "test", { + sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), }); } } @@ -73,4 +80,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 78e016f2f..430a810e7 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,31 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TfeProvider } from "./.gen/providers/tfe/provider"; -import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new SamlSettings(this, "this", { - idpCert: "foobarCertificate", - sloEndpointUrl: "https://example.com/slo_endpoint_url", - ssoEndpointUrl: "https://example.com/sso_endpoint_url", - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token } +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -60,8 +46,8 @@ The following arguments are supported: * `ssoApiTokenSessionTimeout` - (Optional) Specifies the Single Sign On session timeout in seconds. Defaults to 14 days. * `certificate` - (Optional) The certificate used for request and assertion signing. * `privateKey` - (Optional) The private key used for request and assertion signing. -* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. -* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. +* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. +* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. ## Attributes Reference @@ -78,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 0c1b07cf4..206276ff4 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelPolicy(this, "test", { + new tfe.sentinelPolicy.SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -53,8 +50,8 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults - to `soft-mandatory`. + values are `advisory`, `hardMandatory` and `softMandatory`. Defaults + to `softMandatory`. ## Attributes Reference @@ -69,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown index c11688de7..e1ac09ade 100644 --- a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown @@ -16,18 +16,15 @@ Manage Sentinel versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelVersion } from "./.gen/providers/tfe/sentinel-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelVersion(this, "test", { + new tfe.sentinelVersion.SentinelVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/sentinel.zip", version: "0.24.0-custom", @@ -68,4 +65,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 5005e86a3..90680d24c 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SshKey } from "./.gen/providers/tfe/ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SshKey(this, "test", { + new tfe.sshKey.SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -55,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index 723937553..b793d408b 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -39,18 +36,15 @@ class MyConvertedCode extends TerraformStack { Organization Permission usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -103,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 79dcd1795..8af746faa 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamAccess } from "./.gen/providers/tfe/team-access"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { access: "read", - teamId: test.id, - workspaceId: Token.asString(tfeWorkspaceTest.id), + teamId: cdktf.Token.asString(tfeTeamTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -64,7 +59,7 @@ The `permissions` block supports: * `runs` - (Required) The permission to grant the team on the workspace's runs. Valid values are `read`, `plan`, or `apply`. * `variables` - (Required) The permission to grant the team on the workspace's variables. Valid values are `none`, `read`, or `write`. -* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `read-outputs`, or `write`. +* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `readOutputs`, or `write`. * `sentinelMocks` - (Required) The permission to grant the team on the workspace's generated Sentinel mocks, Valid values are `none` or `read`. * `workspaceLocking` - (Required) Boolean determining whether or not to grant the team permission to manually lock/unlock the workspace. * `runTasks` - (Required) Boolean determining whether or not to grant the team permission to manage workspace run tasks. @@ -85,4 +80,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index d04d60adb..eb7cf719c 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMember } from "./.gen/providers/tfe/team-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new TeamMember(this, "test_1", { - teamId: test.id, + const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -68,4 +64,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 385531b7e..d47aa77bf 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -54,35 +50,23 @@ class MyConvertedCode extends TerraformStack { With a set of usernames: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const allUsernames = Fn.toset(["user1", "user2"]); - const test = new Team(this, "test", { - name: "my-team-name", - organization: "my-org-name", - }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, - usernames: Token.asList( - "${[ for user in ${" + allUsernames + "} : user]}" - ), - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeTeamMembersTest.overrideLogicalId("test"); - } +```hcl +locals { + all_usernames = toset([ + "user1", + "user2", + ]) } +resource "tfe_team" "test" { + name = "my-team-name" + organization = "my-org-name" +} + +resource "tfe_team_members" "test" { + team_id = tfe_team.test.id + usernames = [for user in local.all_usernames : user] +} ``` ## Argument Reference @@ -104,4 +88,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 9c60fbb77..1eec91879 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,37 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_1", { + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( - this, - "test_2", - { - organizationMembershipId: test.id, - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMemberTest = + new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { + organizationMembershipId: cdktf.Token.asString( + tfeOrganizationMembershipTest.id + ), + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -82,4 +77,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 7dda75e25..ba1476eec 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,41 +24,38 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const sample = new OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_2", { + const tfeOrganizationMembershipSample = + new tfe.organizationMembership.OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_3", - { - organizationMembershipIds: [test.id, sample.id], - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { + organizationMembershipIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.id), + cdktf.Token.asString(tfeOrganizationMembershipSample.id), + ], + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -69,48 +66,48 @@ class MyConvertedCode extends TerraformStack { With a set of organization members: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); + const allUsers = cdktf.Fn.toset([ + "user1@hashicorp.com", + "user2@hashicorp.com", + ]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const allMembershipForEachIterator = TerraformIterator.fromList( - Token.asAny(allUsers) + const tfeOrganizationMembershipAllMembershipForEachIterator = + cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); + new tfe.organizationMembership.OrganizationMembership( + this, + "all_membership", + { + email: cdktf.Token.asString( + tfeOrganizationMembershipAllMembershipForEachIterator.key + ), + organization: "my-org-name", + forEach: tfeOrganizationMembershipAllMembershipForEachIterator, + } ); - new OrganizationMembership(this, "all_membership", { - email: Token.asString(allMembershipForEachIterator.key), - organization: "my-org-name", - forEach: allMembershipForEachIterator, - }); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_2", - { - organizationMembershipIds: Token.asList( + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { + organizationMembershipIds: cdktf.Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: test.id, - } - ); + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -134,4 +131,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index f85ec64cc..10eccae74 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,32 +16,28 @@ Associate a team to permissions on a project. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const admin = new Team(this, "admin", { + const tfeTeamAdmin = new tfe.team.Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: test.id, - teamId: admin.id, - }); + const tfeTeamProjectAccessAdmin = + new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamAdmin.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -79,7 +75,7 @@ The following permissions apply to all workspaces (and future workspaces) in the |----------------------|-------------------------------------------------------| | `runs` | The permission to grant project's workspaces' runs. Default: `read`. Valid strings: `read`, `plan`, or `apply`. | | `sentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `none`. Valid strings: `none`, or `read`. | -| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `read-outputs`, `read`, or `write`.| +| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `readOutputs`, `read`, or `write`.| | `variables` | The permission to grant project's workspaces' variables. Default `none`. Valid strings: `none`, `read`, or `write`. | | `create` | The permission to create project's workspaces in the project. Default: `false`. Valid booleans `true`, `false` | | `locking` | The permission to manually lock or unlock the project's workspaces. Default `false`. Valid booleans `true`, `false` | @@ -91,28 +87,23 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const dev = new Team(this, "dev", { + const tfeTeamDev = new tfe.team.Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new TeamProjectAccess(this, "custom", { + new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -120,8 +111,8 @@ class MyConvertedCode extends TerraformStack { teams: "none", }, ], - projectId: test.id, - teamId: dev.id, + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamDev.id), workspaceAccess: [ { create: true, @@ -154,4 +145,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index 702ea826e..f450192af 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new TeamToken(this, "test_1", { - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -59,31 +55,27 @@ never expire. When a token has an expiry: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +import * as time from "./.gen/providers/time"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const example = new Rotating(this, "example", { + const timeRotatingExample = new time.rotating.Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new TeamToken(this, "test_2", { - expiredAt: Token.asString(example.rotationRfc3339), - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { + expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -105,4 +97,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 498537295..f122ae910 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new TerraformVersion(this, "test", { + new tfe.terraformVersion.TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -68,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 329aa0a2d..1d442d61a 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,35 +16,34 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new Variable(this, "test_2", { + const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: Token.asString(tfeWorkspaceTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -56,44 +55,43 @@ class MyConvertedCode extends TerraformStack { Basic usage for variable sets: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -135,42 +133,31 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const sensitiveVar = new Variable(this, "sensitive_var", { - category: "terraform", - key: "sensitive_key", - sensitive: true, - value: "sensitive_value", - workspaceId: workspace.id, - }); - const visibleVar = new Variable(this, "visible_var", { - category: "terraform", - key: "visible_key", - sensitive: false, - value: "visible_value", - workspaceId: workspace.id, - }); - new Workspace(this, "sensitive_workspace", { - name: "workspace-${" + sensitiveVar.value + "}", - organization: "organization name", - }); - new Workspace(this, "visible_workspace", { - name: "workspace-${" + visibleVar.readableValue + "}", - organization: "organization name", - }); - } +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" } ``` @@ -198,4 +185,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index f4e66379a..ceb0d3f23 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,75 +16,68 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "projectname", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_3", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_4", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -94,44 +87,43 @@ class MyConvertedCode extends TerraformStack { Creating a global variable set: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -141,44 +133,43 @@ class MyConvertedCode extends TerraformStack { Create a priority variable set: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", name: "Global Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), priority: true, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -211,4 +202,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 20f9ea001..1190e3e79 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -20,25 +20,25 @@ Provides a workspace resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), tagNames: ["test", "app"], }); } @@ -49,38 +49,37 @@ class MyConvertedCode extends TerraformStack { Usage with vcs_repo: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - new Workspace(this, "parent", { + new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); } @@ -143,7 +142,7 @@ The following arguments are supported: workspace will display their output as text logs. * `sshKeyId` - (Optional) The ID of an SSH key to assign to the workspace. * `tagNames` - (Optional) A list of tag names for this workspace. Note that tags must only contain lowercase letters, numbers, colons, or hyphens. -* `ignore_additional_tag_names` - (Optional) Explicitly ignores `tagNames` +* `ignoreAdditionalTagNames` - (Optional) Explicitly ignores `tagNames` _not_ defined by config so they will not be overwritten by the configured tags. This creates exceptional behavior in terraform with respect to `tagNames` and is not recommended. This value must be applied before it @@ -154,7 +153,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). @@ -173,7 +172,7 @@ The `vcsRepo` block supports: * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. - This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. + This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -197,4 +196,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index eb29e7b08..08afbc792 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -11,48 +11,47 @@ description: |- Adds and removes policy sets from a workspace --> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = + new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -79,4 +78,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index e76d7a91a..2bca759b3 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -11,52 +11,51 @@ description: |- Adds and removes policy sets from an excluded workspace --> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = + new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -83,4 +82,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 388a6fded..f1875dbe2 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -14,90 +14,92 @@ Provides a resource to manage the _initial_ and/or _final_ Terraform run in a gi There are a few main use cases this resource was designed for: - **Workspaces that depend on other workspaces.** If a workspace will create infrastructure that other workspaces rely on (for example, a Kubernetes cluster to deploy resources into), those downstream workspaces can depend on an initial `apply` with `wait_for_run = true`, so they aren't created before their infrastructure dependencies. -- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. -- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfe_workspace` resource's default safe deletion behavior. +- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfeWorkspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfeVariable` resources themselves depend on the `tfeWorkspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfeVariables`, you can accomplish the same goal without a circular dependency. +- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfeWorkspace` resource's default safe deletion behavior. -The `tfe_workspace_run` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfe_workspace_run` resource that includes an `apply` block will queue a new apply when added to a config. +The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfeWorkspaceRun` resource that includes an `apply` block will queue a new apply when added to a config. ## Example Usage Basic usage with multiple workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const child = new Workspace(this, "child", { + const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { name: "child-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, - }, - }); - const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: parent.id, }); - new WorkspaceRun(this, "ws_run_child", { + const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( + this, + "ws_run_parent", + { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, + }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + } + ); + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [wsRunParent], + dependsOn: [tfeWorkspaceRunWsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: child.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), }); } } @@ -107,42 +109,40 @@ class MyConvertedCode extends TerraformStack { With manual confirmation: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -160,42 +160,40 @@ class MyConvertedCode extends TerraformStack { With no retries: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -205,7 +203,7 @@ class MyConvertedCode extends TerraformStack { retry: false, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -225,16 +223,16 @@ Both `apply` and `destroy` block supports: * `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. - * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfe_workspace` data source. + * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfeWorkspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. * `retryAttempts` - (Optional) The number to retry attempts made after an initial error. Defaults to `3`. * `retryBackoffMin` - (Optional) The minimum time in seconds to backoff before attempting a retry. Defaults to `1`. * `retryBackoffMax` - (Optional) The maximum time in seconds to backoff before attempting a retry. Defaults to `30`. -* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfe_workspace_run` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. +* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfeWorkspaceRun` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index b45d66f2a..2af33a4b9 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,26 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new WorkspaceRunTask(this, "example", { - enforcementLevel: "advisory", - taskId: tfeOrganizationRunTask.example.id, - workspaceId: tfeWorkspace.example.id, - }); - } +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" } - ``` ## Argument Reference @@ -46,7 +32,7 @@ The following arguments are supported: * `enforcementLevel` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`. * `taskId` - (Required) The id of the Run task to associate to the Workspace. * `workspaceId` - (Required) The id of the workspace to associate the Run task to. -* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`. +* `stage` - (Optional) The stage to run the task in. Valid values are `prePlan`, `postPlan`, and `preApply`. ## Attributes Reference @@ -61,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index 26cba38c8..04f080251 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -16,30 +16,29 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); - new WorkspaceSettings(this, "test-settings", { + new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { executionMode: "local", - workspaceId: test.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); } } @@ -49,49 +48,53 @@ class MyConvertedCode extends TerraformStack { With `executionMode` of `agent`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); - const tfeAgentPoolAllowedWorkspacesTest = new AgentPoolAllowedWorkspaces( + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( this, - "test_3", + "test-agent-pool", { - agentPoolId: testAgentPool.id, - allowedWorkspaceIds: [test.id], + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), } ); + const tfeAgentPoolAllowedWorkspacesTest = + new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( + this, + "test_3", + { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: [cdktf.Token.asString(tfeWorkspaceTest.id)], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); - new WorkspaceSettings(this, "test-settings", { - agentPoolId: Token.asString( + new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { + agentPoolId: cdktf.Token.asString( tfeAgentPoolAllowedWorkspacesTest.agentPoolId ), executionMode: "agent", - workspaceId: test.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); } } @@ -101,32 +104,33 @@ class MyConvertedCode extends TerraformStack { This resource may be used as a data source when no optional arguments are defined: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformOutput, Op, Fn, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const tfeWorkspaceSettingsTest = new WorkspaceSettings(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const tfeWorkspaceSettingsTest = + new tfe.workspaceSettings.WorkspaceSettings(this, "test_1", { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceSettingsTest.overrideLogicalId("test"); - new TerraformOutput(this, "workspace-explicit-local-execution", { - value: Fn.alltrue( - Token.asAny([ - Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), - Fn.lookupNested(tfeWorkspaceSettingsTest.overwrites, [ + new cdktf.TerraformOutput(this, "workspace-explicit-local-execution", { + value: cdktf.Fn.alltrue( + cdktf.Token.asAny([ + cdktf.Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), + cdktf.propertyAccess(tfeWorkspaceSettingsTest.overwrites, [ "0", '"execution_mode"', ]), @@ -155,7 +159,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - `executionMode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + - `agentPool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -170,4 +174,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 89747f9cf..946d0f324 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -11,52 +11,47 @@ description: |- Adds and removes variable sets from a workspace --> **Note:** `tfe_variable_set` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. +-> **Note:** `tfeVariableSet` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_3", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -83,4 +78,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 364f05a731f9f97ef21534fa978d91c3fbcc182c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:04:26 -0500 Subject: [PATCH 297/420] Build(deps): Bump peter-evans/create-pull-request from 6.0.0 to 6.0.2 (#1288) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.0 to 6.0.2. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/b1ddad2c994a25fbc81a28b3ec0e368bb2021c50...70a41aba780001da0a30141984ae2a0c95d8704e) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b157f3349..3f152ea2b 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -102,7 +102,7 @@ jobs: TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins - name: Create Pull Request - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 + uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2 with: commit-message: "cdktf: update documentation" title: "release: ${{ github.event.inputs.version }}" From c449b2b20375e1b5ec8609a229cd84a4fecee6ea Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 18 Mar 2024 14:43:23 +0800 Subject: [PATCH 298/420] Enable Acceptance Testing of Compliance features Previously the wrong environment variable name was being used which was skipping the Run Tasks tests. This commit uses the correct variable name. Previously many Policy Set related tests were marked as Beta. This commit removes this restriction as these features are now GA. --- .github/actions/test-provider-tfe/action.yml | 2 +- internal/provider/data_source_policy_set_test.go | 2 -- internal/provider/resource_tfe_project_policy_set_test.go | 2 -- .../resource_tfe_workspace_policy_set_exclusion_test.go | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 9a10d5cac..65aaf2f18 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -102,7 +102,7 @@ runs: TFE_USER2: tfe-provider-user2 TF_ACC: "1" ENABLE_TFE: "${{ inputs.enterprise }}" - TFC_RUN_TASK_URL: "https://httpstat.us/200" + RUN_TASKS_URL: "https://httpstat.us/200" GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" diff --git a/internal/provider/data_source_policy_set_test.go b/internal/provider/data_source_policy_set_test.go index ab2691008..0be33986a 100644 --- a/internal/provider/data_source_policy_set_test.go +++ b/internal/provider/data_source_policy_set_test.go @@ -14,7 +14,6 @@ import ( ) func TestAccTFEPolicySetDataSource_basic(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) @@ -113,7 +112,6 @@ func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { } func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) { - skipUnlessBeta(t) tfeClient, err := getClientUsingEnv() if err != nil { t.Fatal(err) diff --git a/internal/provider/resource_tfe_project_policy_set_test.go b/internal/provider/resource_tfe_project_policy_set_test.go index 0648efbc5..88fea72fb 100644 --- a/internal/provider/resource_tfe_project_policy_set_test.go +++ b/internal/provider/resource_tfe_project_policy_set_test.go @@ -16,7 +16,6 @@ import ( ) func TestAccTFEProjectPolicySet_basic(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -58,7 +57,6 @@ func TestAccTFEProjectPolicySet_basic(t *testing.T) { } func TestAccTFEProjectPolicySet_incorrectImportSyntax(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() diff --git a/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go b/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go index 4a1691b97..143bcb125 100644 --- a/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go +++ b/internal/provider/resource_tfe_workspace_policy_set_exclusion_test.go @@ -15,7 +15,6 @@ import ( ) func TestAccTFEWorkspacePolicySetExclusion_basic(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -49,7 +48,6 @@ func TestAccTFEWorkspacePolicySetExclusion_basic(t *testing.T) { } func TestAccTFEWorkspacePolicySetExclusion_incorrectImportSyntax(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() From 1a7eb96a271bab0efbdf5407f64591d081fb1e48 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 12 Mar 2024 13:20:37 +0800 Subject: [PATCH 299/420] Refactor testing helpers Previously some of the test only helpers did not have the _test.go name which implies it's only used in the acceptance tests. This commit renames those files. This commit also extracts the subscription update process and updated it as it fails in the local development. Specifically, there may be 2 or more tokens used to administer a TFC instance which have different admin scopes. This commit now encapsulates that logic inside a SubscriptionUpdater "service" class which can be used to build up the request to update a subscription. This service will be used in later commits where we need to test different tiers an organization is in. This is typically only a TFC concern, not TFE. --- internal/provider/admin_helpers_test.go | 59 +++++++++ ...aces.go => client_mock_workspaces_test.go} | 0 .../provider/{testing.go => helper_test.go} | 74 +---------- .../provider/subscription_updater_test.go | 117 ++++++++++++++++++ 4 files changed, 181 insertions(+), 69 deletions(-) create mode 100644 internal/provider/admin_helpers_test.go rename internal/provider/{client_mock_workspaces.go => client_mock_workspaces_test.go} (100%) rename internal/provider/{testing.go => helper_test.go} (79%) create mode 100644 internal/provider/subscription_updater_test.go diff --git a/internal/provider/admin_helpers_test.go b/internal/provider/admin_helpers_test.go new file mode 100644 index 000000000..7bb9b3b86 --- /dev/null +++ b/internal/provider/admin_helpers_test.go @@ -0,0 +1,59 @@ +package provider + +import ( + "os" + "testing" + + tfe "github.com/hashicorp/go-tfe" +) + +type adminRoleType string + +const ( + siteAdmin adminRoleType = "site-admin" + configurationAdmin adminRoleType = "configuration" + provisionLicensesAdmin adminRoleType = "provision-licenses" + subscriptionAdmin adminRoleType = "subscription" + supportAdmin adminRoleType = "support" + securityMaintenanceAdmin adminRoleType = "security-maintenance" + versionMaintenanceAdmin adminRoleType = "version-maintenance" +) + +func getTokenForAdminRole(adminRole adminRoleType) string { + token := "" + + switch adminRole { + case siteAdmin: + token = os.Getenv("TFE_ADMIN_SITE_ADMIN_TOKEN") + case configurationAdmin: + token = os.Getenv("TFE_ADMIN_CONFIGURATION_TOKEN") + case provisionLicensesAdmin: + token = os.Getenv("TFE_ADMIN_PROVISION_LICENSES_TOKEN") + case subscriptionAdmin: + token = os.Getenv("TFE_ADMIN_SUBSCRIPTION_TOKEN") + case supportAdmin: + token = os.Getenv("TFE_ADMIN_SUPPORT_TOKEN") + case securityMaintenanceAdmin: + token = os.Getenv("TFE_ADMIN_SECURITY_MAINTENANCE_TOKEN") + case versionMaintenanceAdmin: + token = os.Getenv("TFE_ADMIN_VERSION_MAINTENANCE_TOKEN") + } + + return token +} + +func testAdminClient(t *testing.T, adminRole adminRoleType) *tfe.Client { + token := getTokenForAdminRole(adminRole) + if token == "" { + t.Fatal("missing API token for admin role " + adminRole) + } + + client, err := tfe.NewClient(&tfe.Config{ + Token: token, + }) + if err != nil { + t.Fatal(err) + } + + return client +} diff --git a/internal/provider/client_mock_workspaces.go b/internal/provider/client_mock_workspaces_test.go similarity index 100% rename from internal/provider/client_mock_workspaces.go rename to internal/provider/client_mock_workspaces_test.go diff --git a/internal/provider/testing.go b/internal/provider/helper_test.go similarity index 79% rename from internal/provider/testing.go rename to internal/provider/helper_test.go index 8c428510f..a9c3d3cef 100644 --- a/internal/provider/testing.go +++ b/internal/provider/helper_test.go @@ -6,7 +6,6 @@ package provider import ( "context" "fmt" - "net/url" "os" "testing" "time" @@ -25,29 +24,6 @@ type testClientOptions struct { remoteStateConsumersResponse string } -type featureSet struct { - ID string `jsonapi:"primary,feature-sets"` -} - -type featureSetList struct { - Items []*featureSet - *tfe.Pagination -} - -type featureSetListOptions struct { - Q string `url:"q,omitempty"` -} - -type updateFeatureSetOptions struct { - Type string `jsonapi:"primary,subscription"` - RunsCeiling int `jsonapi:"attr,runs-ceiling"` - ContractStartAt time.Time `jsonapi:"attr,contract-start-at,iso8601"` - ContractUserLimit int `jsonapi:"attr,contract-user-limit"` - ContractApplyLimit int `jsonapi:"attr,contract-apply-limit"` - - FeatureSet *featureSet `jsonapi:"relation,feature-set"` -} - // testTfeClient creates a mock client that creates workspaces with their ID // set to workspaceID. func testTfeClient(t *testing.T, options testClientOptions) *tfe.Client { @@ -72,50 +48,10 @@ func testTfeClient(t *testing.T, options testClientOptions) *tfe.Client { return client } -func upgradeOrganizationSubscription(t *testing.T, client *tfe.Client, org *tfe.Organization) { - if enterpriseEnabled() { - t.Skip("Cannot upgrade an organization's subscription when enterprise is enabled. Set ENABLE_TFE=0 to run.") - } - - req, err := client.NewRequest("GET", "admin/feature-sets", featureSetListOptions{ - Q: "Business", - }) - if err != nil { - t.Fatal(err) - return - } - - fsl := &featureSetList{} - err = req.Do(context.Background(), fsl) - if err != nil { - t.Fatalf("failed to enumerate feature sets: %v", err) - return - } else if len(fsl.Items) == 0 { - // this will serve as our catch all if enterprise is not enabled - // but the instance itself is enterprise - t.Fatalf("feature set response was empty") - return - } - - opts := updateFeatureSetOptions{ - RunsCeiling: 10, - ContractStartAt: time.Now(), - ContractUserLimit: 1000, - ContractApplyLimit: 5000, - FeatureSet: fsl.Items[0], - } - - u := fmt.Sprintf("admin/organizations/%s/subscription", url.QueryEscape(org.Name)) - req, err = client.NewRequest("POST", u, &opts) - if err != nil { - t.Fatalf("Failed to create request: %v", err) - return - } - - err = req.Do(context.Background(), nil) - if err != nil { - t.Fatalf("Failed to upgrade subscription: %v", err) - } +// Attempts to upgrade an organization to the business plan. Requires a user token with admin access. +// DEPRECATED : Please use the newSubscriptionUpdater instead. +func upgradeOrganizationSubscription(t *testing.T, _ *tfe.Client, organization *tfe.Organization) { + newSubscriptionUpdater(organization).WithBusinessPlan().Update(t) } func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organization, func()) { @@ -124,7 +60,7 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), }) - upgradeOrganizationSubscription(t, client, org) + newSubscriptionUpdater(org).WithBusinessPlan().Update(t) return org, orgCleanup } diff --git a/internal/provider/subscription_updater_test.go b/internal/provider/subscription_updater_test.go new file mode 100644 index 000000000..50813447e --- /dev/null +++ b/internal/provider/subscription_updater_test.go @@ -0,0 +1,117 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + "net/url" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" +) + +type featureSet struct { + ID string `jsonapi:"primary,feature-sets"` +} + +type featureSetList struct { + Items []*featureSet + *tfe.Pagination +} + +type featureSetListOptions struct { + Q string `url:"q,omitempty"` +} + +type updateFeatureSetOptions struct { + Type string `jsonapi:"primary,subscription"` + RunsCeiling *int `jsonapi:"attr,runs-ceiling,omitempty"` + ContractStartAt *time.Time `jsonapi:"attr,contract-start-at,iso8601,omitempty"` + ContractUserLimit *int `jsonapi:"attr,contract-user-limit,omitempty"` + ContractApplyLimit *int `jsonapi:"attr,contract-apply-limit,omitempty"` + + FeatureSet *featureSet `jsonapi:"relation,feature-set"` +} + +type organizationSubscriptionUpdater struct { + organization *tfe.Organization + planName string + updateOpts updateFeatureSetOptions +} + +func newSubscriptionUpdater(organization *tfe.Organization) *organizationSubscriptionUpdater { + return &organizationSubscriptionUpdater{ + organization: organization, + updateOpts: updateFeatureSetOptions{}, + } +} + +func (b *organizationSubscriptionUpdater) WithBusinessPlan() *organizationSubscriptionUpdater { + b.planName = "Business" + + ceiling := 10 + start := time.Now() + userLimit := 1000 + applyLimit := 5000 + + b.updateOpts.RunsCeiling = &ceiling + b.updateOpts.ContractStartAt = &start + b.updateOpts.ContractUserLimit = &userLimit + b.updateOpts.ContractApplyLimit = &applyLimit + return b +} + +func (b *organizationSubscriptionUpdater) WithTrialPlan() *organizationSubscriptionUpdater { + b.planName = "Trial" + ceiling := 1 + b.updateOpts.RunsCeiling = &ceiling + return b +} + +// Attempts to change an organization's subscription to a different plan. Requires a user token with admin access. +func (b *organizationSubscriptionUpdater) Update(t *testing.T) { + if enterpriseEnabled() { + t.Skip("Cannot upgrade an organization's subscription when enterprise is enabled. Set ENABLE_TFE=0 to run.") + } + + if b.planName == "" { + t.Fatal("organizationSubscriptionUpdater requires a plan") + return + } + + adminClient := testAdminClient(t, provisionLicensesAdmin) + req, err := adminClient.NewRequest("GET", "admin/feature-sets", featureSetListOptions{ + Q: b.planName, + }) + if err != nil { + t.Fatal(err) + return + } + + fsl := &featureSetList{} + err = req.Do(context.Background(), fsl) + if err != nil { + t.Fatalf("failed to enumerate feature sets: %v", err) + return + } else if len(fsl.Items) == 0 { + t.Fatalf("feature set response was empty") + return + } + + b.updateOpts.FeatureSet = fsl.Items[0] + + u := fmt.Sprintf("admin/organizations/%s/subscription", url.QueryEscape(b.organization.Name)) + req, err = adminClient.NewRequest("POST", u, &b.updateOpts) + if err != nil { + t.Fatalf("Failed to create request: %v", err) + return + } + + err = req.Do(context.Background(), nil) + if err != nil { + t.Fatalf("Failed to upgrade subscription: %v", err) + } +} From 92f78b28f859bc1a3a2a3de837346892672dfc1d Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 18 Mar 2024 15:17:41 +0800 Subject: [PATCH 300/420] Promote beta test for TestAccTFEWorkspaceRunTask_create The beta test for TestAccTFEWorkspaceRunTask_create is generally available. This commit promotes the beta test to the general test. --- .../resource_tfe_workspace_run_task_test.go | 90 +------------------ 1 file changed, 2 insertions(+), 88 deletions(-) diff --git a/internal/provider/resource_tfe_workspace_run_task_test.go b/internal/provider/resource_tfe_workspace_run_task_test.go index f65ad1f09..d267c0050 100644 --- a/internal/provider/resource_tfe_workspace_run_task_test.go +++ b/internal/provider/resource_tfe_workspace_run_task_test.go @@ -32,42 +32,6 @@ func TestAccTFEWorkspaceRunTask_create(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccTFEWorkspaceRunTask_basic(org.Name, runTasksURL()), - Check: resource.ComposeTestCheckFunc( - testAccCheckTFEWorkspaceRunTaskExists("tfe_workspace_run_task.foobar", workspaceTask), - resource.TestCheckResourceAttr("tfe_workspace_run_task.foobar", "enforcement_level", "advisory"), - ), - }, - { - Config: testAccTFEWorkspaceRunTask_update(org.Name, runTasksURL()), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("tfe_workspace_run_task.foobar", "enforcement_level", "mandatory"), - ), - }, - }, - }) -} - -func TestAccTFEWorkspaceRunTask_beta_create(t *testing.T) { - skipUnlessRunTasksDefined(t) - skipUnlessBeta(t) - - tfeClient, err := getClientUsingEnv() - if err != nil { - t.Fatal(err) - } - - org, orgCleanup := createBusinessOrganization(t, tfeClient) - t.Cleanup(orgCleanup) - - workspaceTask := &tfe.WorkspaceRunTask{} - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEWorkspaceRunTaskDestroy, - Steps: []resource.TestStep{ - { - Config: testAccTFEWorkspaceRunTask_beta_basic(org.Name, runTasksURL()), Check: resource.ComposeTestCheckFunc( testAccCheckTFEWorkspaceRunTaskExists("tfe_workspace_run_task.foobar", workspaceTask), resource.TestCheckResourceAttr("tfe_workspace_run_task.foobar", "enforcement_level", "advisory"), @@ -75,7 +39,7 @@ func TestAccTFEWorkspaceRunTask_beta_create(t *testing.T) { ), }, { - Config: testAccTFEWorkspaceRunTask_beta_update(org.Name, runTasksURL()), + Config: testAccTFEWorkspaceRunTask_update(org.Name, runTasksURL()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("tfe_workspace_run_task.foobar", "enforcement_level", "mandatory"), resource.TestCheckResourceAttr("tfe_workspace_run_task.foobar", "stage", "pre_plan"), @@ -186,56 +150,6 @@ resource "tfe_workspace" "foobar" { organization = local.organization_name } -resource "tfe_workspace_run_task" "foobar" { - workspace_id = resource.tfe_workspace.foobar.id - task_id = resource.tfe_organization_run_task.foobar.id - enforcement_level = "advisory" -} -`, orgName, runTaskURL) -} - -func testAccTFEWorkspaceRunTask_update(orgName, runTaskURL string) string { - return fmt.Sprintf(` -locals { - organization_name = "%s" -} - -resource "tfe_organization_run_task" "foobar" { - organization = local.organization_name - url = "%s" - name = "foobar-task" -} - -resource "tfe_workspace" "foobar" { - name = "workspace-test" - organization = local.organization_name -} - -resource "tfe_workspace_run_task" "foobar" { - workspace_id = resource.tfe_workspace.foobar.id - task_id = resource.tfe_organization_run_task.foobar.id - enforcement_level = "mandatory" -} -`, orgName, runTaskURL) -} - -func testAccTFEWorkspaceRunTask_beta_basic(orgName, runTaskURL string) string { - return fmt.Sprintf(` -locals { - organization_name = "%s" -} - -resource "tfe_organization_run_task" "foobar" { - organization = local.organization_name - url = "%s" - name = "foobar-task" -} - -resource "tfe_workspace" "foobar" { - name = "workspace-test" - organization = tfe_organization.foobar.id -} - resource "tfe_workspace_run_task" "foobar" { workspace_id = resource.tfe_workspace.foobar.id task_id = resource.tfe_organization_run_task.foobar.id @@ -245,7 +159,7 @@ resource "tfe_workspace_run_task" "foobar" { `, orgName, runTaskURL) } -func testAccTFEWorkspaceRunTask_beta_update(orgName, runTaskURL string) string { +func testAccTFEWorkspaceRunTask_update(orgName, runTaskURL string) string { return fmt.Sprintf(` locals { organization_name = "%s" From a62738d4533745054a21fa7625b177995e88c1c8 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 18 Mar 2024 16:27:11 +0800 Subject: [PATCH 301/420] Use known good policy set tool versions The acceptance instance doesn't allow creating tool versions, so instead for the Datasource testing we use known good versions. --- .../provider/data_source_policy_set_test.go | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/internal/provider/data_source_policy_set_test.go b/internal/provider/data_source_policy_set_test.go index 0be33986a..d94732c03 100644 --- a/internal/provider/data_source_policy_set_test.go +++ b/internal/provider/data_source_policy_set_test.go @@ -13,6 +13,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +// Known Tool Versions that will exist in the TFE/TFC instance that's +// being used for acceptance testing. Once the /api/v2/tool-versions endpoint +// is available in go-tfe, we can retrieve this dynamically. +const KnownOPAToolVersion = "0.44.0" +const KnownSentinelToolVersion = "0.22.1" + func TestAccTFEPolicySetDataSource_basic(t *testing.T) { tfeClient, err := getClientUsingEnv() if err != nil { @@ -65,9 +71,6 @@ func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { t.Fatal(err) } - sha := genSentinelSha(t, "secret", "data") - version := genSafeRandomSentinelVersion() - org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) @@ -79,7 +82,7 @@ func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(org.Name, rInt, version, sha), + Config: testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(org.Name, rInt, KnownSentinelToolVersion), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("data.tfe_policy_set.bar", "id"), resource.TestCheckResourceAttr( @@ -95,7 +98,7 @@ func TestAccTFEPolicySetDataSource_pinnedPolicyRuntimeVersion(t *testing.T) { resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "agent_enabled", "true"), resource.TestCheckResourceAttr( - "data.tfe_policy_set.bar", "policy_tool_version", version), + "data.tfe_policy_set.bar", "policy_tool_version", KnownSentinelToolVersion), resource.TestCheckResourceAttr( "data.tfe_policy_set.bar", "workspace_ids.#", "1"), resource.TestCheckResourceAttr( @@ -117,9 +120,6 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) { t.Fatal(err) } - sha := genSentinelSha(t, "secret", "data") - version := genSafeRandomOPAVersion() - org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) @@ -131,7 +131,7 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySetDataSourceConfigOPA_basic(org.Name, rInt, version, sha), + Config: testAccTFEPolicySetDataSourceConfigOPA_basic(org.Name, rInt, KnownOPAToolVersion), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("data.tfe_policy_set.bar", "id"), resource.TestCheckResourceAttr( @@ -289,19 +289,12 @@ data "tfe_policy_set" "bar" { }`, organization, rInt, rInt, rInt) } -func testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(organization string, rInt int, version string, sha string) string { +func testAccTFEPolicySetDataSourceConfig_pinnedPolicyRuntimeVersion(organization string, rInt int, version string) string { return fmt.Sprintf(` locals { organization_name = "%s" } - -resource "tfe_sentinel_version" "foobar" { - version = "%s" - url = "https://www.hashicorp.com" - sha = "%s" -} - resource "tfe_workspace" "foobar" { name = "workspace-foo-%d" organization = local.organization_name @@ -342,22 +335,15 @@ data "tfe_policy_set" "bar" { name = tfe_policy_set.foobar.name organization = local.organization_name depends_on=[tfe_policy_set.foobar, tfe_project_policy_set.foobar, tfe_workspace_policy_set_exclusion.foobar] -}`, organization, version, sha, rInt, rInt, rInt, version) +}`, organization, rInt, rInt, rInt, version) } -func testAccTFEPolicySetDataSourceConfigOPA_basic(organization string, rInt int, version string, sha string) string { +func testAccTFEPolicySetDataSourceConfigOPA_basic(organization string, rInt int, version string) string { return fmt.Sprintf(` locals { organization_name = "%s" } - -resource "tfe_opa_version" "foobar" { - version = "%s" - url = "https://www.hashicorp.com" - sha = "%s" -} - resource "tfe_workspace" "foobar" { name = "workspace-foo-%d" organization = local.organization_name @@ -394,7 +380,7 @@ data "tfe_policy_set" "bar" { organization = local.organization_name kind = "opa" depends_on=[tfe_policy_set.foobar, tfe_project_policy_set.foobar, tfe_workspace_policy_set_exclusion.foobar] -}`, organization, version, sha, rInt, rInt, rInt, version) +}`, organization, rInt, rInt, rInt, version) } func testAccTFEPolicySetDataSourceConfig_vcs(organization string, rInt int) string { From ae8b2f10e9b4b668c3acf10857385a274efccb65 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 19 Mar 2024 09:29:24 +0800 Subject: [PATCH 302/420] Use correct Run Tasks URL in CI tests --- .github/actions/test-provider-tfe/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 65aaf2f18..b6b48a3c4 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -102,7 +102,7 @@ runs: TFE_USER2: tfe-provider-user2 TF_ACC: "1" ENABLE_TFE: "${{ inputs.enterprise }}" - RUN_TASKS_URL: "https://httpstat.us/200" + RUN_TASKS_URL: "http://testing-mocks.tfe:22180/runtasks/pass" GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" From 84c16221a0091a4293b16e987761efc1dd259e18 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 19 Mar 2024 11:07:17 +0800 Subject: [PATCH 303/420] Refactor Run Task tests for HMAC Key Previously the acceptance tests assumed that the Run Task service test fixture would allow any old HMAC Key. However this is not the case in the CI environment. Instead we now allow the acceptance test suite to specifiy the HMAC Key, and use manual tests for testing how to change this write-only sensitive value. --- docs/testing.md | 5 +-- .../data_source_organization_run_task_test.go | 8 ++--- internal/provider/helper_test.go | 5 +++ ...resource_tfe_organization_run_task_test.go | 32 +++++++++++-------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index c61a56bda..3b977d5cf 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -45,8 +45,9 @@ these values with the environment variables specified below: 8. `GITHUB_WORKSPACE_BRANCH`: A GitHub branch for the repository specified by `GITHUB_WORKSPACE_IDENTIFIER`. Required for running workspace tests. 9. `ENABLE_TFE` - Some tests cover features available only in Terraform Cloud. To skip these tests when running against a Terraform Enterprise instance, set `ENABLE_TFE=1`. 10. `RUN_TASKS_URL` - External URL to use for testing Run Tasks operations, for example `RUN_TASKS_URL=http://somewhere.local:8080/pass`. Required for running run tasks tests. -11. `GITHUB_APP_INSTALLATION_ID` - GitHub App installation internal id in the format `ghain-xxxxxxx`. Required for running any tests that use GitHub App VCS (workspace, policy sets, registry module). -12. `GITHUB_APP_INSTALLATION_NAME` - GitHub App installation name. Required for running tfe_github_app_installation data source test. +11. `RUN_TASKS_HMAC` - The optional HMAC Key that should be used for Run Task operations. The default is no key. +12. `GITHUB_APP_INSTALLATION_ID` - GitHub App installation internal id in the format `ghain-xxxxxxx`. Required for running any tests that use GitHub App VCS (workspace, policy sets, registry module). +13. `GITHUB_APP_INSTALLATION_NAME` - GitHub App installation name. Required for running tfe_github_app_installation data source test. **Note:** In order to run integration tests for **Paid** features you will need a token `TFE_TOKEN` with TFC/E administrator privileges, otherwise the attempt to upgrade an organization's feature set will fail. diff --git a/internal/provider/data_source_organization_run_task_test.go b/internal/provider/data_source_organization_run_task_test.go index 7159fcf38..cd2bcea15 100644 --- a/internal/provider/data_source_organization_run_task_test.go +++ b/internal/provider/data_source_organization_run_task_test.go @@ -30,7 +30,7 @@ func TestAccTFEOrganizationRunTaskDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationRunTaskDataSourceConfig(org.Name, rInt, runTasksURL()), + Config: testAccTFEOrganizationRunTaskDataSourceConfig(org.Name, rInt, runTasksURL(), runTasksHMACKey()), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("data.tfe_organization_run_task.foobar", "name", fmt.Sprintf("foobar-task-%d", rInt)), resource.TestCheckResourceAttr("data.tfe_organization_run_task.foobar", "url", runTasksURL()), @@ -45,7 +45,7 @@ func TestAccTFEOrganizationRunTaskDataSource_basic(t *testing.T) { }) } -func testAccTFEOrganizationRunTaskDataSourceConfig(orgName string, rInt int, runTaskURL string) string { +func testAccTFEOrganizationRunTaskDataSourceConfig(orgName string, rInt int, runTaskURL, runTaskHMACKey string) string { return fmt.Sprintf(` locals { organization_name = "%s" @@ -55,7 +55,7 @@ resource "tfe_organization_run_task" "foobar" { organization = local.organization_name url = "%s" name = "foobar-task-%d" - hmac_key = "Password1" + hmac_key = "%s" enabled = false description = "a description" } @@ -64,5 +64,5 @@ data "tfe_organization_run_task" "foobar" { organization = local.organization_name name = "foobar-task-%d" depends_on = [tfe_organization_run_task.foobar] -}`, orgName, runTaskURL, rInt, rInt) +}`, orgName, runTaskURL, rInt, runTaskHMACKey, rInt) } diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index a9c3d3cef..7d3bcc395 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -17,6 +17,7 @@ import ( ) const RunTasksURLEnvName = "RUN_TASKS_URL" +const RunTasksHMACKeyEnvName = "RUN_TASKS_HMAC" type testClientOptions struct { defaultOrganization string @@ -211,6 +212,10 @@ func runTasksURL() string { return os.Getenv(RunTasksURLEnvName) } +func runTasksHMACKey() string { + return os.Getenv(RunTasksHMACKeyEnvName) +} + // Checks to see if ENABLE_BETA is set to 1, thereby enabling tests for beta features. func betaFeaturesEnabled() bool { return os.Getenv("ENABLE_BETA") == "1" diff --git a/internal/provider/resource_tfe_organization_run_task_test.go b/internal/provider/resource_tfe_organization_run_task_test.go index 27ea14ed0..2995b93b6 100644 --- a/internal/provider/resource_tfe_organization_run_task_test.go +++ b/internal/provider/resource_tfe_organization_run_task_test.go @@ -21,15 +21,15 @@ func TestAccTFEOrganizationRunTask_validateSchemaAttributeUrl(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationRunTask_basic("org", 1, ""), + Config: testAccTFEOrganizationRunTask_basic("org", 1, "", ""), ExpectError: regexp.MustCompile(`url to not be empty`), }, { - Config: testAccTFEOrganizationRunTask_basic("org", 1, "https://"), + Config: testAccTFEOrganizationRunTask_basic("org", 1, "https://", ""), ExpectError: regexp.MustCompile(`to have a host`), }, { - Config: testAccTFEOrganizationRunTask_basic("org", 1, "ftp://a.valid.url/path"), + Config: testAccTFEOrganizationRunTask_basic("org", 1, "ftp://a.valid.url/path", ""), ExpectError: regexp.MustCompile(`to have a url with schema of: "http,https"`), }, }, @@ -50,30 +50,35 @@ func TestAccTFEOrganizationRunTask_create(t *testing.T) { runTask := &tfe.RunTask{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + // Note - We cannot easily test updating the HMAC Key as that would require coordination between this test suite + // and the external Run Task service to "magically" allow a different Key. Instead we "update" with the same key + // and manually test HMAC Key changes. + hmacKey := runTasksHMACKey() + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckTFEOrganizationRunTaskDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL()), + Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL(), hmacKey), Check: resource.ComposeTestCheckFunc( testAccCheckTFEOrganizationRunTaskExists("tfe_organization_run_task.foobar", runTask), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "name", fmt.Sprintf("foobar-task-%d", rInt)), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "url", runTasksURL()), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "category", "task"), - resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "hmac_key", ""), + resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "hmac_key", hmacKey), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "enabled", "false"), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "description", ""), ), }, { - Config: testAccTFEOrganizationRunTask_update(org.Name, rInt, runTasksURL()), + Config: testAccTFEOrganizationRunTask_update(org.Name, rInt, runTasksURL(), hmacKey), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "name", fmt.Sprintf("foobar-task-%d-new", rInt)), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "url", runTasksURL()), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "category", "task"), - resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "hmac_key", "somepassword"), + resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "hmac_key", hmacKey), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "enabled", "true"), resource.TestCheckResourceAttr("tfe_organization_run_task.foobar", "description", "a description"), ), @@ -101,7 +106,7 @@ func TestAccTFEOrganizationRunTask_import(t *testing.T) { CheckDestroy: testAccCheckTFETeamAccessDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL()), + Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL(), runTasksHMACKey()), }, { ResourceName: "tfe_organization_run_task.foobar", @@ -161,26 +166,27 @@ func testAccCheckTFEOrganizationRunTaskDestroy(s *terraform.State) error { return nil } -func testAccTFEOrganizationRunTask_basic(orgName string, rInt int, runTaskURL string) string { +func testAccTFEOrganizationRunTask_basic(orgName string, rInt int, runTaskURL, runTaskHMACKey string) string { return fmt.Sprintf(` resource "tfe_organization_run_task" "foobar" { organization = "%s" url = "%s" name = "foobar-task-%d" enabled = false + hmac_key = "%s" } -`, orgName, runTaskURL, rInt) +`, orgName, runTaskURL, rInt, runTaskHMACKey) } -func testAccTFEOrganizationRunTask_update(orgName string, rInt int, runTaskURL string) string { +func testAccTFEOrganizationRunTask_update(orgName string, rInt int, runTaskURL, runTaskHMACKey string) string { return fmt.Sprintf(` resource "tfe_organization_run_task" "foobar" { organization = "%s" url = "%s" name = "foobar-task-%d-new" enabled = true - hmac_key = "somepassword" + hmac_key = "%s" description = "a description" } -`, orgName, runTaskURL, rInt) +`, orgName, runTaskURL, rInt, runTaskHMACKey) } From 61586dd8de7c1b7021317395de588dd0ea23d962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:01:58 -0400 Subject: [PATCH 304/420] Build(deps): Bump actions/cache from 4.0.1 to 4.0.2 (#1292) Bumps [actions/cache](https://github.com/actions/cache) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/ab5e6d0c87105b4c9c2047343972218f562e4319...0c45773b623bea8c8e75f6c82b208c3cf94ea4f9) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 3f152ea2b..0b4fa8a12 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -74,7 +74,7 @@ jobs: - name: Get yarn cache directory path id: global-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 id: global-cache with: path: ${{ steps.global-cache-dir-path.outputs.dir }} From 8e76bcd80e8297dd2ecdd0ee6c2f0cd4cba442e9 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 12 Mar 2024 15:31:37 +0800 Subject: [PATCH 305/420] Migrate tfe_organization_run_task to plugin model This commit migrates the tfe_organization_run_task resource to the newer plugin model. It uses a schema v0 as there is no difference in schema. Later changes will migrate the other resource and data source objects. --- internal/provider/provider.go | 1 - internal/provider/provider_next.go | 1 + .../resource_tfe_organization_run_task.go | 361 +++++++++++------- ...resource_tfe_organization_run_task_test.go | 16 +- internal/provider/validators/is_url_https.go | 43 +++ 5 files changed, 276 insertions(+), 146 deletions(-) create mode 100644 internal/provider/validators/is_url_https.go diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f9cd41ff8..550d1c7c1 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -120,7 +120,6 @@ func Provider() *schema.Provider { "tfe_organization_default_settings": resourceTFEOrganizationDefaultSettings(), "tfe_organization_membership": resourceTFEOrganizationMembership(), "tfe_organization_module_sharing": resourceTFEOrganizationModuleSharing(), - "tfe_organization_run_task": resourceTFEOrganizationRunTask(), "tfe_organization_token": resourceTFEOrganizationToken(), "tfe_policy": resourceTFEPolicy(), "tfe_policy_set": resourceTFEPolicySet(), diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index cb52e5b62..f558b420d 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -139,5 +139,6 @@ func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Res NewResourceVariable, NewSAMLSettingsResource, NewResourceWorkspaceSettings, + NewOrganizationRunTaskResource, } } diff --git a/internal/provider/resource_tfe_organization_run_task.go b/internal/provider/resource_tfe_organization_run_task.go index a049edcbb..a51082fca 100644 --- a/internal/provider/resource_tfe_organization_run_task.go +++ b/internal/provider/resource_tfe_organization_run_task.go @@ -1,209 +1,296 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// NOTE: This is a legacy resource and should be migrated to the Plugin -// Framework if substantial modifications are planned. See -// docs/new-resources.md if planning to use this code as boilerplate for -// a new resource. - package provider import ( "context" + "errors" "fmt" - "log" "strings" tfe "github.com/hashicorp/go-tfe" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/hashicorp/terraform-plugin-framework/resource" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + customValidators "github.com/hashicorp/terraform-provider-tfe/internal/provider/validators" ) -func resourceTFEOrganizationRunTask() *schema.Resource { - return &schema.Resource{ - Create: resourceTFEOrganizationRunTaskCreate, - Read: resourceTFEOrganizationRunTaskRead, - Delete: resourceTFEOrganizationRunTaskDelete, - Update: resourceTFEOrganizationRunTaskUpdate, - Importer: &schema.ResourceImporter{ - StateContext: resourceTFEOrganizationRunTaskImporter, - }, +type resourceOrgRunTask struct { + config ConfiguredClient +} + +func NewOrganizationRunTaskResource() resource.Resource { + return &resourceOrgRunTask{} +} + +type modelTFEOrganizationRunTaskV0 struct { + Category types.String `tfsdk:"category"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + HMACKey types.String `tfsdk:"hmac_key"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Organization types.String `tfsdk:"organization"` + URL types.String `tfsdk:"url"` +} + +func modelFromTFEOrganizationRunTask(v *tfe.RunTask, hmacKey types.String) modelTFEOrganizationRunTaskV0 { + result := modelTFEOrganizationRunTaskV0{ + Category: types.StringValue(v.Category), + Description: types.StringValue(v.Description), + Enabled: types.BoolValue(v.Enabled), + HMACKey: types.StringValue(""), // This value is never emitted by the API so we inject it later + ID: types.StringValue(v.ID), + Name: types.StringValue(v.Name), + Organization: types.StringValue(v.Organization.Name), + URL: types.StringValue(v.URL), + } + + if len(hmacKey.String()) > 0 { + result.HMACKey = hmacKey + } + + return result +} + +func (r *resourceOrgRunTask) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_organization_run_task" +} - CustomizeDiff: customizeDiffIfProviderDefaultOrganizationChanged, +// Configure implements resource.ResourceWithConfigure +func (r *resourceOrgRunTask) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, +func (r *resourceOrgRunTask) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the task", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "name": schema.StringAttribute{ Required: true, }, - - "organization": { - Type: schema.TypeString, + "organization": schema.StringAttribute{ Optional: true, Computed: true, - ForceNew: true, + // From ForceNew: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, - - "url": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.IsURLWithHTTPorHTTPS, + "url": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + customValidators.IsURLWithHTTPorHTTPS(), + }, }, - - "category": { - Type: schema.TypeString, - Default: "task", + "category": schema.StringAttribute{ Optional: true, + Computed: true, + Default: stringdefault.StaticString("task"), }, - - "hmac_key": { - Type: schema.TypeString, + "hmac_key": schema.StringAttribute{ Sensitive: true, - Default: "", Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), }, - - "enabled": { - Type: schema.TypeBool, - Default: true, + "enabled": schema.BoolAttribute{ Optional: true, + Computed: true, + Default: booldefault.StaticBool(true), }, - - "description": { - Type: schema.TypeString, + "description": schema.StringAttribute{ Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), }, }, } } -func resourceTFEOrganizationRunTaskCreate(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) +func (r *resourceOrgRunTask) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelTFEOrganizationRunTaskV0 - // Get the task name and organization. - name := d.Get("name").(string) - organization, err := config.schemaOrDefaultOrganization(d) - if err != nil { - return err + // Read Terraform current state into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return } - // Create a new options struct. - options := tfe.RunTaskCreateOptions{ - Name: name, - URL: d.Get("url").(string), - Category: d.Get("category").(string), - HMACKey: tfe.String(d.Get("hmac_key").(string)), - Enabled: tfe.Bool(d.Get("enabled").(bool)), - Description: tfe.String(d.Get("description").(string)), - } + taskID := state.ID.ValueString() - log.Printf("[DEBUG] Create task %s for organization: %s", name, organization) - task, err := config.Client.RunTasks.Create(ctx, organization, options) + tflog.Debug(ctx, "Reading organization run task") + task, err := r.config.Client.RunTasks.Read(ctx, taskID) if err != nil { - return fmt.Errorf( - "Error creating task %s for organization %s: %w", name, organization, err) + resp.Diagnostics.AddError("Error reading Organization Run Task", "Could not read Organization Run Task, unexpected error: "+err.Error()) + return } - d.SetId(task.ID) + result := modelFromTFEOrganizationRunTask(task, state.HMACKey) - return resourceTFEOrganizationRunTaskRead(d, meta) + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } -func resourceTFEOrganizationRunTaskDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(ConfiguredClient) +func (r *resourceOrgRunTask) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan modelTFEOrganizationRunTaskV0 - log.Printf("[DEBUG] Delete task: %s", d.Id()) - err := client.Client.RunTasks.Delete(ctx, d.Id()) - if err != nil { - if isErrResourceNotFound(err) { - return nil - } - return fmt.Errorf("Error deleting task %s: %w", d.Id(), err) + // Read Terraform planned changes into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return } - return nil -} + var organization string + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.Plan, &organization)...) -func resourceTFEOrganizationRunTaskUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(ConfiguredClient) + if resp.Diagnostics.HasError() { + return + } - // Setup the options struct - options := tfe.RunTaskUpdateOptions{} - if d.HasChange("name") { - options.Name = tfe.String(d.Get("name").(string)) + options := tfe.RunTaskCreateOptions{ + Name: plan.Name.ValueString(), + URL: plan.URL.ValueString(), + Category: plan.Category.ValueString(), + HMACKey: plan.HMACKey.ValueStringPointer(), + Enabled: plan.Enabled.ValueBoolPointer(), + Description: plan.Description.ValueStringPointer(), } - if d.HasChange("url") { - options.URL = tfe.String(d.Get("url").(string)) + + tflog.Debug(ctx, fmt.Sprintf("Create task %s for organization: %s", options.Name, organization)) + task, err := r.config.Client.RunTasks.Create(ctx, organization, options) + if err != nil { + resp.Diagnostics.AddError("Unable to create organization task", err.Error()) + return } - if d.HasChange("category") { - options.Category = tfe.String(d.Get("category").(string)) + + result := modelFromTFEOrganizationRunTask(task, plan.HMACKey) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceOrgRunTask) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan modelTFEOrganizationRunTaskV0 + + // Read Terraform planned changes into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return } - if d.HasChange("enabled") { - options.Enabled = tfe.Bool(d.Get("enabled").(bool)) + + var state modelTFEOrganizationRunTaskV0 + // Read Terraform state into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return } - if d.HasChange("hmac_key") { - options.HMACKey = tfe.String(d.Get("hmac_key").(string)) + + options := tfe.RunTaskUpdateOptions{ + Name: plan.Name.ValueStringPointer(), + URL: plan.URL.ValueStringPointer(), + Category: plan.Category.ValueStringPointer(), + Enabled: plan.Enabled.ValueBoolPointer(), + Description: plan.Description.ValueStringPointer(), } - if d.HasChange("description") { - options.Description = tfe.String(d.Get("description").(string)) + + // HMAC Key is a write-only value so we should only send it if + // it really has changed. + if plan.HMACKey.ValueString() != state.HMACKey.ValueString() { + options.HMACKey = plan.HMACKey.ValueStringPointer() } - log.Printf("[DEBUG] Update configuration of task: %s", d.Id()) - task, err := client.Client.RunTasks.Update(ctx, d.Id(), options) + taskID := plan.ID.ValueString() + + tflog.Debug(ctx, fmt.Sprintf("Update task %s", taskID)) + task, err := r.config.Client.RunTasks.Update(ctx, taskID, options) if err != nil { - return fmt.Errorf("Error updating task %s: %w", d.Id(), err) + resp.Diagnostics.AddError("Unable to update organization task", err.Error()) + return } - d.SetId(task.ID) + result := modelFromTFEOrganizationRunTask(task, plan.HMACKey) - return resourceTFEOrganizationRunTaskRead(d, meta) + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } -func resourceTFEOrganizationRunTaskRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(ConfiguredClient) +func (r *resourceOrgRunTask) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state modelTFEOrganizationRunTaskV0 + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } - log.Printf("[DEBUG] Read configuration of task: %s", d.Id()) - task, err := client.Client.RunTasks.Read(ctx, d.Id()) + taskID := state.ID.ValueString() - if err != nil { - if isErrResourceNotFound(err) { - log.Printf("[DEBUG] Task %s does not exist", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading configuration of task %s: %w", d.Id(), err) - } - - // Update the config. - d.Set("name", task.Name) - d.Set("url", task.URL) - d.Set("category", task.Category) - d.Set("enabled", task.Enabled) - // The HMAC Key is always empty from the API so all we can do is - // echo the request's key to the response - d.Set("hmac_key", tfe.String(d.Get("hmac_key").(string))) - d.Set("description", task.Description) - return nil + tflog.Debug(ctx, fmt.Sprintf("Delete task %s", taskID)) + err := r.config.Client.RunTasks.Delete(ctx, taskID) + // Ignore 404s for delete + if err != nil && !errors.Is(err, tfe.ErrResourceNotFound) { + resp.Diagnostics.AddError( + "Error deleting organization run task", + fmt.Sprintf("Couldn't delete organization run task %s: %s", taskID, err.Error()), + ) + } + // Resource is implicitly deleted from resp.State if diagnostics have no errors. } -func resourceTFEOrganizationRunTaskImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - client := meta.(ConfiguredClient) - - s := strings.Split(d.Id(), "/") +func (r *resourceOrgRunTask) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 2) if len(s) != 2 { - return nil, fmt.Errorf( - "invalid task input format: %s (expected /)", - d.Id(), + resp.Diagnostics.AddError( + "Error importing organization run task", + fmt.Sprintf("Invalid task input format: %s (expected /)", req.ID), ) + return } - task, err := fetchOrganizationRunTask(s[1], s[0], client.Client) - if err != nil { - return nil, err - } - - d.Set("organization", task.Organization.Name) - d.SetId(task.ID) + taskName := s[1] + orgName := s[0] - return []*schema.ResourceData{d}, nil + if task, err := fetchOrganizationRunTask(taskName, orgName, r.config.Client); err != nil { + resp.Diagnostics.AddError( + "Error importing organization run task", + err.Error(), + ) + } else if task == nil { + resp.Diagnostics.AddError( + "Error importing organization run task", + "Task does not exist or has no details", + ) + } else { + // We can never import the HMACkey (Write-only) so assume it's the default (empty) + result := modelFromTFEOrganizationRunTask(task, types.StringValue("")) + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + } } diff --git a/internal/provider/resource_tfe_organization_run_task_test.go b/internal/provider/resource_tfe_organization_run_task_test.go index 2995b93b6..f3929b5ff 100644 --- a/internal/provider/resource_tfe_organization_run_task_test.go +++ b/internal/provider/resource_tfe_organization_run_task_test.go @@ -17,8 +17,8 @@ import ( func TestAccTFEOrganizationRunTask_validateSchemaAttributeUrl(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, Steps: []resource.TestStep{ { Config: testAccTFEOrganizationRunTask_basic("org", 1, "", ""), @@ -56,9 +56,9 @@ func TestAccTFEOrganizationRunTask_create(t *testing.T) { hmacKey := runTasksHMACKey() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEOrganizationRunTaskDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEOrganizationRunTaskDestroy, Steps: []resource.TestStep{ { Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL(), hmacKey), @@ -101,9 +101,9 @@ func TestAccTFEOrganizationRunTask_import(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFETeamAccessDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFETeamAccessDestroy, Steps: []resource.TestStep{ { Config: testAccTFEOrganizationRunTask_basic(org.Name, rInt, runTasksURL(), runTasksHMACKey()), diff --git a/internal/provider/validators/is_url_https.go b/internal/provider/validators/is_url_https.go new file mode 100644 index 000000000..90dd16dbd --- /dev/null +++ b/internal/provider/validators/is_url_https.go @@ -0,0 +1,43 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validators + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + oldValidation "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +type isURLWithHTTPorHTTPSValidator struct{} + +func (v isURLWithHTTPorHTTPSValidator) Description(_ context.Context) string { + return "string is a valid HTTP or HTTPS URL" +} + +func (v isURLWithHTTPorHTTPSValidator) MarkdownDescription(ctx context.Context) string { + return v.Description(ctx) +} + +func (v isURLWithHTTPorHTTPSValidator) ValidateString(ctx context.Context, request validator.StringRequest, response *validator.StringResponse) { + if request.ConfigValue.IsNull() || request.ConfigValue.IsUnknown() { + return + } + + value := request.ConfigValue.ValueString() + + if _, errs := oldValidation.IsURLWithHTTPorHTTPS(value, value); errs != nil { + for _, err := range errs { + response.Diagnostics.Append(diag.NewAttributeErrorDiagnostic( + request.Path, + "Invalid Attribute Value", + err.Error(), + )) + } + } +} +func IsURLWithHTTPorHTTPS() validator.String { + return isURLWithHTTPorHTTPSValidator{} +} From 8026b9d9283fea25873e82385b331b1020d411b8 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 18 Mar 2024 13:50:50 +0800 Subject: [PATCH 306/420] Trigger a modification on default org. change for Run Task Previously the Org. Run Task resource would not trigger a change if it was using the default organization. This commit updates the plan modifier to detect when this happens and trigger a modification. --- internal/provider/resource_tfe_organization_run_task.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/provider/resource_tfe_organization_run_task.go b/internal/provider/resource_tfe_organization_run_task.go index a51082fca..3a8d1b40f 100644 --- a/internal/provider/resource_tfe_organization_run_task.go +++ b/internal/provider/resource_tfe_organization_run_task.go @@ -66,6 +66,11 @@ func (r *resourceOrgRunTask) Metadata(_ context.Context, req resource.MetadataRe resp.TypeName = req.ProviderTypeName + "_organization_run_task" } +func (r *resourceOrgRunTask) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + // If a Run Tasks uses the default organization, then if the deafault org. changes, it should trigger a modification + modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req.State, req.Config, req.Plan, resp) +} + // Configure implements resource.ResourceWithConfigure func (r *resourceOrgRunTask) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. From 1705f825c7259d76e9ed19ed4194bd6a80ecd30e Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 18 Mar 2024 14:22:11 +0800 Subject: [PATCH 307/420] Migrate Run Task all resource/data source tests Due to the DataSource test using the Resource code to create the test fixture we also need to update the provider factories from only the old one to the newer Mux provider. --- .../data_source_organization_run_task_test.go | 4 ++-- .../provider/data_source_workspace_run_task_test.go | 4 ++-- .../provider/resource_tfe_workspace_run_task_test.go | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/provider/data_source_organization_run_task_test.go b/internal/provider/data_source_organization_run_task_test.go index cd2bcea15..879f1080c 100644 --- a/internal/provider/data_source_organization_run_task_test.go +++ b/internal/provider/data_source_organization_run_task_test.go @@ -26,8 +26,8 @@ func TestAccTFEOrganizationRunTaskDataSource_basic(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, Steps: []resource.TestStep{ { Config: testAccTFEOrganizationRunTaskDataSourceConfig(org.Name, rInt, runTasksURL(), runTasksHMACKey()), diff --git a/internal/provider/data_source_workspace_run_task_test.go b/internal/provider/data_source_workspace_run_task_test.go index 27028611d..f454e930c 100644 --- a/internal/provider/data_source_workspace_run_task_test.go +++ b/internal/provider/data_source_workspace_run_task_test.go @@ -26,8 +26,8 @@ func TestAccTFEWorkspaceRunTaskDataSource_basic(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, Steps: []resource.TestStep{ { Config: testAccTFEWorkspaceRunTaskDataSourceConfig(org.Name, rInt, runTasksURL()), diff --git a/internal/provider/resource_tfe_workspace_run_task_test.go b/internal/provider/resource_tfe_workspace_run_task_test.go index d267c0050..e8431e4d2 100644 --- a/internal/provider/resource_tfe_workspace_run_task_test.go +++ b/internal/provider/resource_tfe_workspace_run_task_test.go @@ -26,9 +26,9 @@ func TestAccTFEWorkspaceRunTask_create(t *testing.T) { workspaceTask := &tfe.WorkspaceRunTask{} resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFEWorkspaceRunTaskDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEWorkspaceRunTaskDestroy, Steps: []resource.TestStep{ { Config: testAccTFEWorkspaceRunTask_basic(org.Name, runTasksURL()), @@ -61,9 +61,9 @@ func TestAccTFEWorkspaceRunTask_import(t *testing.T) { t.Cleanup(orgCleanup) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckTFETeamAccessDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFETeamAccessDestroy, Steps: []resource.TestStep{ { Config: testAccTFEWorkspaceRunTask_basic(org.Name, runTasksURL()), From 7a086caf8a14f943b2a17888eedc96392d815041 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Thu, 21 Mar 2024 10:01:01 +0800 Subject: [PATCH 308/420] Add inteface implementations for resourceOrgRunTask --- internal/provider/resource_tfe_organization_run_task.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/provider/resource_tfe_organization_run_task.go b/internal/provider/resource_tfe_organization_run_task.go index 3a8d1b40f..7e2ba9fc0 100644 --- a/internal/provider/resource_tfe_organization_run_task.go +++ b/internal/provider/resource_tfe_organization_run_task.go @@ -28,6 +28,11 @@ type resourceOrgRunTask struct { config ConfiguredClient } +var _ resource.Resource = &resourceOrgRunTask{} +var _ resource.ResourceWithConfigure = &resourceOrgRunTask{} +var _ resource.ResourceWithImportState = &resourceOrgRunTask{} +var _ resource.ResourceWithModifyPlan = &resourceOrgRunTask{} + func NewOrganizationRunTaskResource() resource.Resource { return &resourceOrgRunTask{} } From e983a2c8d16cbca5520efb5126d59b8443c6715d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 13:14:35 +0000 Subject: [PATCH 309/420] Build(deps): Bump github.com/zclconf/go-cty from 1.14.3 to 1.14.4 Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.14.3 to 1.14.4. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.14.3...v1.14.4) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f7e95eb8e..bf5dfa1fb 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/hashicorp/terraform-svchost v0.1.1 github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/zclconf/go-cty v1.14.3 + github.com/zclconf/go-cty v1.14.4 golang.org/x/crypto v0.19.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect diff --git a/go.sum b/go.sum index 3fdfc613f..8f1380ed6 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.3 h1:1JXy1XroaGrzZuG6X9dt7HL6s9AwbY+l4UNL8o5B6ho= -github.com/zclconf/go-cty v1.14.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= +github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= From 715b36ccefc1e26bbbe4ed445551a5903c36a52c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:25:05 -0400 Subject: [PATCH 310/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework (#1294) Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v1.6.1...v1.7.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bf5dfa1fb..1063d676f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect - github.com/hashicorp/terraform-plugin-framework v1.6.1 + github.com/hashicorp/terraform-plugin-framework v1.7.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.22.1 github.com/hashicorp/terraform-plugin-mux v0.15.0 diff --git a/go.sum b/go.sum index 8f1380ed6..ae71b5576 100644 --- a/go.sum +++ b/go.sum @@ -90,8 +90,8 @@ github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8J github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-framework v1.6.1 h1:hw2XrmUu8d8jVL52ekxim2IqDc+2Kpekn21xZANARLU= -github.com/hashicorp/terraform-plugin-framework v1.6.1/go.mod h1:aJI+n/hBPhz1J+77GdgNfk5svW12y7fmtxe/5L5IuwI= +github.com/hashicorp/terraform-plugin-framework v1.7.0 h1:wOULbVmfONnJo9iq7/q+iBOBJul5vRovaYJIu2cY/Pw= +github.com/hashicorp/terraform-plugin-framework v1.7.0/go.mod h1:jY9Id+3KbZ17OMpulgnWLSfwxNVYSoYBQFTgsx044CI= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= From 1587ab3e4e65e160dc2302ff391379b89f8f9f7e Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Mon, 25 Mar 2024 16:23:06 -0400 Subject: [PATCH 311/420] Bump nightly instance job timeout to 20m (#1296) --- .github/workflows/nightly-tfe-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 0f3ba52e9..e4495da06 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -8,7 +8,7 @@ on: jobs: instance: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Build nightly tflocal instance uses: hashicorp-forge/terraform-cloud-action/apply@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main From 172981e06a25d18acefb38671a143dad860e2202 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Wed, 27 Mar 2024 11:35:59 +0800 Subject: [PATCH 312/420] Migrate tfe_workspace_run_task to plugin model This commit migrates the tfe_workspace_run_task resource to the newer plugin model. It uses a schema v0 as there is no difference in schema. Later changes will migrate the other data source objects. --- internal/provider/provider.go | 1 - internal/provider/provider_next.go | 5 +- .../resource_tfe_workspace_run_task.go | 334 +++++++++++------- 3 files changed, 214 insertions(+), 126 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 550d1c7c1..aee1c4ae4 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -143,7 +143,6 @@ func Provider() *schema.Provider { "tfe_team_token": resourceTFETeamToken(), "tfe_terraform_version": resourceTFETerraformVersion(), "tfe_workspace": resourceTFEWorkspace(), - "tfe_workspace_run_task": resourceTFEWorkspaceRunTask(), "tfe_variable_set": resourceTFEVariableSet(), "tfe_workspace_policy_set": resourceTFEWorkspacePolicySet(), "tfe_workspace_policy_set_exclusion": resourceTFEWorkspacePolicySetExclusion(), diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index f558b420d..9cca9d601 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -134,11 +134,12 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ + NewOrganizationRunTaskResource, NewRegistryGPGKeyResource, NewRegistryProviderResource, NewResourceVariable, - NewSAMLSettingsResource, NewResourceWorkspaceSettings, - NewOrganizationRunTaskResource, + NewSAMLSettingsResource, + NewWorkspaceRunTaskResource, } } diff --git a/internal/provider/resource_tfe_workspace_run_task.go b/internal/provider/resource_tfe_workspace_run_task.go index 227a9a848..58c39a651 100644 --- a/internal/provider/resource_tfe_workspace_run_task.go +++ b/internal/provider/resource_tfe_workspace_run_task.go @@ -1,22 +1,25 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// NOTE: This is a legacy resource and should be migrated to the Plugin -// Framework if substantial modifications are planned. See -// docs/new-resources.md if planning to use this code as boilerplate for -// a new resource. - package provider import ( "context" + "errors" "fmt" - "log" "strings" tfe "github.com/hashicorp/go-tfe" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/hashicorp/terraform-plugin-framework/resource" + + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" ) func workspaceRunTaskEnforcementLevels() []string { @@ -51,186 +54,271 @@ func sentenceList(items []string, prefix string, suffix string, conjunction stri return b.String() } -func resourceTFEWorkspaceRunTask() *schema.Resource { - return &schema.Resource{ - Create: resourceTFEWorkspaceRunTaskCreate, - Read: resourceTFEWorkspaceRunTaskRead, - Delete: resourceTFEWorkspaceRunTaskDelete, - Update: resourceTFEWorkspaceRunTaskUpdate, - Importer: &schema.ResourceImporter{ - StateContext: resourceTFEWorkspaceRunTaskImporter, - }, +type resourceWorkspaceRunTask struct { + config ConfiguredClient +} + +var _ resource.Resource = &resourceWorkspaceRunTask{} +var _ resource.ResourceWithConfigure = &resourceWorkspaceRunTask{} +var _ resource.ResourceWithImportState = &resourceWorkspaceRunTask{} + +func NewWorkspaceRunTaskResource() resource.Resource { + return &resourceWorkspaceRunTask{} +} + +type modelTFEWorkspaceRunTaskV0 struct { + ID types.String `tfsdk:"id"` + WorkspaceID types.String `tfsdk:"workspace_id"` + TaskID types.String `tfsdk:"task_id"` + EnforcementLevel types.String `tfsdk:"enforcement_level"` + Stage types.String `tfsdk:"stage"` +} + +func modelFromTFEWorkspaceRunTask(v *tfe.WorkspaceRunTask) modelTFEWorkspaceRunTaskV0 { + return modelTFEWorkspaceRunTaskV0{ + ID: types.StringValue(v.ID), + WorkspaceID: types.StringValue(v.Workspace.ID), + TaskID: types.StringValue(v.RunTask.ID), + EnforcementLevel: types.StringValue(string(v.EnforcementLevel)), + Stage: types.StringValue(string(v.Stage)), + } +} + +func (r *resourceWorkspaceRunTask) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_workspace_run_task" +} + +// Configure implements resource.ResourceWithConfigure +func (r *resourceWorkspaceRunTask) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } - Schema: map[string]*schema.Schema{ - "workspace_id": { + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +func (r *resourceWorkspaceRunTask) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the workspace task", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "workspace_id": schema.StringAttribute{ Description: "The id of the workspace to associate the Run task to.", - Type: schema.TypeString, - ForceNew: true, Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, - - "task_id": { + "task_id": schema.StringAttribute{ Description: "The id of the Run task to associate to the Workspace.", - - Type: schema.TypeString, - ForceNew: true, - Required: true, + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, - - "enforcement_level": { + "enforcement_level": schema.StringAttribute{ Description: fmt.Sprintf("The enforcement level of the task. Valid values are %s.", sentenceList( workspaceRunTaskEnforcementLevels(), "`", "`", "and", )), - Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice( - workspaceRunTaskEnforcementLevels(), - false, - ), + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskEnforcementLevels()...), + }, }, - - "stage": { + "stage": schema.StringAttribute{ Description: fmt.Sprintf("The stage to run the task in. Valid values are %s.", sentenceList( workspaceRunTaskStages(), "`", "`", "and", )), - Type: schema.TypeString, Optional: true, - Default: tfe.PostPlan, - ValidateFunc: validation.StringInSlice( - workspaceRunTaskStages(), - false, - ), + Computed: true, + Default: stringdefault.StaticString(string(tfe.PostPlan)), + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskStages()...), + }, }, }, } } -func resourceTFEWorkspaceRunTaskCreate(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) +func (r *resourceWorkspaceRunTask) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelTFEWorkspaceRunTaskV0 + + // Read Terraform current state into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } - workspaceID := d.Get("workspace_id").(string) - taskID := d.Get("task_id").(string) + wstaskID := state.ID.ValueString() + workspaceID := state.WorkspaceID.ValueString() - task, err := config.Client.RunTasks.Read(ctx, taskID) + tflog.Debug(ctx, "Reading workspace run task") + wstask, err := r.config.Client.WorkspaceRunTasks.Read(ctx, workspaceID, wstaskID) if err != nil { - return fmt.Errorf( - "Error retrieving task %s: %w", taskID, err) + resp.Diagnostics.AddError("Error reading Workspace Run Task", "Could not read Workspace Run Task, unexpected error: "+err.Error()) + return } - ws, err := config.Client.Workspaces.ReadByID(ctx, workspaceID) + result := modelFromTFEWorkspaceRunTask(wstask) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceWorkspaceRunTask) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan modelTFEWorkspaceRunTaskV0 + + // Read Terraform planned changes into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + taskID := plan.TaskID.ValueString() + task, err := r.config.Client.RunTasks.Read(ctx, taskID) if err != nil { - return fmt.Errorf( - "Error retrieving workspace %s: %w", workspaceID, err) + resp.Diagnostics.AddError("Error retrieving task", "Could not read Organization Run Task "+taskID+", unexpected error: "+err.Error()) + return + } + + workspaceID := plan.WorkspaceID.ValueString() + if _, err := r.config.Client.Workspaces.ReadByID(ctx, workspaceID); err != nil { + resp.Diagnostics.AddError("Error retrieving workspace", "Could not read Workspace "+workspaceID+", unexpected error: "+err.Error()) + return } - stage := tfe.Stage(d.Get("stage").(string)) + + stage := tfe.Stage(plan.Stage.ValueString()) + level := tfe.TaskEnforcementLevel(plan.EnforcementLevel.ValueString()) options := tfe.WorkspaceRunTaskCreateOptions{ RunTask: task, - EnforcementLevel: tfe.TaskEnforcementLevel(d.Get("enforcement_level").(string)), + EnforcementLevel: level, Stage: &stage, } - log.Printf("[DEBUG] Create task %s in workspace %s", task.ID, ws.ID) - wstask, err := config.Client.WorkspaceRunTasks.Create(ctx, ws.ID, options) + tflog.Debug(ctx, fmt.Sprintf("Create task %s in workspace: %s", taskID, workspaceID)) + wstask, err := r.config.Client.WorkspaceRunTasks.Create(ctx, workspaceID, options) if err != nil { - return fmt.Errorf("Error creating task %s in workspace %s: %w", task.ID, ws.ID, err) + resp.Diagnostics.AddError("Unable to create workspace task", err.Error()) + return } - d.SetId(wstask.ID) + result := modelFromTFEWorkspaceRunTask(wstask) - return resourceTFEWorkspaceRunTaskRead(d, meta) + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } -func resourceTFEWorkspaceRunTaskDelete(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) - - // Get the workspace - workspaceID := d.Get("workspace_id").(string) - - log.Printf("[DEBUG] Delete task %s in workspace %s", d.Id(), workspaceID) - err := config.Client.WorkspaceRunTasks.Delete(ctx, workspaceID, d.Id()) - if err != nil && !isErrResourceNotFound(err) { - return fmt.Errorf("Error deleting task %s in workspace %s: %w", d.Id(), workspaceID, err) +func (r *resourceWorkspaceRunTask) stringPointerToStagePointer(val *string) *tfe.Stage { + if val == nil { + return nil } - - return nil + newVal := tfe.Stage(*val) + return &newVal } -func resourceTFEWorkspaceRunTaskUpdate(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) - - // Get the workspace - workspaceID := d.Get("workspace_id").(string) - - // Setup the options struct - options := tfe.WorkspaceRunTaskUpdateOptions{} - if d.HasChange("enforcement_level") { - options.EnforcementLevel = tfe.TaskEnforcementLevel(d.Get("enforcement_level").(string)) - } - if d.HasChange("stage") { - stage := tfe.Stage(d.Get("stage").(string)) - options.Stage = &stage - } +func (r *resourceWorkspaceRunTask) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan modelTFEWorkspaceRunTaskV0 - log.Printf("[DEBUG] Update configuration of task %s in workspace %s", d.Id(), workspaceID) - _, err := config.Client.WorkspaceRunTasks.Update(ctx, workspaceID, d.Id(), options) - if err != nil { - return fmt.Errorf("Error updating task %s in workspace %s: %w", d.Id(), workspaceID, err) + // Read Terraform planned changes into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return } - return nil -} + level := tfe.TaskEnforcementLevel(plan.EnforcementLevel.ValueString()) + stage := r.stringPointerToStagePointer(plan.Stage.ValueStringPointer()) -func resourceTFEWorkspaceRunTaskRead(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) + options := tfe.WorkspaceRunTaskUpdateOptions{ + EnforcementLevel: level, + Stage: stage, + } - // Get the workspace - workspaceID := d.Get("workspace_id").(string) + wstaskID := plan.ID.ValueString() + workspaceID := plan.WorkspaceID.ValueString() - wstask, err := config.Client.WorkspaceRunTasks.Read(ctx, workspaceID, d.Id()) + tflog.Debug(ctx, fmt.Sprintf("Update task %s in workspace %s", wstaskID, workspaceID)) + wstask, err := r.config.Client.WorkspaceRunTasks.Update(ctx, workspaceID, wstaskID, options) if err != nil { - if isErrResourceNotFound(err) { - log.Printf("[DEBUG] Workspace Task %s does not exist in workspace %s", d.Id(), workspaceID) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading configuration of task %s in workspace %s: %w", d.Id(), workspaceID, err) + resp.Diagnostics.AddError("Unable to update workspace task", err.Error()) + return } - // Update the config. - d.Set("workspace_id", wstask.Workspace.ID) - d.Set("task_id", wstask.RunTask.ID) - d.Set("enforcement_level", string(wstask.EnforcementLevel)) - d.Set("stage", string(wstask.Stage)) + result := modelFromTFEWorkspaceRunTask(wstask) - return nil + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } -func resourceTFEWorkspaceRunTaskImporter(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - config := meta.(ConfiguredClient) +func (r *resourceWorkspaceRunTask) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state modelTFEWorkspaceRunTaskV0 + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + wstaskID := state.ID.ValueString() + workspaceID := state.WorkspaceID.ValueString() - s := strings.Split(d.Id(), "/") - if len(s) != 3 { - return nil, fmt.Errorf( - "invalid task input format: %s (expected //)", - d.Id(), + tflog.Debug(ctx, fmt.Sprintf("Delete task %s in workspace %s", wstaskID, workspaceID)) + err := r.config.Client.WorkspaceRunTasks.Delete(ctx, workspaceID, wstaskID) + // Ignore 404s for delete + if err != nil && !errors.Is(err, tfe.ErrResourceNotFound) { + resp.Diagnostics.AddError( + "Error deleting workspace run task", + fmt.Sprintf("Couldn't delete task %s in workspace %s: %s", wstaskID, workspaceID, err.Error()), ) } + // Resource is implicitly deleted from resp.State if diagnostics have no errors. +} - wstask, err := fetchWorkspaceRunTask(s[2], s[1], s[0], config.Client) - if err != nil { - return nil, err +func (r *resourceWorkspaceRunTask) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 3) + if len(s) != 3 { + resp.Diagnostics.AddError( + "Error importing workspace run task", + fmt.Sprintf("Invalid task input format: %s (expected //)", req.ID), + ) + return } - d.Set("workspace_id", wstask.Workspace.ID) - d.Set("task_id", wstask.RunTask.ID) - d.SetId(wstask.ID) + taskName := s[2] + workspaceName := s[1] + orgName := s[0] - return []*schema.ResourceData{d}, nil + if wstask, err := fetchWorkspaceRunTask(taskName, workspaceName, orgName, r.config.Client); err != nil { + resp.Diagnostics.AddError( + "Error importing workspace run task", + err.Error(), + ) + } else if wstask == nil { + resp.Diagnostics.AddError( + "Error importing workspace run task", + "Workspace task does not exist or has no details", + ) + } else { + result := modelFromTFEWorkspaceRunTask(wstask) + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + } } From 0121b6cc54d050f140a5575290f8759cf31672c9 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Wed, 27 Mar 2024 11:36:34 +0800 Subject: [PATCH 313/420] Add acceptance tests for tfe_workspace_run_tasks Previously there were no tests to assert that the validated attributes actually worked. --- .../resource_tfe_workspace_run_task_test.go | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/internal/provider/resource_tfe_workspace_run_task_test.go b/internal/provider/resource_tfe_workspace_run_task_test.go index e8431e4d2..2456b3d5b 100644 --- a/internal/provider/resource_tfe_workspace_run_task_test.go +++ b/internal/provider/resource_tfe_workspace_run_task_test.go @@ -5,6 +5,7 @@ package provider import ( "fmt" + "regexp" "testing" tfe "github.com/hashicorp/go-tfe" @@ -12,6 +13,23 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +func TestAccTFEWorkspaceRunTask_validateSchemaAttributes(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspaceRunTask_attributes("bad_level", string(tfe.PostPlan)), + ExpectError: regexp.MustCompile(`enforcement_level value must be one of:`), + }, + { + Config: testAccTFEWorkspaceRunTask_attributes(string(tfe.Advisory), "bad_stage"), + ExpectError: regexp.MustCompile(`stage value must be one of:`), + }, + }, + }) +} + func TestAccTFEWorkspaceRunTask_create(t *testing.T) { skipUnlessRunTasksDefined(t) @@ -134,6 +152,17 @@ func testAccCheckTFEWorkspaceRunTaskDestroy(s *terraform.State) error { return nil } +func testAccTFEWorkspaceRunTask_attributes(enforcementLevel, stage string) string { + return fmt.Sprintf(` +resource "tfe_workspace_run_task" "foobar" { + workspace_id = "ws-abc123" + task_id = "task-abc123" + enforcement_level = "%s" + stage = "%s" +} +`, enforcementLevel, stage) +} + func testAccTFEWorkspaceRunTask_basic(orgName, runTaskURL string) string { return fmt.Sprintf(` locals { From 85c510dbda5f0263dd1e7209986c10beb97c64b7 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Wed, 27 Mar 2024 11:42:31 +0800 Subject: [PATCH 314/420] Remove unused function --- internal/provider/provider.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index aee1c4ae4..6713a06f8 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -191,9 +191,3 @@ var descriptions = map[string]string{ "organization": "The organization to apply to a resource if one is not defined on\n" + "the resource itself", } - -// A commonly used helper method to check if the error -// returned was tfe.ErrResourceNotFound -func isErrResourceNotFound(err error) bool { - return errors.Is(err, tfe.ErrResourceNotFound) -} From d2855a6e649b87a8b342a44d2cbf0f58a351672b Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 1 Apr 2024 00:20:36 +0000 Subject: [PATCH 315/420] cdktf: update index.html.markdown,r/workspace_variable_set.html.markdown,r/workspace_settings.markdown,r/workspace_run_task.html.markdown,r/workspace_run.html.markdown,r/workspace_policy_set_exclusion.html.markdown,r/workspace_policy_set.html.markdown,r/workspace.html.markdown,r/variable_set.html.markdown,r/variable.html.markdown,r/terraform_version.html.markdown,r/team_token.html.markdown,r/team_project_access.html.markdown,r/team_organization_members.html.markdown,r/team_organization_member.html.markdown,r/team_members.html.markdown,r/team_member.html.markdown,r/team_access.html.markdown,r/team.html.markdown,r/ssh_key.html.markdown,r/sentinel_version.html.markdown,r/sentinel_policy.html.markdown,r/saml_settings.html.markdown,r/run_trigger.html.markdown,r/registry_provider.html.markdown,r/registry_module.html.markdown,r/registry_gpg_key.html.markdown,r/project_variable_set.html.markdown,r/project_policy_set.html.markdown,r/project.html.markdown,r/policy_set_parameter.html.markdown,r/policy_set.html.markdown,r/policy.html.markdown,r/organization_token.html.markdown,r/organization_run_task.html.markdown,r/organization_module_sharing.html.markdown,r/organization_membership.html.markdown,r/organization_default_settings.html.markdown,r/organization.html.markdown,r/opa_version.html.markdown,r/oauth_client.html.markdown,r/notification_configuration.html.markdown,r/no_code_module.html.markdown,r/agent_token.html.markdown,r/agent_pool_allowed_workspaces.html.markdown,r/agent_pool.html.markdown,r/admin_organization_settings.markdown,d/workspace_run_task.html.markdown,d/workspace_ids.html.markdown,d/workspace.html.markdown,d/variables.html.markdown,d/variable_set.html.markdown,d/teams.html.markdown,d/team_project_access.html.markdown,d/team_access.html.markdown,d/team.html.markdown,d/ssh_key.html.markdown,d/slug.html.markdown,d/saml_settings.html.markdown,d/registry_providers.html.markdown,d/registry_provider.html.markdown,d/registry_gpg_keys.html.markdown,d/registry_gpg_key.html.markdown,d/project.html.markdown,d/policy_set.html.markdown,d/outputs.html.markdown,d/organizations.html.markdown,d/organization_tags.html.markdown,d/organization_run_task.html.markdown,d/organization_membership.html.markdown,d/organization_members.html.markdown,d/organization.html.markdown,d/oauth_client.html.markdown,d/no_code_module.html.markdown,d/ip_ranges.html.markdown,d/github_installation.html.markdown,d/agent_pool.html.markdown --- .../cdktf/python/d/agent_pool.html.markdown | 17 +- .../d/github_installation.html.markdown | 32 +- .../cdktf/python/d/ip_ranges.html.markdown | 21 +- .../python/d/no_code_module.html.markdown | 33 +- .../cdktf/python/d/oauth_client.html.markdown | 47 +-- .../cdktf/python/d/organization.html.markdown | 17 +- .../d/organization_members.html.markdown | 22 +- .../d/organization_membership.html.markdown | 47 +-- .../d/organization_run_task.html.markdown | 17 +- .../python/d/organization_tags.html.markdown | 17 +- .../python/d/organizations.html.markdown | 17 +- .../docs/cdktf/python/d/outputs.html.markdown | 39 ++- .../cdktf/python/d/policy_set.html.markdown | 17 +- .../docs/cdktf/python/d/project.html.markdown | 17 +- .../python/d/registry_gpg_key.html.markdown | 17 +- .../python/d/registry_gpg_keys.html.markdown | 17 +- .../python/d/registry_provider.html.markdown | 32 +- .../python/d/registry_providers.html.markdown | 47 +-- .../python/d/saml_settings.html.markdown | 42 ++- .../docs/cdktf/python/d/slug.html.markdown | 22 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/d/team.html.markdown | 17 +- .../cdktf/python/d/team_access.html.markdown | 17 +- .../d/team_project_access.html.markdown | 17 +- .../docs/cdktf/python/d/teams.html.markdown | 17 +- .../cdktf/python/d/variable_set.html.markdown | 17 +- .../cdktf/python/d/variables.html.markdown | 43 +-- .../cdktf/python/d/workspace.html.markdown | 17 +- .../python/d/workspace_ids.html.markdown | 23 +- .../python/d/workspace_run_task.html.markdown | 17 +- website/docs/cdktf/python/index.html.markdown | 49 +-- .../r/admin_organization_settings.markdown | 74 +++-- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 72 +++-- .../cdktf/python/r/agent_token.html.markdown | 27 +- .../python/r/no_code_module.html.markdown | 56 ++-- .../notification_configuration.html.markdown | 96 +++--- .../cdktf/python/r/oauth_client.html.markdown | 47 +-- .../cdktf/python/r/opa_version.html.markdown | 17 +- .../cdktf/python/r/organization.html.markdown | 17 +- ...rganization_default_settings.html.markdown | 35 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../python/r/organization_token.html.markdown | 48 ++- .../docs/cdktf/python/r/policy.html.markdown | 32 +- .../cdktf/python/r/policy_set.html.markdown | 121 ++++--- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 61 ++-- .../r/project_variable_set.html.markdown | 35 +- .../python/r/registry_gpg_key.html.markdown | 23 +- .../python/r/registry_module.html.markdown | 146 +++++---- .../python/r/registry_provider.html.markdown | 44 +-- .../cdktf/python/r/run_trigger.html.markdown | 33 +- .../python/r/saml_settings.html.markdown | 35 +- .../python/r/sentinel_policy.html.markdown | 17 +- .../python/r/sentinel_version.html.markdown | 17 +- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 32 +- .../cdktf/python/r/team_access.html.markdown | 27 +- .../cdktf/python/r/team_member.html.markdown | 22 +- .../cdktf/python/r/team_members.html.markdown | 63 ++-- .../r/team_organization_member.html.markdown | 29 +- .../r/team_organization_members.html.markdown | 72 +++-- .../r/team_project_access.html.markdown | 53 ++-- .../cdktf/python/r/team_token.html.markdown | 65 ++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 ++++--- .../cdktf/python/r/variable_set.html.markdown | 115 ++++--- .../cdktf/python/r/workspace.html.markdown | 49 +-- .../r/workspace_policy_set.html.markdown | 35 +- ...rkspace_policy_set_exclusion.html.markdown | 35 +- .../python/r/workspace_run.html.markdown | 110 ++++--- .../python/r/workspace_run_task.html.markdown | 25 +- .../python/r/workspace_settings.markdown | 98 +++--- .../r/workspace_variable_set.html.markdown | 35 +- .../typescript/d/agent_pool.html.markdown | 21 +- .../d/github_installation.html.markdown | 58 ++-- .../typescript/d/ip_ranges.html.markdown | 29 +- .../typescript/d/no_code_module.html.markdown | 36 ++- .../typescript/d/oauth_client.html.markdown | 65 ++-- .../typescript/d/organization.html.markdown | 23 +- .../d/organization_members.html.markdown | 26 +- .../d/organization_membership.html.markdown | 89 +++--- .../d/organization_run_task.html.markdown | 31 +- .../d/organization_tags.html.markdown | 23 +- .../typescript/d/organizations.html.markdown | 21 +- .../cdktf/typescript/d/outputs.html.markdown | 51 ++- .../typescript/d/policy_set.html.markdown | 21 +- .../cdktf/typescript/d/project.html.markdown | 21 +- .../d/registry_gpg_key.html.markdown | 21 +- .../d/registry_gpg_keys.html.markdown | 21 +- .../d/registry_provider.html.markdown | 40 ++- .../d/registry_providers.html.markdown | 69 ++-- .../typescript/d/saml_settings.html.markdown | 41 ++- .../cdktf/typescript/d/slug.html.markdown | 28 +- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +- .../cdktf/typescript/d/team.html.markdown | 21 +- .../typescript/d/team_access.html.markdown | 23 +- .../d/team_project_access.html.markdown | 21 +- .../cdktf/typescript/d/teams.html.markdown | 21 +- .../typescript/d/variable_set.html.markdown | 21 +- .../typescript/d/variables.html.markdown | 79 +++-- .../typescript/d/workspace.html.markdown | 23 +- .../typescript/d/workspace_ids.html.markdown | 29 +- .../d/workspace_run_task.html.markdown | 21 +- .../docs/cdktf/typescript/index.html.markdown | 67 ++-- .../r/admin_organization_settings.markdown | 73 +++-- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 78 +++-- .../typescript/r/agent_token.html.markdown | 49 ++- .../typescript/r/no_code_module.html.markdown | 140 ++++---- .../notification_configuration.html.markdown | 224 ++++++------- .../typescript/r/oauth_client.html.markdown | 75 +++-- .../typescript/r/opa_version.html.markdown | 21 +- .../typescript/r/organization.html.markdown | 23 +- ...rganization_default_settings.html.markdown | 67 ++-- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 23 +- .../r/organization_run_task.html.markdown | 21 +- .../r/organization_token.html.markdown | 51 ++- .../cdktf/typescript/r/policy.html.markdown | 44 +-- .../typescript/r/policy_set.html.markdown | 124 +++++--- .../r/policy_set_parameter.html.markdown | 48 +-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 60 ++-- .../r/project_variable_set.html.markdown | 60 ++-- .../r/registry_gpg_key.html.markdown | 24 +- .../r/registry_module.html.markdown | 300 ++++++++---------- .../r/registry_provider.html.markdown | 84 +++-- .../typescript/r/run_trigger.html.markdown | 63 ++-- .../typescript/r/saml_settings.html.markdown | 38 ++- .../r/sentinel_policy.html.markdown | 25 +- .../r/sentinel_version.html.markdown | 21 +- .../cdktf/typescript/r/ssh_key.html.markdown | 21 +- .../cdktf/typescript/r/team.html.markdown | 40 ++- .../typescript/r/team_access.html.markdown | 33 +- .../typescript/r/team_member.html.markdown | 26 +- .../typescript/r/team_members.html.markdown | 68 ++-- .../r/team_organization_member.html.markdown | 47 +-- .../r/team_organization_members.html.markdown | 115 +++---- .../r/team_project_access.html.markdown | 67 ++-- .../typescript/r/team_token.html.markdown | 56 ++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 +++++---- .../typescript/r/variable_set.html.markdown | 165 +++++----- .../typescript/r/workspace.html.markdown | 81 ++--- .../r/workspace_policy_set.html.markdown | 53 ++-- ...rkspace_policy_set_exclusion.html.markdown | 61 ++-- .../typescript/r/workspace_run.html.markdown | 192 +++++------ .../r/workspace_run_task.html.markdown | 28 +- .../typescript/r/workspace_settings.markdown | 156 +++++---- .../r/workspace_variable_set.html.markdown | 57 ++-- 154 files changed, 4105 insertions(+), 3219 deletions(-) diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 7293e009c..df964f4cc 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", + DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 30c40a42b..2d5ab9fd9 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", installation_id=12345678 ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding a Github App Installation by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + DataTfeGithubAppInstallation(self, "gha_installation", name="github_username_or_organization" ) ``` @@ -60,4 +66,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index d51c305d5..545b0540a 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,17 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") - cdktf.TerraformOutput(self, "notifications_ips", - value=data_tfe_ip_ranges_addresses.notifications + addresses = DataTfeIpRanges(self, "addresses") + TerraformOutput(self, "notifications_ips", + value=addresses.notifications ) ``` @@ -42,4 +45,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/no_code_module.html.markdown b/website/docs/cdktf/python/d/no_code_module.html.markdown index 72ccc9fb9..76a3c8037 100644 --- a/website/docs/cdktf/python/d/no_code_module.html.markdown +++ b/website/docs/cdktf/python/d/no_code_module.html.markdown @@ -13,15 +13,28 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```hcl -resource "tfe_no_code_module" "foobar" { - organization = tfe_organization.foobar.id - registry_module = tfe_registry_module.foobar.id -} - -data "tfe_no_code_module" "foobar" { - id = tfe_no_code_module.foobar.id -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_no_code_module import DataTfeNoCodeModule +from imports.tfe.no_code_module import NoCodeModule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foobar = NoCodeModule(self, "foobar", + organization=Token.as_string(tfe_organization_foobar.id), + registry_module=Token.as_string(tfe_registry_module_foobar.id) + ) + data_tfe_no_code_module_foobar = DataTfeNoCodeModule(self, "foobar_1", + id=foobar.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_tfe_no_code_module_foobar.override_logical_id("foobar") ``` ## Argument Reference @@ -39,4 +52,4 @@ The following arguments are supported: * `version_pin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 4aec1ba13..79b1e70ef 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its name ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -49,15 +55,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Finding an OAuth client by its service provider ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", + DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -93,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 41cb64aea..e28ac7661 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization import DataTfeOrganization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization.DataTfeOrganization(self, "foo", + DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -46,4 +49,4 @@ In addition to all arguments above, the following attributes are exported: * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index 73670ef47..d27f10272 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_bar = tfe.organization.Organization(self, "bar", + bar = Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", - organization=cdktf.Token.as_string(tfe_organization_bar.name) + DataTfeOrganizationMembers(self, "foo", + organization=bar.name ) ``` @@ -48,4 +52,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index cc1def6d2..5d34fc000 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,15 +22,18 @@ be updated manually. ### Fetch by email ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -39,15 +42,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by username ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -56,15 +62,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Fetch by organization membership ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", + DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -89,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index 8429aa128..f4057ee90 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", + DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -47,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 4fffc37f9..35e8ecf05 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", + DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -44,4 +47,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index 292e9c76f..40acebd22 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_organizations import DataTfeOrganizations +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") + DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -41,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 07a84479c..81fff84bc 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -20,20 +20,29 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: -```hcl -data "tfe_outputs" "foo" { - organization = "my-org" - workspace = "my-workspace" -} - -resource "random_id" "vpc_id" { - keepers = { - # Generate a new ID any time the value of 'bar' in workspace 'my-org/my-workspace' changes. - bar = data.tfe_outputs.foo.values.bar - } - - byte_length = 8 -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.random.id import Id +from imports.tfe.data_tfe_outputs import DataTfeOutputs +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = DataTfeOutputs(self, "foo", + organization="my-org", + workspace="my-workspace" + ) + Id(self, "vpc_id", + byte_length=8, + keepers={ + "bar": foo.values.bar + } + ) ``` ## Argument Reference @@ -50,4 +59,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 1a5e415fc..f07549b13 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_policy_set import DataTfePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", + DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -66,4 +69,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 4a596f35f..7d521d696 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_project import DataTfeProject +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_project.DataTfeProject(self, "foo", + DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown index 3c1958eca..a89adf1e9 100644 --- a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_registry_gpg_key import DataTfeRegistryGpgKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_registry_gpg_key.DataTfeRegistryGpgKey(self, "example", + DataTfeRegistryGpgKey(self, "example", id="13DFECCA3B58CE4A", organization="my-org-name" ) @@ -41,4 +44,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown index 381cfb0e9..3320a1c75 100644 --- a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_registry_gpg_keys import DataTfeRegistryGpgKeys +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_registry_gpg_keys.DataTfeRegistryGpgKeys(self, "all", + DataTfeRegistryGpgKeys(self, "all", organization="my-org-name" ) ``` @@ -42,4 +45,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_provider.html.markdown b/website/docs/cdktf/python/d/registry_provider.html.markdown index 1bc8c11a0..2fa766eb4 100644 --- a/website/docs/cdktf/python/d/registry_provider.html.markdown +++ b/website/docs/cdktf/python/d/registry_provider.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a public or private provider in th A private provider: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.registry_provider import RegistryProvider +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.registry_provider.RegistryProvider(self, "example", + RegistryProvider(self, "example", name="my-provider", organization="my-org-name" ) @@ -33,15 +36,18 @@ class MyConvertedCode(cdktf.TerraformStack): A public provider: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.registry_provider import RegistryProvider +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.registry_provider.RegistryProvider(self, "example", + RegistryProvider(self, "example", name="aws", namespace="hashicorp", organization="my-org-name", @@ -64,4 +70,4 @@ The following arguments are supported: * `created_at` - The time when the provider was created. * `updated_at` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_providers.html.markdown b/website/docs/cdktf/python/d/registry_providers.html.markdown index 03eec5f49..666812347 100644 --- a/website/docs/cdktf/python/d/registry_providers.html.markdown +++ b/website/docs/cdktf/python/d/registry_providers.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about public and private providers in th All providers: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "all", + DataTfeRegistryProviders(self, "all", organization="my-org-name" ) ``` @@ -32,15 +35,18 @@ class MyConvertedCode(cdktf.TerraformStack): All private providers: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "private", + DataTfeRegistryProviders(self, "private", organization="my-org-name", registry_name="private" ) @@ -49,15 +55,18 @@ class MyConvertedCode(cdktf.TerraformStack): Providers with "hashicorp" in their namespace or name: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "hashicorp", + DataTfeRegistryProviders(self, "hashicorp", organization="my-org-name", search="hashicorp" ) @@ -82,4 +91,4 @@ The following arguments are supported: * `created_at` - Time when the provider was created. * `updated_at` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index 338f92bfc..f103ca385 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,21 +16,31 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + DataTfeSamlSettings(self, "foo", + provider=admin + ) ``` ## Argument Reference @@ -64,4 +74,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 6537c5f55..c4f0c8a54 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", + test = DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=cdktf.Token.as_string_map(data_tfe_slug_test) + slug=Token.as_string_map(test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -47,4 +51,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index e95a873b6..d5d2e6bba 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_ssh_key import DataTfeSshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", + DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -41,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 3e4f2c5e4..620317566 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team import DataTfeTeam +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team.DataTfeTeam(self, "test", + DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index 9755cf929..d0e17f1f6 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_access import DataTfeTeamAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", + DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -52,4 +55,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index 503c9eb11..b6e18fa24 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", + DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index d812caa3c..6580fd5fb 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_teams import DataTfeTeams +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_teams.DataTfeTeams(self, "foo", + DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -39,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 3db389fb4..27fae8882 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -49,4 +52,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index 86ecde0ac..cd3625403 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,20 +16,24 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variables import DataTfeVariables +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + test = DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + workspace_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -38,21 +42,24 @@ class MyConvertedCode(cdktf.TerraformStack): For variable set variables: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_variable_set import DataTfeVariableSet +from imports.tfe.data_tfe_variables import DataTfeVariables +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_variable_set_test = - tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", + test = DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", - variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) + data_tfe_variables_test = DataTfeVariables(self, "test_1", + variable_set_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -80,4 +87,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index f58885718..a60c39267 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -85,4 +88,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index 31ac562e9..ca8b5f27a 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", + DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", + DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", + DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", + DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -61,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index a278338f7..84261df7d 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", + DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 5630e1b1b..ade17ce04 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,14 +73,13 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.53.0" - } - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) ``` As this provider is still at version zero, you should constrain the acceptable @@ -99,17 +98,27 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` - token = var.token - version = "~> 0.53.0" -} - -# Create an organization -resource "tfe_organization" "org" { - # ... -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, email, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + Organization(self, "org", + email=email, + name=name + ) ``` ## Argument Reference @@ -129,4 +138,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 4ecb2b61b..43e9e3b4e 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,39 +17,45 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" -} - -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.admin_organization_settings import AdminOrganizationSettings +from imports.tfe.organization import Organization +from imports.tfe.provider import TfeProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=token.string_value + ) + admin = TfeProvider(self, "tfe_1", + alias="admin", + hostname=hostname.string_value, + token=admin_token.string_value + ) + a_module_consumer = Organization(self, "a-module-consumer", + email="admin@company.com", + name="my-other-org" + ) + a_module_producer = Organization(self, "a-module-producer", + email="admin@company.com", + name="my-org" + ) + AdminOrganizationSettings(self, "test-settings", + access_beta_tools=False, + global_module_sharing=False, + module_sharing_consumer_organizations=[a_module_consumer.name], + organization=a_module_producer.name, + provider="${tfe.admin}", + workspace_limit=15 + ) ``` ## Argument Reference @@ -66,4 +72,4 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index 7f5d6afd1..f0997789c 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,21 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.agent_pool.AgentPool(self, "test-agent-pool", + AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, organization_scoped=True ) ``` @@ -63,4 +67,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index b122ffaf7..b3908db0f 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -19,37 +19,45 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -// Ensure workspace and agent pool are create first -resource "tfe_workspace" "test-workspace" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = false -} - -// Ensure permissions are assigned second -resource "tfe_agent_pool_allowed_workspaces" "allowed" { - agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] -} - -// Lastly, ensure the workspace agent execution is assigned last by -// referencing allowed_workspaces -resource "tfe_workspace_settings" "test-workspace-settings" { - workspace_id = tfe_workspace.test-workspace.id - execution_mode = "agent" - agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test_organization = Organization(self, "test-organization", + email="admin@company.com", + name="my-org-name" + ) + test_workspace = Workspace(self, "test-workspace", + name="my-workspace-name", + organization=test_organization.name + ) + test_agent_pool = AgentPool(self, "test-agent-pool", + name="my-agent-pool-name", + organization=test_organization.name, + organization_scoped=False + ) + allowed = AgentPoolAllowedWorkspaces(self, "allowed", + agent_pool_id=test_agent_pool.id, + allowed_workspace_ids=Token.as_list("${[ for key, value in ${" + + Fn.lookup_nested(test, ["*", "id"]) + "} : value]}") + ) + WorkspaceSettings(self, "test-workspace-settings", + agent_pool_id=allowed.id, + execution_mode="agent", + workspace_id=test_workspace.id + ) ``` ## Argument Reference @@ -68,4 +76,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 7cc7972c4..0a6b17a56 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,24 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_token import AgentToken +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.agent_token.AgentToken(self, "test-agent-token", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + AgentToken(self, "test-agent-token", + agent_pool_id=test_agent_pool.id, description="my-agent-token-name" ) ``` @@ -52,4 +57,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index 797abcd7c..a35a6503c 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,28 +16,33 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -46,28 +51,33 @@ class MyConvertedCode(cdktf.TerraformStack): Creating a no-code module with variable options: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_foobar = tfe.organization.Organization(self, "foobar", + foobar = Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=cdktf.Token.as_string(tfe_organization_foobar.id) + organization=foobar.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", - organization=cdktf.Token.as_string(tfe_organization_foobar.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", + organization=foobar.id, + registry_module=Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -109,4 +119,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index d84e282c3..d6e1694af 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,32 +19,36 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -53,41 +57,43 @@ class MyConvertedCode(cdktf.TerraformStack): With `destination_type` of `email`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -96,43 +102,45 @@ class MyConvertedCode(cdktf.TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.notification_configuration import NotificationConfiguration +from imports.tfe.organization import Organization +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test_1", + tfe_organization_membership_test = OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = - tfe.notification_configuration.NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.user_id) - ], + email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -180,4 +188,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index f739902ae..a0d2139ef 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -44,15 +47,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -71,15 +77,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.oauth_client.OauthClient(self, "test", + OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -121,4 +130,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opa_version.html.markdown b/website/docs/cdktf/python/r/opa_version.html.markdown index 82787ff8a..a6beba2e4 100644 --- a/website/docs/cdktf/python/r/opa_version.html.markdown +++ b/website/docs/cdktf/python/r/opa_version.html.markdown @@ -16,15 +16,18 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.opa_version import OpaVersion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.opa_version.OpaVersion(self, "test", + OpaVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/opa", version="0.58.0-custom" @@ -62,4 +65,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index 4d983a3d8..babd13d88 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization.Organization(self, "test", + Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -62,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown index 5e64a6c1b..b96435924 100644 --- a/website/docs/cdktf/python/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -16,30 +16,35 @@ Primarily, this is used to set the default execution mode of an organization. Se Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.organization import Organization +from imports.tfe.organization_default_settings import OrganizationDefaultSettings +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_my_agents = tfe.agent_pool.AgentPool(self, "my_agents", + my_agents = AgentPool(self, "my_agents", name="agent_smiths", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) - tfe_organization_default_settings_org_default = - tfe.organization_default_settings.OrganizationDefaultSettings(self, "org_default", - default_agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_my_agents.id), + org_default = OrganizationDefaultSettings(self, "org_default", + default_agent_pool_id=my_agents.id, default_execution_mode="agent", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) - tfe.workspace.Workspace(self, "my_workspace", - depends_on=[tfe_organization_default_settings_org_default], + Workspace(self, "my_workspace", + depends_on=[org_default], name="my-workspace" ) ``` @@ -62,4 +67,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 1582dadb2..93f7c20b1 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_membership.OrganizationMembership(self, "test", + OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -66,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 492a62139..5e606ea7c 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,15 +19,18 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_module_sharing import OrganizationModuleSharing +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", + OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -40,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 535677464..0f562bca2 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_run_task import OrganizationRunTask +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_run_task.OrganizationRunTask(self, "example", + OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -60,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 66f833f7b..02e9544c7 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_token import OrganizationToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.organization_token.OrganizationToken(self, "test", + OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -46,15 +49,28 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 -} - -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization_token import OrganizationToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + # For a more precise conversion please use the --provider flag in convert. + example = Rotating(self, "example", + rotation_days=30 + ) + OrganizationToken(self, "test", + expired_at=Token.as_string(example.rotation_rfc3339), + organization=Token.as_string(org.name) + ) ``` ## Attributes Reference @@ -71,4 +87,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 5da71d87c..3e794c4d2 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -42,15 +45,18 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.policy import Policy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.policy.Policy(self, "test", + Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -91,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 3bb9ac5db..83e93767f 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,58 +21,89 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - agent_enabled = "true" - policy_tool_version = "0.24.1" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id - } -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + agent_enabled=Token.as_boolean("true"), + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policies_path="policies/my-policy-set", + policy_tool_version="0.24.1", + vcs_repo=PolicySetVcsRepo( + branch="main", + identifier="my-org-name/my-policy-set-repository", + ingress_submodules=False, + oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) + ), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - agent_enabled = "true" - policy_tool_version = "0.24.1" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + PolicySet(self, "test", + agent_enabled=Token.as_boolean("true"), + description="A brand new policy set", + kind="sentinel", + name="my-policy-set", + organization="my-org-name", + policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], + policy_tool_version="0.24.1", + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" -} - -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.data_tfe_slug import DataTfeSlug +from imports.tfe.policy_set import PolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataTfeSlug(self, "test", + source_path="policies/my-policy-set" + ) + tfe_policy_set_test = PolicySet(self, "test_1", + description="A brand new policy set", + name="my-policy-set", + organization="my-org-name", + slug=Token.as_string_map(test), + workspace_ids=[Token.as_string(tfe_workspace_test.id)] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_policy_set_test.override_logical_id("test") ``` ## Argument Reference @@ -135,4 +166,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 9758004e6..5904442c7 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,28 +16,32 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.policy_set_parameter import PolicySetParameter +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", name="my-policy-set-name", - organization=cdktf.Token.as_string(tfe_organization_test.id) + organization=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = - tfe.policy_set_parameter.PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + policy_set_id=Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -69,4 +73,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 0763e2626..106e20258 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,21 +16,25 @@ Provides a project resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.project.Project(self, "test", + Project(self, "test", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) ``` @@ -55,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index fda2dad7a..85ad3e390 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -15,27 +15,44 @@ Adds and removes policy sets from a project Basic usage: -```hcl -resource "tfe_organization" "test" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_project" "test" { - name = "my-project-name" - organization = tfe_organization.test.name -} - -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "Some description." - organization = tfe_organization.test.name -} - -resource "tfe_project_policy_set" "test" { - policy_set_id = tfe_policy_set.test.id - project_id = tfe_project.test.id -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.project import Project +from imports.tfe.project_policy_set import ProjectPolicySet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_policy_set_test = PolicySet(self, "test_1", + description="Some description.", + name="my-policy-set", + organization=test.name + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_policy_set_test.override_logical_id("test") + tfe_project_test = Project(self, "test_2", + name="my-project-name", + organization=test.name + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_project_test.override_logical_id("test") + tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + project_id=Token.as_string(tfe_project_test.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_project_policy_set_test.override_logical_id("test") ``` ## Argument Reference @@ -57,4 +74,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index da5561bc7..648c90db8 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,35 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="my-project-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_3", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -69,4 +74,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown index 256e03929..e087f01bb 100644 --- a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -16,11 +16,22 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```hcl -resource "tfe_registry_gpg_key" "example" { - organization = "my-org-name" - ascii_armor = file("my-public-key.asc") -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.registry_gpg_key import RegistryGpgKey +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + RegistryGpgKey(self, "example", + ascii_armor=Token.as_string(Fn.file("my-public-key.asc")), + organization="my-org-name" + ) ``` ## Argument Reference @@ -45,4 +56,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 91e05ab11..9aadf00f2 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,30 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", + test_oauth_client = OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, service_provider="github" ) - tfe.registry_module.RegistryModule(self, "test-registry-module", + RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) + oauth_token_id=test_oauth_client.oauth_token_id ) ) ``` @@ -47,26 +52,31 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module with tests enabled: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", + test_oauth_client = OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, service_provider="github" ) - tfe.registry_module.RegistryModule(self, "test-registry-module", + RegistryModule(self, "test-registry-module", test_config=[RegistryModuleTestConfig( tests_enabled=True ) @@ -75,7 +85,7 @@ class MyConvertedCode(cdktf.TerraformStack): branch="main", display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) + oauth_token_id=test_oauth_client.oauth_token_id ) ) ``` @@ -83,27 +93,31 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module with GitHub App: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - data_tfe_github_app_installation_gha_installation = - tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - tfe.registry_module.RegistryModule(self, "petstore", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + RegistryModule(self, "petstore", + organization=test_organization.name, vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), + github_app_installation_id=Token.as_string(gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -112,22 +126,26 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module without VCS: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-private-registry-module", + RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="private" ) ``` @@ -135,23 +153,27 @@ class MyConvertedCode(cdktf.TerraformStack): Create public registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.registry_module.RegistryModule(self, "test-public-registry-module", + RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) ``` @@ -159,29 +181,33 @@ class MyConvertedCode(cdktf.TerraformStack): Create no-code provisioning registry module: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.no_code_module import NoCodeModule +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_test_no_code_provisioning_registry_module = - tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", + test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, registry_name="public" ) - tfe.no_code_module.NoCodeModule(self, "foobar", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id), - registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) + NoCodeModule(self, "foobar", + organization=test_organization.id, + registry_module=test_no_code_provisioning_registry_module.id ) ``` @@ -239,4 +265,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_provider.html.markdown b/website/docs/cdktf/python/r/registry_provider.html.markdown index 4090c9498..d53e4fb92 100644 --- a/website/docs/cdktf/python/r/registry_provider.html.markdown +++ b/website/docs/cdktf/python/r/registry_provider.html.markdown @@ -16,22 +16,25 @@ Manages public and private providers in the private registry. Create private provider: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_provider import RegistryProvider +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_example = tfe.organization.Organization(self, "example", + example = Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = - tfe.registry_provider.RegistryProvider(self, "example_1", + tfe_registry_provider_example = RegistryProvider(self, "example_1", name="my-provider", - organization=cdktf.Token.as_string(tfe_organization_example.name) + organization=example.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_provider_example.override_logical_id("example") @@ -40,23 +43,26 @@ class MyConvertedCode(cdktf.TerraformStack): Create public provider: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.registry_provider import RegistryProvider +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_example = tfe.organization.Organization(self, "example", + example = Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = - tfe.registry_provider.RegistryProvider(self, "example_1", + tfe_registry_provider_example = RegistryProvider(self, "example_1", name="aws", namespace="hashicorp", - organization=cdktf.Token.as_string(tfe_organization_example.name), + organization=example.name, registry_name="public" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -94,4 +100,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index f4dd3b56c..1ef9fc6f8 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,29 +19,34 @@ to up to 20 source workspaces. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.run_trigger import RunTrigger +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", + test_sourceable = Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", + test_workspace = Workspace(self, "test-workspace", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.id) + organization=test_organization.id ) - tfe.run_trigger.RunTrigger(self, "test", - sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) + RunTrigger(self, "test", + sourceable_id=test_sourceable.id, + workspace_id=test_workspace.id ) ``` @@ -65,4 +70,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index 0fa49386c..3842ee3c9 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,17 +15,28 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.provider import TfeProvider +from imports.tfe.saml_settings import SamlSettings +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TfeProvider(self, "tfe", + hostname=hostname.string_value, + token=admin_token.string_value + ) + SamlSettings(self, "this", + idp_cert="foobarCertificate", + slo_endpoint_url="https://example.com/slo_endpoint_url", + sso_endpoint_url="https://example.com/sso_endpoint_url" + ) ``` ## Argument Reference @@ -64,4 +75,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index 73d0ed16c..39b7518af 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.sentinel_policy import SentinelPolicy +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.sentinel_policy.SentinelPolicy(self, "test", + SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_version.html.markdown b/website/docs/cdktf/python/r/sentinel_version.html.markdown index c94cc8b4d..f1cf14543 100644 --- a/website/docs/cdktf/python/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_version.html.markdown @@ -16,15 +16,18 @@ Manage Sentinel versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.sentinel_version import SentinelVersion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.sentinel_version.SentinelVersion(self, "test", + SentinelVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/sentinel.zip", version="0.24.0-custom" @@ -62,4 +65,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 177974c7f..777ce33f4 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.ssh_key import SshKey +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.ssh_key.SshKey(self, "test", + SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -49,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index bec6f6a88..8986aeff9 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -33,15 +36,18 @@ class MyConvertedCode(cdktf.TerraformStack): Organization Permission usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.team.Team(self, "test", + Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -91,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index ab50b1a2d..a52e519f8 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_access import TeamAccess +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", + tfe_team_access_test = TeamAccess(self, "test_2", access="read", - team_id=cdktf.Token.as_string(tfe_team_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + team_id=test.id, + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -77,4 +82,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index e146c6558..e0e91ab64 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_member import TeamMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_member_test = TeamMember(self, "test_1", + team_id=test.id, username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -61,4 +65,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 7f8e1ac35..405b4b098 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id), + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -47,23 +51,30 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of usernames: -```hcl -locals { - all_usernames = toset([ - "user1", - "user2", - ]) -} - -resource "tfe_team" "test" { - name = "my-team-name" - organization = "my-org-name" -} - -resource "tfe_team_members" "test" { - team_id = tfe_team.test.id - usernames = [for user in local.all_usernames : user] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.team import Team +from imports.tfe.team_members import TeamMembers +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + all_usernames = Fn.toset(["user1", "user2"]) + test = Team(self, "test", + name="my-team-name", + organization="my-org-name" + ) + tfe_team_members_test = TeamMembers(self, "test_1", + team_id=test.id, + usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_team_members_test.override_logical_id("test") ``` ## Argument Reference @@ -85,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 5353364f6..048cfa5d9 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,29 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_member import TeamOrganizationMember +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_1", + tfe_team_test = Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = - tfe.team_organization_member.TeamOrganizationMember(self, "test_2", - organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", + organization_membership_id=test.id, + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -72,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 04ced9cca..7895bcf61 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,37 +24,36 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_membership_sample = - tfe.organization_membership.OrganizationMembership(self, "sample", + sample = OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - tfe_organization_membership_test = - tfe.organization_membership.OrganizationMembership(self, "test", + test = OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = tfe.team.Team(self, "test_2", + tfe_team_test = Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[ - cdktf.Token.as_string(tfe_organization_membership_test.id), - cdktf.Token.as_string(tfe_organization_membership_sample.id) - ], - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[test.id, sample.id], + team_id=Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -63,35 +62,38 @@ class MyConvertedCode(cdktf.TerraformStack): With a set of organization members: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization_membership import OrganizationMembership +from imports.tfe.team import Team +from imports.tfe.team_organization_members import TeamOrganizationMembers +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" - ]) + all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - tfe_organization_membership_all_membership_for_each_iterator = - cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) - tfe.organization_membership.OrganizationMembership(self, "all_membership", - email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), + all_membership_for_each_iterator = TerraformIterator.from_list( + Token.as_any(all_users)) + OrganizationMembership(self, "all_membership", + email=Token.as_string(all_membership_for_each_iterator.key), organization="my-org-name", - for_each=tfe_organization_membership_all_membership_for_each_iterator + for_each=all_membership_for_each_iterator ) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = - tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", - organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", + organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -113,4 +115,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 826b49805..6a9a2b5c2 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,27 +16,31 @@ Associate a team to permissions on a project. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_admin = tfe.team.Team(self, "admin", + admin = Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = - tfe.team_project_access.TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", access="admin", - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_admin.id) + project_id=test.id, + team_id=admin.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -84,31 +88,36 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.project import Project +from imports.tfe.team import Team +from imports.tfe.team_project_access import TeamProjectAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", + test = Project(self, "test", name="myproject", organization="my-org-name" ) - tfe_team_dev = tfe.team.Team(self, "dev", + dev = Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - tfe.team_project_access.TeamProjectAccess(self, "custom", + TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_dev.id), + project_id=test.id, + team_id=dev.id, workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -137,4 +146,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index 81354724f..d3a7c2688 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_team_test = tfe.team.Team(self, "test", + test = Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", - team_id=cdktf.Token.as_string(tfe_team_test.id) + tfe_team_token_test = TeamToken(self, "test_1", + team_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -51,20 +55,35 @@ never expire. When a token has an expiry: -```hcl -resource "tfe_team" "test" { - name = "my-team-name" - organization = "my-org-name" -} - -resource "time_rotating" "example" { - rotation_days = 30 -} - -resource "tfe_team_token" "test" { - team_id = tfe_team.test.id - expired_at = time_rotating.example.rotation_rfc3339 -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.team import Team +from imports.tfe.team_token import TeamToken +from imports.time.rotating import Rotating +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + # For a more precise conversion please use the --provider flag in convert. + test = Team(self, "test", + name="my-team-name", + organization="my-org-name" + ) + example = Rotating(self, "example", + rotation_days=30 + ) + tfe_team_token_test = TeamToken(self, "test_2", + expired_at=Token.as_string(example.rotation_rfc3339), + team_id=test.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_team_token_test.override_logical_id("test") ``` ## Attributes Reference @@ -80,4 +99,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 5d19d8f3e..010e15457 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.terraform_version import TerraformVersion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.terraform_version.TerraformVersion(self, "test", + TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -62,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index a32fa5e33..a606daed4 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,30 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", + tfe_workspace_test = Workspace(self, "test_1", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = tfe.variable.Variable(self, "test_2", + tfe_variable_test = Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -48,39 +53,44 @@ class MyConvertedCode(cdktf.TerraformStack): Basic usage for variable sets: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -119,33 +129,41 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" -} - +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.variable import Variable +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + sensitive_var = Variable(self, "sensitive_var", + category="terraform", + key="sensitive_key", + sensitive=True, + value="sensitive_value", + workspace_id=workspace.id + ) + visible_var = Variable(self, "visible_var", + category="terraform", + key="visible_key", + sensitive=False, + value="visible_value", + workspace_id=workspace.id + ) + Workspace(self, "sensitive_workspace", + name="workspace-${" + sensitive_var.value + "}", + organization="organization name" + ) + Workspace(self, "visible_workspace", + name="workspace-${" + visible_var.readable_value + "}", + organization="organization name" + ) ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -171,4 +189,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index 524373524..f5e16a6bd 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,142 +16,159 @@ Creates, updates and destroys variable sets. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_variable_set import ProjectVariableSet +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = tfe.project.Project(self, "test_1", + tfe_project_test = Project(self, "test_1", name="projectname", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", + tfe_variable_set_test = VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", + tfe_workspace_test = Workspace(self, "test_3", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = - tfe.project_variable_set.ProjectVariableSet(self, "test_5", - project_id=cdktf.Token.as_string(tfe_project_test.id), - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", + project_id=Token.as_string(tfe_project_test.id), + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` Create a priority variable set: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable import Variable +from imports.tfe.variable_set import VariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Variable set applied to all workspaces.", name="Global Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name), + organization=test.name, priority=True ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe.variable.Variable(self, "test-a", + Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) - tfe.variable.Variable(self, "test-b", + Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + variable_set_id=Token.as_string(tfe_variable_set_test.id) ) ``` @@ -181,4 +198,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 606d02e9b..99f3ba59a 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -20,21 +20,25 @@ Provides a workspace resource. Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe.workspace.Workspace(self, "test", + Workspace(self, "test", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), + organization=test_organization.name, tag_names=["test", "app"] ) ``` @@ -42,33 +46,38 @@ class MyConvertedCode(cdktf.TerraformStack): Usage with vcs_repo: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe.workspace.Workspace(self, "parent", + Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) ``` @@ -182,4 +191,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 733784218..bbf800503 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set import WorkspacePolicySet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = - tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index 5f052b546..ab821e937 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,35 +18,40 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.policy_set import PolicySet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", + tfe_policy_set_test = PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = - tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=Token.as_string(tfe_policy_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -71,4 +76,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index e79741bc7..200047332 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,46 +24,52 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_child = tfe.workspace.Workspace(self, "child", + child = Workspace(self, "child", name="child-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + ws_run_parent = WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -76,58 +82,64 @@ class MyConvertedCode(cdktf.TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_child", + WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[tfe_workspace_run_ws_run_parent], + depends_on=[ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) + workspace_id=child.id ) ``` With manual confirmation: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -135,43 +147,49 @@ class MyConvertedCode(cdktf.TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` With no retries: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_run import WorkspaceRun +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + test = OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test_organization, + organization=test_organization, service_provider="github" ) - tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", + parent = Workspace(self, "parent", name="parent-ws", - organization=tfe_organization_test_organization, + organization=test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + oauth_token_id=test.oauth_token_id ) ) - tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", + WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -181,7 +199,7 @@ class MyConvertedCode(cdktf.TerraformStack): retry=False, wait_for_run=True ), - workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) + workspace_id=parent.id ) ``` @@ -210,4 +228,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 450d01813..b27948513 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,12 +17,23 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.tfe.workspace_run_task import WorkspaceRunTask +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + WorkspaceRunTask(self, "example", + enforcement_level="advisory", + task_id=tfe_organization_run_task.example.id, + workspace_id=tfe_workspace.example.id + ) ``` ## Argument Reference @@ -47,4 +58,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index b2982ff8d..3825237d4 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -16,91 +16,105 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test", + test = Workspace(self, "test", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe.workspace_settings.WorkspaceSettings(self, "test-settings", + WorkspaceSettings(self, "test-settings", execution_mode="local", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=test.id ) ``` With `execution_mode` of `agent`: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.agent_pool import AgentPool +from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", + test_organization = Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = tfe.workspace.Workspace(self, "test", + test = Workspace(self, "test", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + test_agent_pool = AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name ) - tfe_agent_pool_allowed_workspaces_test = - tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test_3", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), - allowed_workspace_ids=[cdktf.Token.as_string(tfe_workspace_test.id)] + tfe_agent_pool_allowed_workspaces_test = AgentPoolAllowedWorkspaces(self, "test_3", + agent_pool_id=test_agent_pool.id, + allowed_workspace_ids=[test.id] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_agent_pool_allowed_workspaces_test.override_logical_id("test") - tfe.workspace_settings.WorkspaceSettings(self, "test-settings", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), + WorkspaceSettings(self, "test-settings", + agent_pool_id=Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), execution_mode="agent", - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + workspace_id=test.id ) ``` This resource may be used as a data source when no optional arguments are defined: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformOutput, Op, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.data_tfe_workspace import DataTfeWorkspace +from imports.tfe.workspace_settings import WorkspaceSettings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", + test = DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - tfe_workspace_settings_test = - tfe.workspace_settings.WorkspaceSettings(self, "test_1", - workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) + tfe_workspace_settings_test = WorkspaceSettings(self, "test_1", + workspace_id=Token.as_string(test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_settings_test.override_logical_id("test") - cdktf.TerraformOutput(self, "workspace-explicit-local-execution", - value=cdktf.Fn.alltrue( - cdktf.Token.as_any([ - cdktf.Op.eq(tfe_workspace_settings_test.execution_mode, "local"), - cdktf.property_access(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" + TerraformOutput(self, "workspace-explicit-local-execution", + value=Fn.alltrue( + Token.as_any([ + Op.eq(tfe_workspace_settings_test.execution_mode, "local"), + Fn.lookup_nested(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" ]) ])) ) @@ -138,4 +152,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index de6cad570..0d3f249f3 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,35 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.tfe.organization import Organization +from imports.tfe.variable_set import VariableSet +from imports.tfe.workspace import Workspace +from imports.tfe.workspace_variable_set import WorkspaceVariableSet +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_test = tfe.organization.Organization(self, "test", + test = Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + tfe_variable_set_test = VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", + tfe_workspace_test = Workspace(self, "test_2", name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test.name) + organization=test.name ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = - tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", - variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), - workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", + variable_set_id=Token.as_string(tfe_variable_set_test.id), + workspace_id=Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -71,4 +76,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index ffbc8593d..679a0d95e 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { + new DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 7aefb2d43..de4de22b5 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,21 +16,20 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - installationId: 12345678, - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + installationId: 12345678, + }); } } @@ -39,21 +38,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding a Github App Installation by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "github_username_or_organization", - } - ); + new DataTfeGithubAppInstallation(this, "gha_installation", { + name: "github_username_or_organization", + }); } } @@ -63,7 +61,7 @@ class MyConvertedCode extends cdktf.TerraformStack { The following arguments are supported. At least one of `name`, `installationId` must be set. -* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://githubCom/settings/installations/12345678`. +* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. * `name` - (Optional) Name of the Github user or organization account that installed the app. Must be one of: `installationId` or `name`. @@ -74,4 +72,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 3aef65fe1..93428bb23 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,21 +14,20 @@ Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( - this, - "addresses", - {} - ); - new cdktf.TerraformOutput(this, "notifications_ips", { - value: dataTfeIpRangesAddresses.notifications, + const addresses = new DataTfeIpRanges(this, "addresses", {}); + new TerraformOutput(this, "notifications_ips", { + value: addresses.notifications, }); } } @@ -49,4 +48,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/no_code_module.html.markdown b/website/docs/cdktf/typescript/d/no_code_module.html.markdown index e8a11ff3b..e680d7bd9 100644 --- a/website/docs/cdktf/typescript/d/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/d/no_code_module.html.markdown @@ -13,15 +13,35 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```hcl -resource "tfe_no_code_module" "foobar" { - organization = tfe_organization.foobar.id - registry_module = tfe_registry_module.foobar.id +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeNoCodeModule } from "./.gen/providers/tfe/data-tfe-no-code-module"; +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foobar = new NoCodeModule(this, "foobar", { + organization: Token.asString(tfeOrganizationFoobar.id), + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + }); + const dataTfeNoCodeModuleFoobar = new DataTfeNoCodeModule( + this, + "foobar_1", + { + id: foobar.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataTfeNoCodeModuleFoobar.overrideLogicalId("foobar"); + } } -data "tfe_no_code_module" "foobar" { - id = tfe_no_code_module.foobar.id -} ``` ## Argument Reference @@ -39,4 +59,4 @@ The following arguments are supported: * `versionPin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index fd3cee123..30064e5c7 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -35,15 +38,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its name ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -55,15 +61,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Finding an OAuth client by its service provider ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { + new DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -83,9 +92,9 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, - `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or - `gitlabEnterpriseEdition`. + must be one of: `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, + `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or + `gitlab_enterprise_edition`. ## Attributes Reference @@ -102,4 +111,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 2ceb1b703..7f2b0b3fc 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { + new DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -42,11 +45,11 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. -* `collaboratorAuthPolicy` - Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. +* `collaboratorAuthPolicy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index 290c8836c..bc6075dcf 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,20 +14,24 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { + const bar = new Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { - organization: cdktf.Token.asString(tfeOrganizationBar.name), + new DataTfeOrganizationMembers(this, "foo", { + organization: bar.name, }); } } @@ -51,4 +55,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index a5a620a28..1f6b95439 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,22 +22,21 @@ be updated manually. ### Fetch by email ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - email: "user@company.com", - organization: "my-org-name", - } - ); + new DataTfeOrganizationMembership(this, "test", { + email: "user@company.com", + organization: "my-org-name", + }); } } @@ -46,22 +45,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by username ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - username: "my-username", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + username: "my-username", + }); } } @@ -70,22 +68,21 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Fetch by organization membership ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( - this, - "test", - { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - } - ); + new DataTfeOrganizationMembership(this, "test", { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + }); } } @@ -110,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index 1ee342ef1..eb3ef17ab 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,22 +16,21 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( - this, - "example", - { - name: "task-name", - organization: "my-org-name", - } - ); + new DataTfeOrganizationRunTask(this, "example", { + name: "task-name", + organization: "my-org-name", + }); } } @@ -54,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index d608cc1e3..fa7618293 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { + new DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -46,5 +49,5 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag -* `workspaceCount` - The number of workspaces the tag is associate with - \ No newline at end of file +* `workspace_count` - The number of workspaces the tag is associate with + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 31989059d..82fbe35c5 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); + new DataTfeOrganizations(this, "foo", {}); } } @@ -44,4 +47,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 9b23d1a90..2586d6d5f 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -16,37 +16,32 @@ that are known to be non-sensitive. ## Example Usage -Using the `tfeOutputs` data source, the outputs `foo` and `bar` can be used as seen below: +Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as seen below: -In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: +In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as random from "./.gen/providers/random"; -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Id } from "./.gen/providers/random/id"; +import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. - For a more precise conversion please use the --provider flag in convert.*/ - const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( - this, - "foo", - { - organization: "my-org", - workspace: "my-workspace", - } - ); - new random.id.Id(this, "vpc_id", { - byte_length: 8, - keepers: [ - { - bar: dataTfeOutputsFoo.values.bar, - }, - ], + const foo = new DataTfeOutputs(this, "foo", { + organization: "my-org", + workspace: "my-workspace", + }); + new Id(this, "vpc_id", { + byteLength: 8, + keepers: { + bar: foo.values.bar, + }, }); } } @@ -67,4 +62,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 85028b02e..519edc03a 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { + new DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -69,4 +72,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index 5f30b68c5..a6059773f 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeProject.DataTfeProject(this, "foo", { + new DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown index 265d57fbc..f85d500f4 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/data-tfe-registry-gpg-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeRegistryGpgKey.DataTfeRegistryGpgKey(this, "example", { + new DataTfeRegistryGpgKey(this, "example", { id: "13DFECCA3B58CE4A", organization: "my-org-name", }); @@ -44,4 +47,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown index 83d0e0d82..67edda778 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/data-tfe-registry-gpg-keys"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeRegistryGpgKeys.DataTfeRegistryGpgKeys(this, "all", { + new DataTfeRegistryGpgKeys(this, "all", { organization: "my-org-name", }); } @@ -45,4 +48,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_provider.html.markdown b/website/docs/cdktf/typescript/d/registry_provider.html.markdown index d5bd8c2c2..42abcc627 100644 --- a/website/docs/cdktf/typescript/d/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_provider.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a public or private provider in th A private provider: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.registryProvider.RegistryProvider(this, "example", { + new RegistryProvider(this, "example", { name: "my-provider", organization: "my-org-name", }); @@ -36,15 +39,18 @@ class MyConvertedCode extends cdktf.TerraformStack { A public provider: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.registryProvider.RegistryProvider(this, "example", { + new RegistryProvider(this, "example", { name: "aws", namespace: "hashicorp", organization: "my-org-name", @@ -70,4 +76,4 @@ The following arguments are supported: * `createdAt` - The time when the provider was created. * `updatedAt` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_providers.html.markdown b/website/docs/cdktf/typescript/d/registry_providers.html.markdown index aaf6fb892..799f83f46 100644 --- a/website/docs/cdktf/typescript/d/registry_providers.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_providers.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about public and private providers in th All providers: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "all", { + new DataTfeRegistryProviders(this, "all", { organization: "my-org-name", }); } @@ -35,15 +38,18 @@ class MyConvertedCode extends cdktf.TerraformStack { All private providers: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "private", { + new DataTfeRegistryProviders(this, "private", { organization: "my-org-name", registryName: "private", }); @@ -55,22 +61,21 @@ class MyConvertedCode extends cdktf.TerraformStack { Providers with "hashicorp" in their namespace or name: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders( - this, - "hashicorp", - { - organization: "my-org-name", - search: "hashicorp", - } - ); + new DataTfeRegistryProviders(this, "hashicorp", { + organization: "my-org-name", + search: "hashicorp", + }); } } @@ -95,4 +100,4 @@ The following arguments are supported: * `createdAt` - Time when the provider was created. * `updatedAt` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index eac1110a0..0f2535cb1 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,21 +16,34 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new DataTfeSamlSettings(this, "foo", { + provider: admin, + }); + } } -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -data "tfe_saml_settings" "foo" { - provider = tfe.admin -} ``` ## Argument Reference @@ -64,4 +77,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index af7210b06..84a8bf12d 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -13,7 +13,7 @@ intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files be sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows -resources such as `tfePolicySet` track the files and upload a new gzip compressed +resources such as `tfe_policy_set` track the files and upload a new gzip compressed tar file containing configuration files (a Terraform "slug") when those files change. ## Example Usage @@ -21,21 +21,25 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { + const test = new DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: cdktf.Token.asStringMap(dataTfeSlugTest), + slug: Token.asStringMap(test), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -50,4 +54,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 0d701abdd..0a783fac4 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { + new DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -44,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 51606205e..95b80260f 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about a team. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeam.DataTfeTeam(this, "test", { + new DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index 8cd9aea95..e74140956 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { + new DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -50,9 +53,9 @@ The `permissions` block contains: * `runs` - The permission granted to runs. Valid values are `read`, `plan`, or `apply` * `variables` - The permissions granted to variables. Valid values are `none`, `read`, or `write` -* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `readOutputs`, `read`, or `write` +* `stateVersions` - The permissions granted to state versions. Valid values are `none`, `read-outputs`, `read`, or `write` * `sentinelMocks` - The permissions granted to Sentinel mocks. Valid values are `none` or `read` * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index 65ed3def9..b53b01c7b 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { + new DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index d19832163..a882c09e3 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,15 +14,18 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { + new DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -42,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index c5bab02a4..3ff81d38e 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,15 +16,18 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + new DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -52,4 +55,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 93b932f9d..09ecfabe9 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,29 +16,25 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( - this, - "test", - { - name: "my-workspace-name", - organization: "my-org-name", - } - ); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), - } - ); + const test = new DataTfeWorkspace(this, "test", { + name: "my-workspace-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + workspaceId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -49,26 +45,25 @@ class MyConvertedCode extends cdktf.TerraformStack { For variable set variables: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; +import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeVariableSetTest = - new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( - this, - "test_1", - { - variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), - } - ); + const test = new DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { + variableSetId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -98,4 +93,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 99a8e55a8..5a491e8d7 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { + new DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -73,7 +76,7 @@ In addition to all arguments above, the following attributes are exported: * `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. -* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfeWorkspaceSettings` resource](tfe_workspace_settings) for details. +* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. * `htmlUrl` - The URL to the browsable HTML overview of the workspace @@ -88,4 +91,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 3f83d01b9..31628da96 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,27 +14,30 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { + new DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { + new DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { + new DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { + new DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -52,7 +55,7 @@ The following arguments are supported. At least one of `names` or `tagNames` mus match a valid workspace will be omitted from the results, but are not an error. To select _all_ workspaces for an organization, provide a list with a single - asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*Prod]`, `[test-*]`, `[*dev*]`. + asterisk, like `["*"]`. The asterisk also supports partial matching on prefix and/or suffix, like `[*-prod]`, `[test-*]`, `[*dev*]`. * `tagNames` - (Optional) A list of tag names to search for. * `excludeTags` - (Optional) A list of tag names to exclude when searching. * `organization` - (Required) Name of the organization. @@ -64,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 7aa26820c..5d1a71a5b 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,15 +16,18 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { + new DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -48,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index f5fc97051..dae0514b7 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -43,8 +43,8 @@ There are several ways to provide the required token: - **Set the `token` argument in the provider configuration.** You can set the `token` argument in the provider configuration. Use an input variable for the token. -- **Set the `tfeToken` environment variable:** The provider can read the -`tfeToken` environment variable and the token stored there to authenticate. +- **Set the `TFE_TOKEN` environment variable:** The provider can read the +`TFE_TOKEN` environment variable and the token stored there to authenticate. When configuring the input variable for either of these options, mark them as sensitive. @@ -62,9 +62,9 @@ Terraform on your local command line, it can automatically discover the credenti [`terraform login`](https://developer.hashicorp.com/terraform/cli/commands/login). - **Set a `credentials` block in your CLI config file (.terraformrc):** See the [CLI Configuration File documentation](/docs/commands/cli-config.html). -If you used the `tfCliConfigFile` environment variable to specify a +If you used the `TF_CLI_CONFIG_FILE` environment variable to specify a non-default location for .terraformrc, the provider will also use that location. -Using a `credentialsHelper` block is not supported. +Using a `credentials_helper` block is not supported. ## Versions @@ -73,20 +73,22 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```hcl -terraform { - required_providers { - tfe = { - version = "~> 0.53.0" - } +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); } } + ``` As this provider is still at version zero, you should constrain the acceptable provider versions on the minor version. -The above snippet using `requiredProviders` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: +The above snippet using `required_providers` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: ```hcl provider "tfe" { @@ -99,17 +101,34 @@ For more information on provider installation and constraining provider versions ## Example Usage -```hcl -provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` - token = var.token - version = "~> 0.53.0" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +interface MyConfig { + email: any; + name: any; } - -# Create an organization -resource "tfe_organization" "org" { - # ... +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + new Organization(this, "org", { + email: config.email, + name: config.name, + }); + } } + ``` ## Argument Reference @@ -118,15 +137,15 @@ The following arguments are supported: * `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the - `tfeHostname` environment variable. + `TFE_HOSTNAME` environment variable. * `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. - Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` + Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` environment variable. * `organization` - (Optional) The default organization that resources should belong to. If provided, it's usually possible to omit resource-specific `organization` arguments. Ensure that the organization already exists prior to using this argument. - This can also be specified using the `tfeOrganization` environment variable. + This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 1aaced2ae..fbbaca18a 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,39 +17,48 @@ incorporating an admin token in your provider config. Basic usage: -```hcl - -provider "tfe" { - hostname = var.hostname - token = var.token -} - -provider "tfe" { - alias = "admin" - hostname = var.hostname - token = var.admin_token -} - -resource "tfe_organization" "a-module-producer" { - name = "my-org" - email = "admin@company.com" -} - -resource "tfe_organization" "a-module-consumer" { - name = "my-other-org" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { TfeProvider } from "./.gen/providers/tfe/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: token.stringValue, + }); + const admin = new TfeProvider(this, "tfe_1", { + alias: "admin", + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + const aModuleConsumer = new Organization(this, "a-module-consumer", { + email: "admin@company.com", + name: "my-other-org", + }); + const aModuleProducer = new Organization(this, "a-module-producer", { + email: "admin@company.com", + name: "my-org", + }); + new AdminOrganizationSettings(this, "test-settings", { + accessBetaTools: false, + globalModuleSharing: false, + moduleSharingConsumerOrganizations: [aModuleConsumer.name], + organization: aModuleProducer.name, + provider: "${tfe.admin}", + workspaceLimit: 15, + }); + } } -resource "tfe_admin_organization_settings" "test-settings" { - provider = tfe.admin - organization = tfe_organization.a-module-producer.name - workspace_limit = 15 - access_beta_tools = false - global_module_sharing = false - module_sharing_consumer_organizations = [ - tfe_organization.a-module-consumer.name - ] -} ``` ## Argument Reference @@ -66,4 +75,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 40f488f24..1e9d0c0f2 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.agentPool.AgentPool(this, "test-agent-pool", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index 78e686b1f..f532fa426 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -17,39 +17,53 @@ for Business account. ## Example Usage -In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. - -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -// Ensure workspace and agent pool are create first -resource "tfe_workspace" "test-workspace" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = false -} - -// Ensure permissions are assigned second -resource "tfe_agent_pool_allowed_workspaces" "allowed" { - agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. + +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testWorkspace = new Workspace(this, "test-workspace", { + name: "my-workspace-name", + organization: testOrganization.name, + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + organizationScoped: false, + }); + const allowed = new AgentPoolAllowedWorkspaces(this, "allowed", { + agentPoolId: testAgentPool.id, + allowedWorkspaceIds: Token.asList( + "${[ for key, value in ${" + + Fn.lookupNested(test, ["*", "id"]) + + "} : value]}" + ), + }); + new WorkspaceSettings(this, "test-workspace-settings", { + agentPoolId: allowed.id, + executionMode: "agent", + workspaceId: testWorkspace.id, + }); + } } -// Lastly, ensure the workspace agent execution is assigned last by -// referencing allowed_workspaces -resource "tfe_workspace_settings" "test-workspace-settings" { - workspace_id = tfe_workspace.test-workspace.id - execution_mode = "agent" - agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id -} ``` ## Argument Reference @@ -68,4 +82,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index e37e6da4d..a9b84db50 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,32 +17,29 @@ These tokens allow agents to communicate securely with Terraform Cloud. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentToken } from "./.gen/providers/tfe/agent-token"; +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.agentToken.AgentToken(this, "test-agent-token", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.id, + }); + new AgentToken(this, "test-agent-token", { + agentPoolId: testAgentPool.id, description: "my-agent-token-name", }); } @@ -63,4 +60,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index f740a6434..0e9040064 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,41 +16,34 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -61,53 +54,46 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a no-code module with variable options: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationFoobar = new tfe.organization.Organization( - this, - "foobar", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( - this, - "foobar_1", - { - moduleProvider: "my_provider", - name: "test_module", - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - } - ); + const foobar = new Organization(this, "foobar", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { + moduleProvider: "my_provider", + name: "test_module", + organization: foobar.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( - this, - "foobar_2", - { - organization: cdktf.Token.asString(tfeOrganizationFoobar.id), - registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - } - ); + const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { + organization: foobar.id, + registryModule: Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -141,4 +127,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 81ee6208b..a4d382fde 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_2", - { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,50 +64,52 @@ class MyConvertedCode extends cdktf.TerraformStack { With `destinationType` of `email`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -115,58 +117,60 @@ class MyConvertedCode extends cdktf.TerraformStack { ``` -(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: +(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `email_users`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeOrganizationMembershipTest = new OrganizationMembership( this, - "test", + "test_1", { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test_1", { email: "test.member@company.com", organization: "my-org-name", - }); + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = - new tfe.notificationConfiguration.NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.userId), - ], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = new NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -184,22 +188,22 @@ The following arguments are supported: * `generic` * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later * `slack` - * `microsoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value - _must not_ be provided if `destinationType` is `generic`, `microsoftTeams`, or `slack`. + _must not_ be provided if `destinationType` is `generic`, `microsoft-teams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided - if `destinationType` is `generic`, `microsoftTeams`, or `slack`. + if `destinationType` is `generic`, `microsoft-teams`, or `slack`. * `enabled` - (Optional) Whether the notification configuration should be enabled or not. Disabled configurations will not send any notifications. Defaults to `false`. * `token` - (Optional) A write-only secure token for the notification configuration, which can be used by the receiving server to verify request authenticity when configured for notification configurations with a destination type of `generic`. Defaults to `null`. - This value _must not_ be provided if `destinationType` is `email`, `microsoftTeams`, or `slack`. + This value _must not_ be provided if `destinationType` is `email`, `microsoft-teams`, or `slack`. * `triggers` - (Optional) The array of triggers for which this notification configuration will - send notifications. Valid values are `run:created`, `run:planning`, `run:needsAttention`, `run:applying` - `run:completed`, `run:errored`, `assessment:checkFailure`, `assessment:drifted`, or `assessment:failed`. + send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` + `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, or `assessment:failed`. If omitted, no notification triggers are configured. -* `url` - (Required if `destinationType` is `generic`, `microsoftTeams`, or `slack`) The HTTP or HTTPS URL of the notification +* `url` - (Required if `destinationType` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification configuration where notification requests will be made. This value _must not_ be provided if `destinationType` is `email`. * `workspaceId` - (Required) The id of the workspace that owns the notification configuration. @@ -216,4 +220,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index da2e6cca5..1a3b53615 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,15 +19,18 @@ provider. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -47,15 +50,18 @@ See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cl **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -78,15 +84,18 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.oauthClient.OauthClient(this, "test", { + new OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -110,27 +119,27 @@ The following arguments are supported: * `name` - (Optional) Display name for the OAuth Client. Defaults to the `serviceProvider` if not supplied. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `apiUrl` - (Required) The base URL of your VCS provider's API (e.g. - `https://apiGithubCom` or `https://gheExampleCom/api/v3`). + `https://api.github.com` or `https://ghe.example.com/api/v3`). * `httpUrl` - (Required) The homepage of your VCS provider (e.g. - `https://githubCom` or `https://gheExampleCom`). -* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghpXxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. -* `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account + `https://github.com` or `https://ghe.example.com`). +* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghp_xxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. +* `privateKey` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the +* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for BitBucket Server, this secret is the the text of the SSH private key associated with your BitBucket Server Application Link. -* `rsaPublicKey` - (Required for `bitbucketServer`) Required for BitBucket +* `rsaPublicKey` - (Required for `bitbucket_server`) Required for BitBucket Server in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your BitBucket Server Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, `github`, `githubEnterprise`, `gitlabHosted`, - `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. + options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, + `gitlab_community_edition`, or `gitlab_enterprise_edition`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown index 1dc2735fc..e1d634b0d 100644 --- a/website/docs/cdktf/typescript/r/opa_version.html.markdown +++ b/website/docs/cdktf/typescript/r/opa_version.html.markdown @@ -16,15 +16,18 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OpaVersion } from "./.gen/providers/tfe/opa-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.opaVersion.OpaVersion(this, "test", { + new OpaVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/opa", version: "0.58.0-custom", @@ -65,4 +68,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index e8adfbb3a..3ba278ef1 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,15 +16,18 @@ Manages organizations. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organization.Organization(this, "test", { + new Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -44,7 +47,7 @@ The following arguments are supported: * `sessionRememberMinutes` - (Optional) Session expiration. Defaults to `20160`. * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` - or `twoFactorMandatory`). Defaults to `password`. + or `two_factor_mandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. @@ -65,4 +68,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown index 76da8d7fd..cf68a6606 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -9,49 +9,42 @@ description: |- # tfe_organization_default_settings -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). +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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). ## Example Usage Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { OrganizationDefaultSettings } from "./.gen/providers/tfe/organization-default-settings"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeAgentPoolMyAgents = new tfe.agentPool.AgentPool( - this, - "my_agents", - { - name: "agent_smiths", - organization: cdktf.Token.asString(tfeOrganizationTest.name), - } - ); - const tfeOrganizationDefaultSettingsOrgDefault = - new tfe.organizationDefaultSettings.OrganizationDefaultSettings( - this, - "org_default", - { - defaultAgentPoolId: cdktf.Token.asString(tfeAgentPoolMyAgents.id), - defaultExecutionMode: "agent", - organization: cdktf.Token.asString(tfeOrganizationTest.name), - } - ); - new tfe.workspace.Workspace(this, "my_workspace", { - dependsOn: [tfeOrganizationDefaultSettingsOrgDefault], + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const myAgents = new AgentPool(this, "my_agents", { + name: "agent_smiths", + organization: test.name, + }); + const orgDefault = new OrganizationDefaultSettings(this, "org_default", { + defaultAgentPoolId: myAgents.id, + defaultExecutionMode: "agent", + organization: test.name, + }); + new Workspace(this, "my_workspace", { + dependsOn: [orgDefault], name: "my-workspace", }); } @@ -77,4 +70,4 @@ Organization default execution mode can be imported; use `` a terraform import tfe_organization_default_execution_mode.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 1ba96fccd..094241ddd 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,15 +24,18 @@ be updated manually. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationMembership.OrganizationMembership(this, "test", { + new OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -69,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 7a8d6f4bc..23972ab15 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -12,22 +12,25 @@ description: |- Manage module sharing for an organization. This resource requires the use of an admin token and is for Terraform Enterprise only. --> **NOTE:** `tfeOrganizationModuleSharing` is deprecated in favor of using `tfeAdminOrganizationSettings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. +-> **NOTE:** `tfe_organization_module_sharing` is deprecated in favor of using `tfe_admin_organization_settings` which also allows the management of the global module sharing setting. They attempt to manage the same resource and are mutually exclusive. ## Example Usage Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { + new OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -43,4 +46,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index af88749b5..a52e2e0b8 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,15 +18,18 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationRunTask.OrganizationRunTask(this, "example", { + new OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -63,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 13d4d4730..273e96979 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,15 +17,18 @@ can be used to act as the organization service account. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.organizationToken.OrganizationToken(this, "test", { + new OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -49,15 +52,31 @@ never expire. When a token has an expiry: -```hcl -resource "time_rotating" "example" { - rotation_days = 30 +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new Rotating(this, "example", { + rotation_days: 30, + }); + new OrganizationToken(this, "test", { + expiredAt: Token.asString(example.rotationRfc3339), + organization: Token.asString(org.name), + }); + } } -resource "tfe_organization_token" "test" { - organization = data.tfe_organization.org.name - expired_at = time_rotating.example.rotation_rfc3339 -} ``` ## Attributes Reference @@ -74,4 +93,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index d99b59da7..e9edf7291 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage for Sentinel: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -45,15 +48,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Policy } from "./.gen/providers/tfe/policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.policy.Policy(this, "test", { + new Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -80,8 +86,8 @@ The following arguments are supported: needs to run within your Rego code. Required for all OPA policies. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values for Sentinel are `advisory`, `hardMandatory` and `softMandatory`. Defaults - to `softMandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults + values for Sentinel are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults + to `soft-mandatory`. Valid values for OPA are `advisory` and `mandatory`. Defaults to `advisory`. ## Attributes Reference @@ -97,4 +103,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 3a3a14959..6c3c74812 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,58 +21,98 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - agent_enabled = "true" - policy_tool_version = "0.24.1" - policies_path = "policies/my-policy-set" - workspace_ids = [tfe_workspace.test.id] - - vcs_repo { - identifier = "my-org-name/my-policy-set-repository" - branch = "main" - ingress_submodules = false - oauth_token_id = tfe_oauth_client.test.oauth_token_id +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + agentEnabled: Token.asBoolean("true"), + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policiesPath: "policies/my-policy-set", + policyToolVersion: "0.24.1", + vcsRepo: { + branch: "main", + identifier: "my-org-name/my-policy-set-repository", + ingressSubmodules: false, + oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), + }, + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); } } + ``` Using manually-specified policies: -```hcl -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - kind = "sentinel" - agent_enabled = "true" - policy_tool_version = "0.24.1" - policy_ids = [tfe_sentinel_policy.test.id] - workspace_ids = [tfe_workspace.test.id] +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new PolicySet(this, "test", { + agentEnabled: Token.asBoolean("true"), + description: "A brand new policy set", + kind: "sentinel", + name: "my-policy-set", + organization: "my-org-name", + policyIds: [Token.asString(tfeSentinelPolicyTest.id)], + policyToolVersion: "0.24.1", + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + } } + ``` Manually uploaded policy set, in lieu of VCS: -```hcl -data "tfe_slug" "test" { - // point to the local directory where the policies are located. - source_path = "policies/my-policy-set" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataTfeSlug(this, "test", { + sourcePath: "policies/my-policy-set", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { + description: "A brand new policy set", + name: "my-policy-set", + organization: "my-org-name", + slug: Token.asStringMap(test), + workspaceIds: [Token.asString(tfeWorkspaceTest.id)], + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + } } -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "A brand new policy set" - organization = "my-org-name" - workspace_ids = [tfe_workspace.test.id] - - // reference the tfe_slug data source. - slug = data.tfe_slug.test -} ``` ## Argument Reference @@ -103,10 +143,10 @@ The following arguments are supported: new resource if changed. This value _must not_ be provided if `policyIds` are provided. * `workspaceIds` - (Optional) A list of workspace IDs. This value _must not_ be provided if `global` is provided. -* `slug` - (Optional) A reference to the `tfeSlug` data source that contains +* `slug` - (Optional) A reference to the `tfe_slug` data source that contains the `sourcePath` to where the local policies are located. This is used when policies are located locally, and can only be used when there is no VCS repo or -explicit Policy IDs. This _requires_ the usage of the `tfeSlug` data source. +explicit Policy IDs. This _requires_ the usage of the `tfe_slug` data source. -> **Note:** When neither `vcsRepo` or `policyIds` is not specified, the current default is to create an empty non-VCS policy set. @@ -135,4 +175,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index f7d672c9d..9acedef19 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: cdktf.Token.asString(tfeOrganizationTest.id), + organization: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = - new tfe.policySetParameter.PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 06087bc21..98f69dc50 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.project.Project(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Project(this, "test", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 596bb5179..87d6f764d 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -15,27 +15,47 @@ Adds and removes policy sets from a project Basic usage: -```hcl -resource "tfe_organization" "test" { - name = "my-org-name" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { + description: "Some description.", + name: "my-policy-set", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfePolicySetTest.overrideLogicalId("test"); + const tfeProjectTest = new Project(this, "test_2", { + name: "my-project-name", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.overrideLogicalId("test"); + const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + projectId: Token.asString(tfeProjectTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectPolicySetTest.overrideLogicalId("test"); + } } -resource "tfe_project" "test" { - name = "my-project-name" - organization = tfe_organization.test.name -} - -resource "tfe_policy_set" "test" { - name = "my-policy-set" - description = "Some description." - organization = tfe_organization.test.name -} - -resource "tfe_project_policy_set" "test" { - policy_set_id = tfe_policy_set.test.id - project_id = tfe_project.test.id -} ``` ## Argument Reference @@ -57,4 +77,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index 46d8cdd71..cdb622020 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -15,27 +15,47 @@ Adds and removes variable sets from a project Basic usage: -```hcl -resource "tfe_organization" "test" { - name = "my-org-name" - email = "admin@company.com" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { + name: "my-project-name", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.overrideLogicalId("test"); + const tfeVariableSetTest = new VariableSet(this, "test_2", { + description: "Some description.", + name: "Test Varset", + organization: test.name, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.overrideLogicalId("test"); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectVariableSetTest.overrideLogicalId("test"); + } } -resource "tfe_project" "test" { - name = "my-project-name" - organization = tfe_organization.test.name -} - -resource "tfe_variable_set" "test" { - name = "Test Varset" - description = "Some description." - organization = tfe_organization.test.name -} - -resource "tfe_project_variable_set" "test" { - variable_set_id = tfe_variable_set.test.id - project_id = tfe_project.test.id -} ``` ## Argument Reference @@ -57,4 +77,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index 851e98f10..3d4c9f943 100644 --- a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -16,11 +16,25 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```hcl -resource "tfe_registry_gpg_key" "example" { - organization = "my-org-name" - ascii_armor = file("my-public-key.asc") +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { RegistryGpgKey } from "./.gen/providers/tfe/registry-gpg-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new RegistryGpgKey(this, "example", { + asciiArmor: Token.asString(Fn.file("my-public-key.asc")), + organization: "my-org-name", + }); + } } + ``` ## Argument Reference @@ -45,4 +59,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 137232711..1404322a4 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,42 +16,35 @@ Terraform Cloud's private module registry helps you share Terraform modules acro Basic usage with VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( - this, - "test-oauth-client", - { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - serviceProvider: "github", - } - ); - new tfe.registryModule.RegistryModule(this, "test-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testOauthClient = new OauthClient(this, "test-oauth-client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: testOrganization.name, + serviceProvider: "github", + }); + new RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: cdktf.Token.asString( - tfeOauthClientTestOauthClient.oauthTokenId - ), + oauthTokenId: testOauthClient.oauthTokenId, }, }); } @@ -62,36 +55,31 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module with tests enabled: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( - this, - "test-oauth-client", - { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - serviceProvider: "github", - } - ); - new tfe.registryModule.RegistryModule(this, "test-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testOauthClient = new OauthClient(this, "test-oauth-client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: testOrganization.name, + serviceProvider: "github", + }); + new RegistryModule(this, "test-registry-module", { testConfig: [ { testsEnabled: true, @@ -101,9 +89,7 @@ class MyConvertedCode extends cdktf.TerraformStack { branch: "main", displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: cdktf.Token.asString( - tfeOauthClientTestOauthClient.oauthTokenId - ), + oauthTokenId: testOauthClient.oauthTokenId, }, }); } @@ -114,37 +100,35 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module with GitHub App: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const ghaInstallation = new DataTfeGithubAppInstallation( this, - "test-organization", + "gha_installation", { - email: "admin@company.com", - name: "my-org-name", + name: "YOUR_GH_NAME", } ); - const dataTfeGithubAppInstallationGhaInstallation = - new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( - this, - "gha_installation", - { - name: "YOUR_GH_NAME", - } - ); - new tfe.registryModule.RegistryModule(this, "petstore", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + new RegistryModule(this, "petstore", { + organization: testOrganization.name, vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: cdktf.Token.asString( - dataTfeGithubAppInstallationGhaInstallation.id - ), + githubAppInstallationId: Token.asString(ghaInstallation.id), identifier: "GH_NAME/REPO_NAME", }, }); @@ -156,34 +140,28 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module without VCS: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule( - this, - "test-private-registry-module", - { - moduleProvider: "my_provider", - name: "another_test_module", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "private", - } - ); + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-private-registry-module", { + moduleProvider: "my_provider", + name: "another_test_module", + organization: testOrganization.name, + registryName: "private", + }); } } @@ -192,27 +170,27 @@ class MyConvertedCode extends cdktf.TerraformStack { Create public registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, registryName: "public", }); } @@ -223,41 +201,37 @@ class MyConvertedCode extends cdktf.TerraformStack { Create no-code provisioning registry module: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testNoCodeProvisioningRegistryModule = new RegistryModule( this, - "test-organization", + "test-no-code-provisioning-registry-module", { - email: "admin@company.com", - name: "my-org-name", + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: testOrganization.name, + registryName: "public", } ); - const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = - new tfe.registryModule.RegistryModule( - this, - "test-no-code-provisioning-registry-module", - { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - registryName: "public", - } - ); - new tfe.noCodeModule.NoCodeModule(this, "foobar", { - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - registryModule: cdktf.Token.asString( - tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id - ), + new NoCodeModule(this, "foobar", { + organization: testOrganization.id, + registryModule: testNoCodeProvisioningRegistryModule.id, }); } } @@ -318,4 +292,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_provider.html.markdown b/website/docs/cdktf/typescript/r/registry_provider.html.markdown index 3094a32f4..324adacab 100644 --- a/website/docs/cdktf/typescript/r/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_provider.html.markdown @@ -16,27 +16,26 @@ Manages public and private providers in the private registry. Create private provider: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationExample = new tfe.organization.Organization( - this, - "example", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryProviderExample = - new tfe.registryProvider.RegistryProvider(this, "example_1", { - name: "my-provider", - organization: cdktf.Token.asString(tfeOrganizationExample.name), - }); + const example = new Organization(this, "example", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { + name: "my-provider", + organization: example.name, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -47,29 +46,28 @@ class MyConvertedCode extends cdktf.TerraformStack { Create public provider: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationExample = new tfe.organization.Organization( - this, - "example", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeRegistryProviderExample = - new tfe.registryProvider.RegistryProvider(this, "example_1", { - name: "aws", - namespace: "hashicorp", - organization: cdktf.Token.asString(tfeOrganizationExample.name), - registryName: "public", - }); + const example = new Organization(this, "example", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { + name: "aws", + namespace: "hashicorp", + organization: example.name, + registryName: "public", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -108,4 +106,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index dcfe00943..24f65857b 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,41 +19,34 @@ to up to 20 source workspaces. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( - this, - "test-sourceable", - { - name: "my-sourceable-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( - this, - "test-workspace", - { - name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), - } - ); - new tfe.runTrigger.RunTrigger(this, "test", { - sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const testSourceable = new Workspace(this, "test-sourceable", { + name: "my-sourceable-workspace-name", + organization: testOrganization.id, + }); + const testWorkspace = new Workspace(this, "test-workspace", { + name: "my-workspace-name", + organization: testOrganization.id, + }); + new RunTrigger(this, "test", { + sourceableId: testSourceable.id, + workspaceId: testWorkspace.id, }); } } @@ -80,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 430a810e7..78e016f2f 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,17 +15,31 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```hcl -provider "tfe" { - hostname = var.hostname - token = var.admin_token +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TfeProvider } from "./.gen/providers/tfe/provider"; +import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TfeProvider(this, "tfe", { + hostname: hostname.stringValue, + token: adminToken.stringValue, + }); + new SamlSettings(this, "this", { + idpCert: "foobarCertificate", + sloEndpointUrl: "https://example.com/slo_endpoint_url", + ssoEndpointUrl: "https://example.com/sso_endpoint_url", + }); + } } -resource "tfe_saml_settings" "this" { - idp_cert = "foobarCertificate" - slo_endpoint_url = "https://example.com/slo_endpoint_url" - sso_endpoint_url = "https://example.com/sso_endpoint_url" - } ``` ## Argument Reference @@ -46,8 +60,8 @@ The following arguments are supported: * `ssoApiTokenSessionTimeout` - (Optional) Specifies the Single Sign On session timeout in seconds. Defaults to 14 days. * `certificate` - (Optional) The certificate used for request and assertion signing. * `privateKey` - (Optional) The private key used for request and assertion signing. -* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. -* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `sha1` or `sha256`. Defaults to `sha256`. +* `signatureSigningMethod` - (Optional) Signature Signing Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. +* `signatureDigestMethod` - (Optional) Signature Digest Method. Must be either `SHA1` or `SHA256`. Defaults to `SHA256`. ## Attributes Reference @@ -64,4 +78,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 206276ff4..0c1b07cf4 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,15 +21,18 @@ enforced during runs. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sentinelPolicy.SentinelPolicy(this, "test", { + new SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -50,8 +53,8 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `policy` - (Required) The actual policy itself. * `enforceMode` - (Optional) The enforcement level of the policy. Valid - values are `advisory`, `hardMandatory` and `softMandatory`. Defaults - to `softMandatory`. + values are `advisory`, `hard-mandatory` and `soft-mandatory`. Defaults + to `soft-mandatory`. ## Attributes Reference @@ -66,4 +69,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown index e1ac09ade..c11688de7 100644 --- a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown @@ -16,15 +16,18 @@ Manage Sentinel versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SentinelVersion } from "./.gen/providers/tfe/sentinel-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sentinelVersion.SentinelVersion(this, "test", { + new SentinelVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/sentinel.zip", version: "0.24.0-custom", @@ -65,4 +68,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 90680d24c..5005e86a3 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,15 +17,18 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { SshKey } from "./.gen/providers/tfe/ssh-key"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.sshKey.SshKey(this, "test", { + new SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -52,4 +55,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index b793d408b..723937553 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,15 +16,18 @@ Manages teams. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -36,15 +39,18 @@ class MyConvertedCode extends cdktf.TerraformStack { Organization Permission usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.team.Team(this, "test", { + new Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -97,4 +103,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 8af746faa..79dcd1795 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,28 +16,33 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamAccess } from "./.gen/providers/tfe/team-access"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new TeamAccess(this, "test_2", { access: "read", - teamId: cdktf.Token.asString(tfeTeamTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + teamId: test.id, + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -59,7 +64,7 @@ The `permissions` block supports: * `runs` - (Required) The permission to grant the team on the workspace's runs. Valid values are `read`, `plan`, or `apply`. * `variables` - (Required) The permission to grant the team on the workspace's variables. Valid values are `none`, `read`, or `write`. -* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `readOutputs`, or `write`. +* `stateVersions` - (Required) The permission to grant the team on the workspace's state versions. Valid values are `none`, `read`, `read-outputs`, or `write`. * `sentinelMocks` - (Required) The permission to grant the team on the workspace's generated Sentinel mocks, Valid values are `none` or `read`. * `workspaceLocking` - (Required) Boolean determining whether or not to grant the team permission to manually lock/unlock the workspace. * `runTasks` - (Required) Boolean determining whether or not to grant the team permission to manage workspace run tasks. @@ -80,4 +85,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index eb7cf719c..d04d60adb 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMember } from "./.gen/providers/tfe/team-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMemberTest = new TeamMember(this, "test_1", { + teamId: test.id, username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -64,4 +68,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index d47aa77bf..385531b7e 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,20 +25,24 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -50,23 +54,35 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of usernames: -```hcl -locals { - all_usernames = toset([ - "user1", - "user2", - ]) -} - -resource "tfe_team" "test" { - name = "my-team-name" - organization = "my-org-name" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamMembers } from "./.gen/providers/tfe/team-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const allUsernames = Fn.toset(["user1", "user2"]); + const test = new Team(this, "test", { + name: "my-team-name", + organization: "my-org-name", + }); + const tfeTeamMembersTest = new TeamMembers(this, "test_1", { + teamId: test.id, + usernames: Token.asList( + "${[ for user in ${" + allUsernames + "} : user]}" + ), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeTeamMembersTest.overrideLogicalId("test"); + } } -resource "tfe_team_members" "test" { - team_id = tfe_team.test.id - usernames = [for user in local.all_usernames : user] -} ``` ## Argument Reference @@ -88,4 +104,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 1eec91879..9c60fbb77 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,32 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_1", { + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = - new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { - organizationMembershipId: cdktf.Token.asString( - tfeOrganizationMembershipTest.id - ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( + this, + "test_2", + { + organizationMembershipId: test.id, + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -77,4 +82,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index ba1476eec..7dda75e25 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,38 +24,41 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationMembershipSample = - new tfe.organizationMembership.OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const tfeOrganizationMembershipTest = - new tfe.organizationMembership.OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new tfe.team.Team(this, "test_2", { + const sample = new OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const test = new OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { - organizationMembershipIds: [ - cdktf.Token.asString(tfeOrganizationMembershipTest.id), - cdktf.Token.asString(tfeOrganizationMembershipSample.id), - ], - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_3", + { + organizationMembershipIds: [test.id, sample.id], + teamId: Token.asString(tfeTeamTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -66,48 +69,48 @@ class MyConvertedCode extends cdktf.TerraformStack { With a set of organization members: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const allUsers = cdktf.Fn.toset([ - "user1@hashicorp.com", - "user2@hashicorp.com", - ]); + const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const tfeOrganizationMembershipAllMembershipForEachIterator = - cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); - new tfe.organizationMembership.OrganizationMembership( - this, - "all_membership", - { - email: cdktf.Token.asString( - tfeOrganizationMembershipAllMembershipForEachIterator.key - ), - organization: "my-org-name", - forEach: tfeOrganizationMembershipAllMembershipForEachIterator, - } + const allMembershipForEachIterator = TerraformIterator.fromList( + Token.asAny(allUsers) ); - const tfeTeamTest = new tfe.team.Team(this, "test", { + new OrganizationMembership(this, "all_membership", { + email: Token.asString(allMembershipForEachIterator.key), + organization: "my-org-name", + forEach: allMembershipForEachIterator, + }); + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = - new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { - organizationMembershipIds: cdktf.Token.asList( + const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( + this, + "test_2", + { + organizationMembershipIds: Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: cdktf.Token.asString(tfeTeamTest.id), - }); + teamId: test.id, + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -131,4 +134,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index 10eccae74..f85ec64cc 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,28 +16,32 @@ Associate a team to permissions on a project. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamAdmin = new tfe.team.Team(this, "admin", { + const admin = new Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = - new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamAdmin.id), - }); + const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: test.id, + teamId: admin.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -75,7 +79,7 @@ The following permissions apply to all workspaces (and future workspaces) in the |----------------------|-------------------------------------------------------| | `runs` | The permission to grant project's workspaces' runs. Default: `read`. Valid strings: `read`, `plan`, or `apply`. | | `sentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `none`. Valid strings: `none`, or `read`. | -| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `readOutputs`, `read`, or `write`.| +| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `read-outputs`, `read`, or `write`.| | `variables` | The permission to grant project's workspaces' variables. Default `none`. Valid strings: `none`, `read`, or `write`. | | `create` | The permission to create project's workspaces in the project. Default: `false`. Valid booleans `true`, `false` | | `locking` | The permission to manually lock or unlock the project's workspaces. Default `false`. Valid booleans `true`, `false` | @@ -87,23 +91,28 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Project } from "./.gen/providers/tfe/project"; +import { Team } from "./.gen/providers/tfe/team"; +import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { + const test = new Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const tfeTeamDev = new tfe.team.Team(this, "dev", { + const dev = new Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { + new TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -111,8 +120,8 @@ class MyConvertedCode extends cdktf.TerraformStack { teams: "none", }, ], - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamDev.id), + projectId: test.id, + teamId: dev.id, workspaceAccess: [ { create: true, @@ -145,4 +154,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index f450192af..702ea826e 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,20 +16,24 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_1", { + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -55,27 +59,31 @@ never expire. When a token has an expiry: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -import * as time from "./.gen/providers/time"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Team } from "./.gen/providers/tfe/team"; +import { TeamToken } from "./.gen/providers/tfe/team-token"; +import { Rotating } from "./.gen/providers/time/rotating"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const tfeTeamTest = new tfe.team.Team(this, "test", { + const test = new Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const timeRotatingExample = new time.rotating.Rotating(this, "example", { + const example = new Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { - expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), - teamId: cdktf.Token.asString(tfeTeamTest.id), + const tfeTeamTokenTest = new TeamToken(this, "test_2", { + expiredAt: Token.asString(example.rotationRfc3339), + teamId: test.id, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -97,4 +105,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index f122ae910..498537295 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,15 +16,18 @@ Manage Terraform versions available on Terraform Cloud/Enterprise. Basic Usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.terraformVersion.TerraformVersion(this, "test", { + new TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -65,4 +68,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 1d442d61a..329aa0a2d 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,34 +16,35 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeWorkspaceTest = new Workspace(this, "test_1", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { + const tfeVariableTest = new Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -55,43 +56,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Basic usage for variable sets: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -133,31 +135,42 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -``` -resource "tfe_variable" "sensitive_var" { - key = "sensitive_key" - value = "sensitive_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = true -} - -resource "tfe_variable" "visible_var" { - key = "visible_key" - value = "visible_value" // this will be redacted from plan outputs - category = "terraform" - workspace_id = tfe_workspace.workspace.id - sensitive = false -} - -resource "tfe_workspace" "sensitive_workspace" { - name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs - organization = "organization name" -} - -resource "tfe_workspace" "visible_workspace" { - name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs - organization = "organization name" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Variable } from "./.gen/providers/tfe/variable"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const sensitiveVar = new Variable(this, "sensitive_var", { + category: "terraform", + key: "sensitive_key", + sensitive: true, + value: "sensitive_value", + workspaceId: workspace.id, + }); + const visibleVar = new Variable(this, "visible_var", { + category: "terraform", + key: "visible_key", + sensitive: false, + value: "visible_value", + workspaceId: workspace.id, + }); + new Workspace(this, "sensitive_workspace", { + name: "workspace-${" + sensitiveVar.value + "}", + organization: "organization name", + }); + new Workspace(this, "visible_workspace", { + name: "workspace-${" + visibleVar.readableValue + "}", + organization: "organization name", + }); + } } ``` @@ -185,4 +198,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index ceb0d3f23..f4e66379a 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,68 +16,75 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeProjectTest = new tfe.project.Project(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeProjectTest = new Project(this, "test_1", { name: "projectname", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { + const tfeVariableSetTest = new VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { + const tfeWorkspaceTest = new Workspace(this, "test_3", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_4", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = - new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { - projectId: cdktf.Token.asString(tfeProjectTest.id), - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { + projectId: Token.asString(tfeProjectTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -87,43 +94,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a global variable set: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -133,43 +141,44 @@ class MyConvertedCode extends cdktf.TerraformStack { Create a priority variable set: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Variable } from "./.gen/providers/tfe/variable"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", name: "Global Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, priority: true, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new tfe.variable.Variable(this, "test-a", { + new Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); - new tfe.variable.Variable(this, "test-b", { + new Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + variableSetId: Token.asString(tfeVariableSetTest.id), }); } } @@ -202,4 +211,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 1190e3e79..e260749b3 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -20,25 +20,25 @@ Provides a workspace resource. Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.workspace.Workspace(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new Workspace(this, "test", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, tagNames: ["test", "app"], }); } @@ -49,37 +49,38 @@ class MyConvertedCode extends cdktf.TerraformStack { Usage with vcs_repo: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - new tfe.workspace.Workspace(this, "parent", { + new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); } @@ -153,7 +154,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). @@ -172,7 +173,7 @@ The `vcsRepo` block supports: * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. - This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. + This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -196,4 +197,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index 08afbc792..eb29e7b08 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -11,47 +11,48 @@ description: |- Adds and removes policy sets from a workspace --> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = - new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -78,4 +79,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index 2bca759b3..e76d7a91a 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -11,51 +11,52 @@ description: |- Adds and removes policy sets from an excluded workspace --> **Note:** `tfePolicySet` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. +-> **Note:** `tfe_policy_set` has an argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments. ## Example Usage Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { PolicySet } from "./.gen/providers/tfe/policy-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfePolicySetTest = new PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = - new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: cdktf.Token.asString(tfePolicySetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: Token.asString(tfePolicySetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -82,4 +83,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index f1875dbe2..388a6fded 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -14,92 +14,90 @@ Provides a resource to manage the _initial_ and/or _final_ Terraform run in a gi There are a few main use cases this resource was designed for: - **Workspaces that depend on other workspaces.** If a workspace will create infrastructure that other workspaces rely on (for example, a Kubernetes cluster to deploy resources into), those downstream workspaces can depend on an initial `apply` with `wait_for_run = true`, so they aren't created before their infrastructure dependencies. -- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfeWorkspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfeVariable` resources themselves depend on the `tfeWorkspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfeVariables`, you can accomplish the same goal without a circular dependency. -- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfeWorkspace` resource's default safe deletion behavior. +- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. +- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfe_workspace` resource's default safe deletion behavior. -The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfeWorkspaceRun` resource that includes an `apply` block will queue a new apply when added to a config. +The `tfe_workspace_run` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfe_workspace_run` resource that includes an `apply` block will queue a new apply when added to a config. ## Example Usage Basic usage with multiple workspaces: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { + const child = new Workspace(this, "child", { name: "child-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, + }, + }); + const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: parent.id, }); - const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( - this, - "ws_run_parent", - { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, - }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), - } - ); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { + new WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [tfeWorkspaceRunWsRunParent], + dependsOn: [wsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), + workspaceId: child.id, }); } } @@ -109,40 +107,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With manual confirmation: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends cdktf.TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -160,40 +160,42 @@ class MyConvertedCode extends cdktf.TerraformStack { With no retries: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, serviceProvider: "github", }); - const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { + const parent = new Workspace(this, "parent", { name: "parent-ws", - organization: tfeOrganizationTestOrganization, + organization: testOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: test.oauthTokenId, }, }); - new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { + new WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -203,7 +205,7 @@ class MyConvertedCode extends cdktf.TerraformStack { retry: false, waitForRun: true, }, - workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + workspaceId: parent.id, }); } } @@ -223,16 +225,16 @@ Both `apply` and `destroy` block supports: * `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. - * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfeWorkspace` data source. + * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfe_workspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. * `retryAttempts` - (Optional) The number to retry attempts made after an initial error. Defaults to `3`. * `retryBackoffMin` - (Optional) The minimum time in seconds to backoff before attempting a retry. Defaults to `1`. * `retryBackoffMax` - (Optional) The maximum time in seconds to backoff before attempting a retry. Defaults to `30`. -* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfeWorkspaceRun` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. +* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfe_workspace_run` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 2af33a4b9..b45d66f2a 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,12 +17,26 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```hcl -resource "tfe_workspace_run_task" "example" { - workspace_id = resource.tfe_workspace.example.id - task_id = resource.tfe_organization_run_task.example.id - enforcement_level = "advisory" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new WorkspaceRunTask(this, "example", { + enforcementLevel: "advisory", + taskId: tfeOrganizationRunTask.example.id, + workspaceId: tfeWorkspace.example.id, + }); + } } + ``` ## Argument Reference @@ -32,7 +46,7 @@ The following arguments are supported: * `enforcementLevel` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`. * `taskId` - (Required) The id of the Run task to associate to the Workspace. * `workspaceId` - (Required) The id of the workspace to associate the Run task to. -* `stage` - (Optional) The stage to run the task in. Valid values are `prePlan`, `postPlan`, and `preApply`. +* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`. ## Attributes Reference @@ -47,4 +61,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index 04f080251..26cba38c8 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -16,29 +16,30 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new Workspace(this, "test", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, }); - new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { + new WorkspaceSettings(this, "test-settings", { executionMode: "local", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + workspaceId: test.id, }); } } @@ -48,53 +49,49 @@ class MyConvertedCode extends cdktf.TerraformStack { With `executionMode` of `agent`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; +import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + const test = new Workspace(this, "test", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, + }); + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, }); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + const tfeAgentPoolAllowedWorkspacesTest = new AgentPoolAllowedWorkspaces( this, - "test-agent-pool", + "test_3", { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), + agentPoolId: testAgentPool.id, + allowedWorkspaceIds: [test.id], } ); - const tfeAgentPoolAllowedWorkspacesTest = - new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( - this, - "test_3", - { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), - allowedWorkspaceIds: [cdktf.Token.asString(tfeWorkspaceTest.id)], - } - ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); - new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { - agentPoolId: cdktf.Token.asString( + new WorkspaceSettings(this, "test-settings", { + agentPoolId: Token.asString( tfeAgentPoolAllowedWorkspacesTest.agentPoolId ), executionMode: "agent", - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + workspaceId: test.id, }); } } @@ -104,33 +101,32 @@ class MyConvertedCode extends cdktf.TerraformStack { This resource may be used as a data source when no optional arguments are defined: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformOutput, Op, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; +import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( - this, - "test", - { - name: "my-workspace-name", - organization: "my-org-name", - } - ); - const tfeWorkspaceSettingsTest = - new tfe.workspaceSettings.WorkspaceSettings(this, "test_1", { - workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), - }); + const test = new DataTfeWorkspace(this, "test", { + name: "my-workspace-name", + organization: "my-org-name", + }); + const tfeWorkspaceSettingsTest = new WorkspaceSettings(this, "test_1", { + workspaceId: Token.asString(test.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceSettingsTest.overrideLogicalId("test"); - new cdktf.TerraformOutput(this, "workspace-explicit-local-execution", { - value: cdktf.Fn.alltrue( - cdktf.Token.asAny([ - cdktf.Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), - cdktf.propertyAccess(tfeWorkspaceSettingsTest.overwrites, [ + new TerraformOutput(this, "workspace-explicit-local-execution", { + value: Fn.alltrue( + Token.asAny([ + Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), + Fn.lookupNested(tfeWorkspaceSettingsTest.overwrites, [ "0", '"execution_mode"', ]), @@ -159,7 +155,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - `executionMode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agentPool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -174,4 +170,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 946d0f324..89747f9cf 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -11,47 +11,52 @@ description: |- Adds and removes variable sets from a workspace --> **Note:** `tfeVariableSet` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. +-> **Note:** `tfe_variable_set` has a deprecated argument `workspaceIds` that should not be used alongside this resource. They attempt to manage the same attachments and are mutually exclusive. ## Example Usage Basic usage: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Organization } from "./.gen/providers/tfe/organization"; +import { VariableSet } from "./.gen/providers/tfe/variable-set"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationTest = new tfe.organization.Organization( - this, - "test", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + const test = new Organization(this, "test", { + email: "admin@company.com", + name: "my-org-name", + }); + const tfeVariableSetTest = new VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { + const tfeWorkspaceTest = new Workspace(this, "test_2", { name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTest.name), + organization: test.name, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = - new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { - variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), - workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( + this, + "test_3", + { + variableSetId: Token.asString(tfeVariableSetTest.id), + workspaceId: Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -78,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file From 06acd6f435f1f922ed68e239011525ce744e2c38 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:11:52 +0000 Subject: [PATCH 316/420] [COMPLIANCE] Add Copyright and License Headers --- internal/provider/admin_helpers_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/admin_helpers_test.go b/internal/provider/admin_helpers_test.go index 7bb9b3b86..a91ae33c6 100644 --- a/internal/provider/admin_helpers_test.go +++ b/internal/provider/admin_helpers_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( From 0120260c60e4bd5ab8c850a6850c0ad996ddd944 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Tue, 2 Apr 2024 11:13:37 -0400 Subject: [PATCH 317/420] bump up node to v20 --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c000fe9a..3e841ca4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: steps: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: 16 + node-version: 20 - name: Download artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 0b4fa8a12..53694e3c0 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -83,7 +83,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: "18.x" + node-version: "20.x" - name: Install cdktf-registry-docs run: npm install -g cdktf-registry-docs@1.10.1 From c96978a09b5472c026d8751a97bc7caaa7d8e313 Mon Sep 17 00:00:00 2001 From: Zain Hasan Date: Tue, 2 Apr 2024 12:43:39 -0700 Subject: [PATCH 318/420] Bitbucket Data Center support --- internal/provider/data_source_oauth_client.go | 1 + .../provider/resource_tfe_oauth_client.go | 5 ++-- .../resource_tfe_oauth_client_test.go | 6 ++--- .../cdktf/csharp/d/oauth_client.html.markdown | 2 +- .../cdktf/csharp/r/oauth_client.html.markdown | 20 +++++++-------- .../csharp/r/registry_module.html.markdown | 2 +- .../cdktf/go/d/oauth_client.html.markdown | 4 +-- .../cdktf/go/r/oauth_client.html.markdown | 22 ++++++++-------- .../cdktf/go/r/registry_module.html.markdown | 2 +- .../cdktf/java/d/oauth_client.html.markdown | 2 +- .../cdktf/java/r/oauth_client.html.markdown | 24 +++++++++--------- .../java/r/registry_module.html.markdown | 2 +- .../cdktf/python/d/oauth_client.html.markdown | 2 +- .../cdktf/python/r/oauth_client.html.markdown | 25 +++++++++---------- .../python/r/registry_module.html.markdown | 4 +-- .../typescript/d/oauth_client.html.markdown | 2 +- .../typescript/r/oauth_client.html.markdown | 24 +++++++++--------- .../r/registry_module.html.markdown | 2 +- website/docs/d/oauth_client.html.markdown | 2 +- website/docs/r/oauth_client.html.markdown | 12 ++++----- website/docs/r/registry_module.html.markdown | 2 +- 21 files changed, 84 insertions(+), 83 deletions(-) diff --git a/internal/provider/data_source_oauth_client.go b/internal/provider/data_source_oauth_client.go index 5f977dca2..0ea573228 100644 --- a/internal/provider/data_source_oauth_client.go +++ b/internal/provider/data_source_oauth_client.go @@ -45,6 +45,7 @@ func dataSourceTFEOAuthClient() *schema.Resource { string(tfe.ServiceProviderAzureDevOpsServer), string(tfe.ServiceProviderAzureDevOpsServices), string(tfe.ServiceProviderBitbucket), + string(tfe.ServiceProviderBitbucketDataCenter), string(tfe.ServiceProviderBitbucketServer), string(tfe.ServiceProviderBitbucketServerLegacy), string(tfe.ServiceProviderGithub), diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index 215443193..32b1cc66a 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -83,7 +83,7 @@ func resourceTFEOAuthClient() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, - // this field is only for BitBucket Server, and requires these other + // this field is only for BitBucket Data Center, and requires these other RequiredWith: []string{"secret", "key"}, }, @@ -97,6 +97,7 @@ func resourceTFEOAuthClient() *schema.Resource { string(tfe.ServiceProviderAzureDevOpsServices), string(tfe.ServiceProviderBitbucket), string(tfe.ServiceProviderBitbucketServer), + string(tfe.ServiceProviderBitbucketDataCenter), string(tfe.ServiceProviderGithub), string(tfe.ServiceProviderGithubEE), string(tfe.ServiceProviderGitlab), @@ -149,7 +150,7 @@ func resourceTFEOAuthClientCreate(d *schema.ResourceData, meta interface{}) erro if serviceProvider == tfe.ServiceProviderAzureDevOpsServer { options.PrivateKey = tfe.String(privateKey) } - if serviceProvider == tfe.ServiceProviderBitbucketServer { + if serviceProvider == tfe.ServiceProviderBitbucketServer || serviceProvider == tfe.ServiceProviderBitbucketDataCenter { options.RSAPublicKey = tfe.String(rsaPublicKey) options.Secret = tfe.String(secret) } diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index a74ecc811..a54efc2a8 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -60,11 +60,11 @@ func TestAccTFEOAuthClient_rsaKeys(t *testing.T) { testAccCheckTFEOAuthClientExists("tfe_oauth_client.foobar", oc), testAccCheckTFEOAuthClientAttributes(oc), resource.TestCheckResourceAttr( - "tfe_oauth_client.foobar", "api_url", "https://bbs.example.com"), + "tfe_oauth_client.foobar", "api_url", "https://bbdc.example.com"), resource.TestCheckResourceAttr( - "tfe_oauth_client.foobar", "http_url", "https://bbs.example.com"), + "tfe_oauth_client.foobar", "http_url", "https://bbdc.example.com"), resource.TestCheckResourceAttr( - "tfe_oauth_client.foobar", "service_provider", "bitbucket_server"), + "tfe_oauth_client.foobar", "service_provider", "bitbucket_data_center"), resource.TestCheckResourceAttr( "tfe_oauth_client.foobar", "key", "1e4843e138b0d44911a50d15e0f7cee4"), resource.TestCheckResourceAttr( diff --git a/website/docs/cdktf/csharp/d/oauth_client.html.markdown b/website/docs/cdktf/csharp/d/oauth_client.html.markdown index 398953695..88facddb5 100644 --- a/website/docs/cdktf/csharp/d/oauth_client.html.markdown +++ b/website/docs/cdktf/csharp/d/oauth_client.html.markdown @@ -81,7 +81,7 @@ be set. * `OauthClientId` - (Optional) ID of the OAuth client. * `Organization` - (Optional) The name of the organization in which to search. * `ServiceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketServer`, + must be one of: `AdoServer`, `AdoServices`,`BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. diff --git a/website/docs/cdktf/csharp/r/oauth_client.html.markdown b/website/docs/cdktf/csharp/r/oauth_client.html.markdown index 77beca461..669e922ac 100644 --- a/website/docs/cdktf/csharp/r/oauth_client.html.markdown +++ b/website/docs/cdktf/csharp/r/oauth_client.html.markdown @@ -70,11 +70,11 @@ class MyConvertedCode : TerraformStack } ``` -#### BitBucket Server Usage +#### BitBucket Data Center Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). -When using BitBucket Server, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. +When using BitBucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. ```csharp @@ -101,7 +101,7 @@ class MyConvertedCode : TerraformStack content -----END RSA PRIVATE KEY----- ", - ServiceProvider = "bitbucket_server" + ServiceProvider = "bitbucket_data_center" }); } } @@ -121,15 +121,15 @@ The following arguments are supported: * `PrivateKey` - (Required for `AdoServer`) The text of the private key associated with your Azure DevOps Server account * `Key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `Secret` - (Required for `BitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server +* `Secret` - (Required for `BitbucketDataCenter`) The OAuth Client secret is used for BitBucket Data Center, this secret is the + the text of the SSH private key associated with your BitBucket Data Center Application Link. -* `RsaPublicKey` - (Required for `BitbucketServer`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application +* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for BitBucket + Data Center in conjunction with the secret. Not used for any other providers. The +text of the SSH public key associated with your BitBucket Data Center Application Link. * `ServiceProvider` - (Required) The VCS provider being connected with. Valid - options are `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketServer`, `Github`, `GithubEnterprise`, `GitlabHosted`, + options are `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketDataCenter`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. ## Attributes Reference diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index d79ea5c63..576ab6fe7 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -223,7 +223,7 @@ The `VcsRepo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `Identifier` string. * `Identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. diff --git a/website/docs/cdktf/go/d/oauth_client.html.markdown b/website/docs/cdktf/go/d/oauth_client.html.markdown index 93be267e7..2eab6b217 100644 --- a/website/docs/cdktf/go/d/oauth_client.html.markdown +++ b/website/docs/cdktf/go/d/oauth_client.html.markdown @@ -90,7 +90,7 @@ be set. * `OauthClientId` - (Optional) ID of the OAuth client. * `Organization` - (Optional) The name of the organization in which to search. * `ServiceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketServer`, + must be one of: `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. @@ -109,4 +109,4 @@ In addition to all arguments above, the following attributes are exported: * `ServiceProvider` - The API identifier of the OAuth service provider. * `ServiceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + diff --git a/website/docs/cdktf/go/r/oauth_client.html.markdown b/website/docs/cdktf/go/r/oauth_client.html.markdown index 52a8a520d..40174df0f 100644 --- a/website/docs/cdktf/go/r/oauth_client.html.markdown +++ b/website/docs/cdktf/go/r/oauth_client.html.markdown @@ -73,11 +73,11 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { } ``` -#### BitBucket Server Usage +#### BitBucket Data Center Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). -When using BitBucket Server, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. +When using BitBucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. ```go @@ -101,7 +101,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { organization: jsii.String("my-org-name"), rsaPublicKey: jsii.String("-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----\n"), secret: jsii.String("-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----\n"), - serviceProvider: jsii.String("bitbucket_server"), + serviceProvider: jsii.String("bitbucket_data_center"), }) return this } @@ -121,15 +121,15 @@ The following arguments are supported: * `PrivateKey` - (Required for `AdoServer`) The text of the private key associated with your Azure DevOps Server account * `Key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `Secret` - (Required for `BitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server +* `Secret` - (Required for `BitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `RsaPublicKey` - (Required for `BitbucketServer`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application +* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for Bitbucket Data Center + in conjunction with the secret. Not used for any other providers. The +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `ServiceProvider` - (Required) The VCS provider being connected with. Valid - options are `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketServer`, `Github`, `GithubEnterprise`, `GitlabHosted`, + options are `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. ## Attributes Reference @@ -137,4 +137,4 @@ Link. * `Id` - The ID of the OAuth client. * `OauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index 5ea05e661..3d2303f47 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -253,7 +253,7 @@ The `VcsRepo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `Identifier` string. * `Identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `OauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `GithubAppInstallationId` and can only be used if `GithubAppInstallationId` is not used. * `GithubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `OauthTokenId` and can only be used if `OauthTokenId` is not used. diff --git a/website/docs/cdktf/java/d/oauth_client.html.markdown b/website/docs/cdktf/java/d/oauth_client.html.markdown index 3c6c0a974..571a40b3d 100644 --- a/website/docs/cdktf/java/d/oauth_client.html.markdown +++ b/website/docs/cdktf/java/d/oauth_client.html.markdown @@ -78,7 +78,7 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, + must be one of: `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. diff --git a/website/docs/cdktf/java/r/oauth_client.html.markdown b/website/docs/cdktf/java/r/oauth_client.html.markdown index 10ffa2236..1244196e2 100644 --- a/website/docs/cdktf/java/r/oauth_client.html.markdown +++ b/website/docs/cdktf/java/r/oauth_client.html.markdown @@ -65,11 +65,11 @@ public class MyConvertedCode extends TerraformStack { } ``` -#### BitBucket Server Usage +#### BitBucket Data Center Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). -When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsaPublicKey`. +When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. ```java @@ -85,11 +85,11 @@ public class MyConvertedCode extends TerraformStack { .apiUrl("https://bbs.example.com") .httpUrl("https://bss.example.com") .key("") - .name("my-bbs-oauth-client") + .name("my-bbdc-oauth-client") .organization("my-org-name") .rsaPublicKey("-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----\n") .secret("-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----\n") - .serviceProvider("bitbucket_server") + .serviceProvider("bitbucket_data_center") ); } } @@ -109,15 +109,15 @@ The following arguments are supported: * `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server -Application Link. -* `rsaPublicKey` - (Required for `bitbucketServer`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application + * `secret` - (Required for `bitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your BitBucket Data Center + Application Link. +* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for BitBucket + Data Center in conjunction with the secret. Not used for any other providers. The +text of the SSH public key associated with your BitBucket Data Center Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, `github`, `githubEnterprise`, `gitlabHosted`, + options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`(deprecated), `bitbucketDataCenter`, `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. ## Attributes Reference diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 7b4570b1a..f86fac663 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -227,7 +227,7 @@ The `vcsRepo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 4aec1ba13..ba61be074 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -74,7 +74,7 @@ be set. * `oauth_client_id` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `service_provider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, + must be one of: `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index f739902ae..97945335e 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -63,11 +63,11 @@ class MyConvertedCode(cdktf.TerraformStack): ) ``` -#### BitBucket Server Usage +#### BitBucket Data Center Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). -When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsa_public_key`. +When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsa_public_key`. ```python @@ -80,14 +80,14 @@ class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) tfe.oauth_client.OauthClient(self, "test", - api_url="https://bbs.example.com", - http_url="https://bss.example.com", + api_url="https://bbdc.example.com", + http_url="https://bbdc.example.com", key="", - name="my-bbs-oauth-client", + name="my-bbdc-oauth-client", organization="my-org-name", rsa_public_key="-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----\n", secret="-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----\n", - service_provider="bitbucket_server" + service_provider="bitbucket_data_center" ) ``` @@ -105,15 +105,14 @@ The following arguments are supported: * `private_key` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server +* `secret` - (Required for `bitbucket_data_center`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `rsa_public_key` - (Required for `bitbucket_server`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application +* `rsa_public_key` - (Required for `bitbucket_data_center`) Required for Bitbucket Data Center in conjunction with the secret. Not used for any other providers. The +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `service_provider` - (Required) The VCS provider being connected with. Valid - options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, + options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. ## Attributes Reference diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 91e05ab11..ba6ce7c9f 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -206,7 +206,7 @@ The `vcs_repo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. @@ -239,4 +239,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index fd3cee123..5f3055d1e 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -83,7 +83,7 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, + must be one of: `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index da2e6cca5..e2e01ea5a 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -70,11 +70,11 @@ class MyConvertedCode extends cdktf.TerraformStack { ``` -#### BitBucket Server Usage +#### BitBucket Data Center Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). -When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsaPublicKey`. +When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. ```typescript @@ -87,16 +87,16 @@ class MyConvertedCode extends cdktf.TerraformStack { constructor(scope: constructs.Construct, name: string) { super(scope, name); new tfe.oauthClient.OauthClient(this, "test", { - apiUrl: "https://bbs.example.com", - httpUrl: "https://bss.example.com", + apiUrl: "https://bbdc.example.com", + httpUrl: "https://bbdc.example.com", key: "", - name: "my-bbs-oauth-client", + name: "my-bbdc-oauth-client", organization: "my-org-name", rsaPublicKey: "-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----\n", secret: "-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----\n", - serviceProvider: "bitbucket_server", + serviceProvider: "bitbucket_data_center", }); } } @@ -117,15 +117,15 @@ The following arguments are supported: * `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucketServer`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server +* `secret` - (Required for `bitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `rsaPublicKey` - (Required for `bitbucketServer`) Required for BitBucket +* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for BitBucket Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`, `github`, `githubEnterprise`, `gitlabHosted`, + options are `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. ## Attributes Reference diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 137232711..d20a71734 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -285,7 +285,7 @@ The `vcsRepo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauthTokenId` and can only be used if `oauthTokenId` is not used. diff --git a/website/docs/d/oauth_client.html.markdown b/website/docs/d/oauth_client.html.markdown index 0864c5bd6..aa0cd570f 100644 --- a/website/docs/d/oauth_client.html.markdown +++ b/website/docs/d/oauth_client.html.markdown @@ -48,7 +48,7 @@ be set. * `oauth_client_id` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `service_provider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, + must be one of: `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index a49da1736..c221114e9 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -45,11 +45,11 @@ resource "tfe_oauth_client" "test" { } ``` -#### BitBucket Server Usage +#### Bitbucket Data Center Usage See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsa_public_key`. +When using Bitbucket Data Center, you must use three required fields: `key`, `secret`, `rsa_public_key`. ```hcl @@ -79,15 +79,15 @@ The following arguments are supported: * `private_key` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for BitBucket Server, this secret is the - the text of the SSH private key associated with your BitBucket Server +* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center Application Link. * `rsa_public_key` - (Required for `bitbucket_server`) Required for BitBucket Server in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Server Application +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `service_provider` - (Required) The VCS provider being connected with. Valid - options are `ado_server`, `ado_services`, `bitbucket_hosted`, `bitbucket_server`, `github`, `github_enterprise`, `gitlab_hosted`, + options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. ## Attributes Reference diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index 548dcbed9..5762a2221 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -164,7 +164,7 @@ The `vcs_repo` block supports: For most VCS providers outside of BitBucket Cloud and Azure DevOps, this will match the `identifier` string. * `identifier` - (Required) A reference to your VCS repository in the format - `/` where `` and `` refer to the organization (or project key, for Bitbucket Server) + `/` where `` and `` refer to the organization (or project key, for Bitbucket Data Center) and repository in your VCS provider. The format for Azure DevOps is `//_git/`. * `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. * `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. From f9fe47297cb4372ab12938441ea0e3fd66b93adc Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 2 Apr 2024 16:03:02 +0800 Subject: [PATCH 319/420] Migrate run task datasources to plugin model This commit migrates the tfe_workspace_run_task and tfe_organization_run_task data sources to the newer plugin model. It uses the original schema so there are no changes to the user. --- .../data_source_organization_run_task.go | 151 +++++++++++++----- .../data_source_workspace_run_task.go | 123 ++++++++++---- internal/provider/provider.go | 2 - internal/provider/provider_next.go | 2 + 4 files changed, 200 insertions(+), 78 deletions(-) diff --git a/internal/provider/data_source_organization_run_task.go b/internal/provider/data_source_organization_run_task.go index b18b6e4ba..dc12d0e01 100644 --- a/internal/provider/data_source_organization_run_task.go +++ b/internal/provider/data_source_organization_run_task.go @@ -1,73 +1,142 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// NOTE: This is a legacy resource and should be migrated to the Plugin -// Framework if substantial modifications are planned. See -// docs/new-resources.md if planning to use this code as boilerplate for -// a new resource. - package provider import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "context" + "fmt" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceOrganizationRunTask{} + _ datasource.DataSourceWithConfigure = &dataSourceOrganizationRunTask{} ) -func dataSourceTFEOrganizationRunTask() *schema.Resource { - return &schema.Resource{ - Read: dataSourceTFEOrganizationRunTaskRead, +// TODO: This model, and the following conversion function, need to be kept the same as the Org. Run Task Resource +// (internal/provider/resource_tfe_organization_run_task.go) but it only differs by the HMAC Key. In the future we +// should put in a change to add HMAC Key into this model and then we can share the struct. And more importantly we +// we can use the later schema changes. +type modelDataTFEOrganizationRunTaskV0 struct { + Category types.String `tfsdk:"category"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Organization types.String `tfsdk:"organization"` + URL types.String `tfsdk:"url"` +} + +func dataModelFromTFEOrganizationRunTask(v *tfe.RunTask) modelDataTFEOrganizationRunTaskV0 { + result := modelDataTFEOrganizationRunTaskV0{ + Category: types.StringValue(v.Category), + Description: types.StringValue(v.Description), + Enabled: types.BoolValue(v.Enabled), + ID: types.StringValue(v.ID), + Name: types.StringValue(v.Name), + Organization: types.StringValue(v.Organization.Name), + URL: types.StringValue(v.URL), + } + + return result +} + +// NewOrganizationRunTaskDataSource is a helper function to simplify the provider implementation. +func NewOrganizationRunTaskDataSource() datasource.DataSource { + return &dataSourceOrganizationRunTask{} +} + +// dataSourceOrganizationRunTask is the data source implementation. +type dataSourceOrganizationRunTask struct { + config ConfiguredClient +} + +// Metadata returns the data source type name. +func (d *dataSourceOrganizationRunTask) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_organization_run_task" +} + +func (d *dataSourceOrganizationRunTask) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the task", + }, + "name": schema.StringAttribute{ Required: true, }, - - "organization": { - Type: schema.TypeString, + "organization": schema.StringAttribute{ Optional: true, }, - - "url": { - Type: schema.TypeString, + "url": schema.StringAttribute{ Optional: true, }, - - "category": { - Type: schema.TypeString, + "category": schema.StringAttribute{ Optional: true, }, - - "enabled": { - Type: schema.TypeBool, + "enabled": schema.BoolAttribute{ Optional: true, }, - - "description": { - Type: schema.TypeString, + "description": schema.StringAttribute{ Optional: true, }, }, } } -func dataSourceTFEOrganizationRunTaskRead(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) - name := d.Get("name").(string) - organization, err := config.schemaOrDefaultOrganization(d) - if err != nil { - return err +// Configure adds the provider configured client to the data source. +func (d *dataSourceOrganizationRunTask) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceOrganizationRunTask) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelDataTFEOrganizationRunTaskV0 + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } + + var organization string + resp.Diagnostics.Append(d.config.dataOrDefaultOrganization(ctx, req.Config, &organization)...) + if resp.Diagnostics.HasError() { + return } - task, err := fetchOrganizationRunTask(name, organization, config.Client) + task, err := fetchOrganizationRunTask(data.Name.ValueString(), organization, d.config.Client) if err != nil { - return err + resp.Diagnostics.AddError("Error reading Organization Run Task", + fmt.Sprintf("Could not read Run Task %q in organization %q, unexpected error: %s", data.Name.String(), organization, err.Error()), + ) + return } - d.Set("url", task.URL) - d.Set("category", task.Category) - d.Set("enabled", task.Enabled) - d.Set("description", task.Description) - d.SetId(task.ID) + // We can never read the HMACkey (Write-only) so assume it's the default (empty) + result := dataModelFromTFEOrganizationRunTask(task) - return nil + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } diff --git a/internal/provider/data_source_workspace_run_task.go b/internal/provider/data_source_workspace_run_task.go index 7352ffa69..b6f78e4ba 100644 --- a/internal/provider/data_source_workspace_run_task.go +++ b/internal/provider/data_source_workspace_run_task.go @@ -1,74 +1,117 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// NOTE: This is a legacy resource and should be migrated to the Plugin -// Framework if substantial modifications are planned. See -// docs/new-resources.md if planning to use this code as boilerplate for -// a new resource. - package provider import ( + "context" "fmt" - "github.com/hashicorp/go-tfe" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" +) + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &dataSourceWorkspaceRunTask{} + _ datasource.DataSourceWithConfigure = &dataSourceWorkspaceRunTask{} ) -func dataSourceTFEWorkspaceRunTask() *schema.Resource { - return &schema.Resource{ - Read: dataSourceTFEWorkspaceRunTaskRead, +// NewWorkspaceRunTaskDataSource is a helper function to simplify the provider implementation. +func NewWorkspaceRunTaskDataSource() datasource.DataSource { + return &dataSourceWorkspaceRunTask{} +} - Schema: map[string]*schema.Schema{ - "workspace_id": { +// dataSourceWorkspaceRunTask is the data source implementation. +type dataSourceWorkspaceRunTask struct { + config ConfiguredClient +} + +// Metadata returns the data source type name. +func (d *dataSourceWorkspaceRunTask) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_workspace_run_task" +} + +func (d *dataSourceWorkspaceRunTask) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "Service-generated identifier for the task", + Computed: true, + }, + "workspace_id": schema.StringAttribute{ Description: "The id of the workspace.", - Type: schema.TypeString, Required: true, }, - - "task_id": { + "task_id": schema.StringAttribute{ Description: "The id of the run task.", - Type: schema.TypeString, Required: true, }, - - "enforcement_level": { + "enforcement_level": schema.StringAttribute{ Description: "The enforcement level of the task.", - Type: schema.TypeString, Computed: true, }, - - "stage": { + "stage": schema.StringAttribute{ Description: "Which stage the task will run in.", - Type: schema.TypeString, Computed: true, }, }, } } -func dataSourceTFEWorkspaceRunTaskRead(d *schema.ResourceData, meta interface{}) error { - config := meta.(ConfiguredClient) +// Configure adds the provider configured client to the data source. +func (d *dataSourceWorkspaceRunTask) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) - workspaceID := d.Get("workspace_id").(string) - taskID := d.Get("task_id").(string) + return + } + d.config = client +} + +// Read refreshes the Terraform state with the latest data. +func (d *dataSourceWorkspaceRunTask) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelTFEWorkspaceRunTaskV0 + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } + + workspaceID := data.WorkspaceID.ValueString() + taskID := data.TaskID.ValueString() + var wstask *tfe.WorkspaceRunTask = nil // Create an options struct. options := &tfe.WorkspaceRunTaskListOptions{} for { - list, err := config.Client.WorkspaceRunTasks.List(ctx, workspaceID, options) + list, err := d.config.Client.WorkspaceRunTasks.List(ctx, workspaceID, options) if err != nil { - return fmt.Errorf("Error retrieving tasks for workspace %s: %w", workspaceID, err) + resp.Diagnostics.AddError("Error retrieving tasks for workspace", + fmt.Sprintf("Error retrieving tasks for workspace %s: %s", workspaceID, err.Error()), + ) + return } - for _, wstask := range list.Items { - if wstask.RunTask.ID == taskID { - d.Set("enforcement_level", string(wstask.EnforcementLevel)) - d.Set("stage", string(wstask.Stage)) - d.SetId(wstask.ID) - return nil + for _, item := range list.Items { + if item.RunTask.ID == taskID { + wstask = item + break } } + if wstask != nil { + break + } // Exit the loop when we've seen all pages. if list.CurrentPage >= list.TotalPages { @@ -79,5 +122,15 @@ func dataSourceTFEWorkspaceRunTaskRead(d *schema.ResourceData, meta interface{}) options.PageNumber = list.NextPage } - return fmt.Errorf("could not find workspace run task %s in workspace %s", taskID, workspaceID) + if wstask == nil { + resp.Diagnostics.AddError("Error reading Workspace Run Task", + fmt.Sprintf("Could not find task %q in workspace %q", taskID, workspaceID), + ) + return + } + + result := modelFromTFEWorkspaceRunTask(wstask) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 6713a06f8..d2c7d2a4c 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -86,7 +86,6 @@ func Provider() *schema.Provider { "tfe_ip_ranges": dataSourceTFEIPRanges(), "tfe_oauth_client": dataSourceTFEOAuthClient(), "tfe_organization_membership": dataSourceTFEOrganizationMembership(), - "tfe_organization_run_task": dataSourceTFEOrganizationRunTask(), "tfe_organization_tags": dataSourceTFEOrganizationTags(), "tfe_project": dataSourceTFEProject(), "tfe_slug": dataSourceTFESlug(), @@ -97,7 +96,6 @@ func Provider() *schema.Provider { "tfe_team_project_access": dataSourceTFETeamProjectAccess(), "tfe_workspace": dataSourceTFEWorkspace(), "tfe_workspace_ids": dataSourceTFEWorkspaceIDs(), - "tfe_workspace_run_task": dataSourceTFEWorkspaceRunTask(), "tfe_variables": dataSourceTFEWorkspaceVariables(), "tfe_variable_set": dataSourceTFEVariableSet(), "tfe_policy_set": dataSourceTFEPolicySet(), diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 9cca9d601..1010f00c7 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -123,12 +123,14 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ + NewOrganizationRunTaskDataSource, NewRegistryGPGKeyDataSource, NewRegistryGPGKeysDataSource, NewRegistryProviderDataSource, NewRegistryProvidersDataSource, NewNoCodeModuleDataSource, NewSAMLSettingsDataSource, + NewWorkspaceRunTaskDataSource, } } From b7401d1fb2bbb420a96f542c5df03b8d924343c7 Mon Sep 17 00:00:00 2001 From: Carolina Borim Date: Fri, 5 Apr 2024 07:19:08 +0200 Subject: [PATCH 320/420] Add post_plan to list of stages and upgrades the version of go-tfe to latest released. --- go.mod | 2 +- go.sum | 2 ++ internal/provider/resource_tfe_workspace_run_task.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1063d676f..bb59f73ec 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.14.0 - github.com/hashicorp/go-tfe v1.47.1 + github.com/hashicorp/go-tfe v1.49.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index ae71b5576..faf721608 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWq github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.47.1 h1:+DkqcPK6RGEsCC34vFau8/yOky4ST84o8AFdB6NbrJg= github.com/hashicorp/go-tfe v1.47.1/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= +github.com/hashicorp/go-tfe v1.49.0 h1:HIxG/fwjXoZ5M4EQZcZkgYFCJkWtbsT9T/x71HQr5kw= +github.com/hashicorp/go-tfe v1.49.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= diff --git a/internal/provider/resource_tfe_workspace_run_task.go b/internal/provider/resource_tfe_workspace_run_task.go index 58c39a651..416510920 100644 --- a/internal/provider/resource_tfe_workspace_run_task.go +++ b/internal/provider/resource_tfe_workspace_run_task.go @@ -34,6 +34,7 @@ func workspaceRunTaskStages() []string { string(tfe.PrePlan), string(tfe.PostPlan), string(tfe.PreApply), + string(tfe.PostApply), } } From ee2d69a7c1d06d60bb5c788f20d612246eb394cb Mon Sep 17 00:00:00 2001 From: Carolina Borim Date: Fri, 5 Apr 2024 07:28:50 +0200 Subject: [PATCH 321/420] Updates Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d926f8156..b83d35853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## UNRELEASED - +### Enhancements +* Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) ## v0.53.0 FEATURES: From dce839df75b32b2099343fb5f742c3f28ea3c9b6 Mon Sep 17 00:00:00 2001 From: Carolina Borim Date: Fri, 5 Apr 2024 07:46:45 +0200 Subject: [PATCH 322/420] Adds mocks for methods introduced on go-tfe v1.48.0 --- internal/provider/client_mock_workspaces_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/provider/client_mock_workspaces_test.go b/internal/provider/client_mock_workspaces_test.go index d7c01b859..77287362b 100644 --- a/internal/provider/client_mock_workspaces_test.go +++ b/internal/provider/client_mock_workspaces_test.go @@ -184,3 +184,13 @@ func (m *mockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceI func (m *mockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented") } + +func (m *mockWorkspaces) ReadDataRetentionPolicyChoice(ctx context.Context, organization string) (*tfe.DataRetentionPolicyChoice, error) { + panic("not implemented") +} +func (m *mockWorkspaces) SetDataRetentionPolicyDeleteOlder(ctx context.Context, organization string, options tfe.DataRetentionPolicyDeleteOlderSetOptions) (*tfe.DataRetentionPolicyDeleteOlder, error) { + panic("not implemented") +} +func (m *mockWorkspaces) SetDataRetentionPolicyDontDelete(ctx context.Context, organization string, options tfe.DataRetentionPolicyDontDeleteSetOptions) (*tfe.DataRetentionPolicyDontDelete, error) { + panic("not implemented") +} From 1d7b4788b62f42d6ae510c82b72b349e409c9f89 Mon Sep 17 00:00:00 2001 From: Carolina Borim Date: Fri, 5 Apr 2024 08:08:41 +0200 Subject: [PATCH 323/420] Address linting problems --- internal/provider/client_mock_workspaces_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/provider/client_mock_workspaces_test.go b/internal/provider/client_mock_workspaces_test.go index 77287362b..753ea5287 100644 --- a/internal/provider/client_mock_workspaces_test.go +++ b/internal/provider/client_mock_workspaces_test.go @@ -177,10 +177,12 @@ func (m *mockWorkspaces) DeleteDataRetentionPolicy(ctx context.Context, workspac panic("not implemented") } +//nolint:staticcheck // This method still needs to be implemented even though deprecated func (m *mockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*tfe.DataRetentionPolicy, error) { panic("not implemented") } +//nolint:staticcheck // This method still needs to be implemented even though deprecated func (m *mockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented") } From 8a4bfaf27a8a4695c973c59adb1916bc4ea7b141 Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:06:36 -0400 Subject: [PATCH 324/420] Update resource_tfe_oauth_client_test.go --- internal/provider/resource_tfe_oauth_client_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index 94daf1ea2..bb1f23119 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -45,8 +45,7 @@ func TestAccTFEOAuthClient_basic(t *testing.T) { }) } -func TestAccTFEOAuthClientWithOrganizationScoped_basic(t *testing.T) { - skipUnlessBeta(t) +func TestAccTFEOAuthClientWithOrganizationScoped_basic(t *testing.T) { oc := &tfe.OAuthClient{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() From f53d2b7f7cc87cb02d952be272d3ce3eaf278f20 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Mon, 8 Apr 2024 11:05:39 -0400 Subject: [PATCH 325/420] lint error fixed --- internal/provider/resource_tfe_oauth_client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index bb1f23119..d2495e106 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -45,7 +45,7 @@ func TestAccTFEOAuthClient_basic(t *testing.T) { }) } -func TestAccTFEOAuthClientWithOrganizationScoped_basic(t *testing.T) { +func TestAccTFEOAuthClientWithOrganizationScoped_basic(t *testing.T) { oc := &tfe.OAuthClient{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() From 66eafb9d6ebb231fa2072884fafa7f8242909759 Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:35:37 -0400 Subject: [PATCH 326/420] Update resource_tfe_project_oauth_client_test.go removed beta tests --- internal/provider/resource_tfe_project_oauth_client_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/provider/resource_tfe_project_oauth_client_test.go b/internal/provider/resource_tfe_project_oauth_client_test.go index 73f43c094..5ba471f56 100644 --- a/internal/provider/resource_tfe_project_oauth_client_test.go +++ b/internal/provider/resource_tfe_project_oauth_client_test.go @@ -15,8 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccTFEProjectOAuthClient_basic(t *testing.T) { - skipUnlessBeta(t) +func TestAccTFEProjectOAuthClient_basic(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -57,8 +56,7 @@ func TestAccTFEProjectOAuthClient_basic(t *testing.T) { }) } -func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { - skipUnlessBeta(t) +func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() From 2ef561d1ebc2033f32305149146caaca8c9050fa Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Tue, 9 Apr 2024 15:47:41 -0400 Subject: [PATCH 327/420] lint error fixed --- internal/provider/resource_tfe_project_oauth_client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_project_oauth_client_test.go b/internal/provider/resource_tfe_project_oauth_client_test.go index 5ba471f56..98914fc9f 100644 --- a/internal/provider/resource_tfe_project_oauth_client_test.go +++ b/internal/provider/resource_tfe_project_oauth_client_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccTFEProjectOAuthClient_basic(t *testing.T) { +func TestAccTFEProjectOAuthClient_basic(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -56,7 +56,7 @@ func TestAccTFEProjectOAuthClient_basic(t *testing.T) { }) } -func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { +func TestAccTFEProjectOAuthClient_incorrectImportSyntax(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() From a3c9d508bccd6a3da67a53918e224ec7304f11b6 Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:25:56 -0400 Subject: [PATCH 328/420] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 997085002..e60d2027a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ ## UNRELEASED ### Enhancements * Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) + +### Features * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) + ## v0.53.0 FEATURES: From 0b2089710f6c4e0ecedda35d46cda9a4d4d189df Mon Sep 17 00:00:00 2001 From: Netra Mali <104793044+netramali@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:00:09 -0400 Subject: [PATCH 329/420] Update data_source_project_test.go --- internal/provider/data_source_project_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/data_source_project_test.go b/internal/provider/data_source_project_test.go index 463f7de3a..0af8c0bb6 100644 --- a/internal/provider/data_source_project_test.go +++ b/internal/provider/data_source_project_test.go @@ -13,7 +13,6 @@ import ( ) func TestAccTFEProjectDataSource_basic(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() orgName := fmt.Sprintf("tst-terraform-%d", rInt) From 4384dfed9de01c3a0a84c8660f48e19b7355aef0 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Wed, 10 Apr 2024 11:31:25 -0400 Subject: [PATCH 330/420] beta test --- internal/provider/resource_tfe_project_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index f2349bcdc..e77f03ea7 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -17,7 +17,6 @@ import ( ) func TestAccTFEProject_basic(t *testing.T) { - skipUnlessBeta(t) project := &tfe.Project{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -65,7 +64,6 @@ func TestAccTFEProject_invalidName(t *testing.T) { } func TestAccTFEProject_update(t *testing.T) { - skipUnlessBeta(t) project := &tfe.Project{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -103,7 +101,6 @@ func TestAccTFEProject_update(t *testing.T) { } func TestAccTFEProject_import(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() project := &tfe.Project{} resource.Test(t, resource.TestCase{ From 05223be21ab7f3684d3e39fb135b1567be140c56 Mon Sep 17 00:00:00 2001 From: Barrett Clark Date: Tue, 16 Apr 2024 14:14:36 -0500 Subject: [PATCH 331/420] Add Heimdall Summary Info --- META.d/_summary.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 META.d/_summary.yaml diff --git a/META.d/_summary.yaml b/META.d/_summary.yaml new file mode 100644 index 000000000..4bdec6a9d --- /dev/null +++ b/META.d/_summary.yaml @@ -0,0 +1,10 @@ +--- + +schema: 1.1 +partition: tfc +category: library + +summary: + owner: team-tf-cli + description: Official Terraform Cloud/Enterprise provider, maintained by HashiCorp. Provision Terraform Cloud or Terraform Enterprise - with Terraform! + visibility: external From f0d5d7a99fabd7313586f363e32b163adcd7e7e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:21:18 -0400 Subject: [PATCH 332/420] Build(deps): Bump peter-evans/create-pull-request from 6.0.2 to 6.0.4 (#1314) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.2 to 6.0.4. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/70a41aba780001da0a30141984ae2a0c95d8704e...9153d834b60caba6d51c9b9510b087acf9f33f83) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 53694e3c0..46d9ac220 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -102,7 +102,7 @@ jobs: TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins - name: Create Pull Request - uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2 + uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83 # v6.0.4 with: commit-message: "cdktf: update documentation" title: "release: ${{ github.event.inputs.version }}" From d90b9776254ecb7260a62b33c42191135a82b124 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:31:44 -0400 Subject: [PATCH 333/420] Build(deps): Bump github.com/hashicorp/go-slug from 0.14.0 to 0.15.0 (#1317) Bumps [github.com/hashicorp/go-slug](https://github.com/hashicorp/go-slug) from 0.14.0 to 0.15.0. - [Release notes](https://github.com/hashicorp/go-slug/releases) - [Commits](https://github.com/hashicorp/go-slug/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-slug dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index bb59f73ec..7c11880af 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect - github.com/hashicorp/go-slug v0.14.0 + github.com/hashicorp/go-slug v0.15.0 github.com/hashicorp/go-tfe v1.49.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 diff --git a/go.sum b/go.sum index faf721608..67d343123 100644 --- a/go.sum +++ b/go.sum @@ -67,10 +67,8 @@ github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDm github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-slug v0.14.0 h1:/aZdUDjR74TSlsQp3hA9nqhCQkQHAUr2jjtuUfWqI9E= -github.com/hashicorp/go-slug v0.14.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.47.1 h1:+DkqcPK6RGEsCC34vFau8/yOky4ST84o8AFdB6NbrJg= -github.com/hashicorp/go-tfe v1.47.1/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= +github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMmZhI= +github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.49.0 h1:HIxG/fwjXoZ5M4EQZcZkgYFCJkWtbsT9T/x71HQr5kw= github.com/hashicorp/go-tfe v1.49.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 01d9572ee89f7083cef3734ee1ffc59b648ca6f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:36:09 -0400 Subject: [PATCH 334/420] Build(deps): Bump golang.org/x/net from 0.20.0 to 0.23.0 (#1318) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.20.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.20.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7c11880af..3d4a5eaad 100644 --- a/go.mod +++ b/go.mod @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/zclconf/go-cty v1.14.4 - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.20.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index 67d343123..b70902c1b 100644 --- a/go.sum +++ b/go.sum @@ -173,8 +173,8 @@ github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgr golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= @@ -184,8 +184,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -209,8 +209,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 771c5ad91fe834bf45cf9af7d7a6c9df4d3faa50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:11:36 -0400 Subject: [PATCH 335/420] Build(deps): Bump github.com/hashicorp/terraform-plugin-framework (#1320) Bumps [github.com/hashicorp/terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 3d4a5eaad..be30a5156 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/agext/levenshtein v1.2.3 // indirect github.com/fatih/color v1.16.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect @@ -16,9 +16,9 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect - github.com/hashicorp/terraform-plugin-framework v1.7.0 + github.com/hashicorp/terraform-plugin-framework v1.8.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.22.1 + github.com/hashicorp/terraform-plugin-go v0.22.2 github.com/hashicorp/terraform-plugin-mux v0.15.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hashicorp/terraform-svchost v0.1.1 @@ -27,7 +27,7 @@ require ( github.com/zclconf/go-cty v1.14.4 golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect @@ -56,7 +56,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/grpc v1.63.2 // indirect ) require ( @@ -77,7 +77,7 @@ require ( github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.15.0 // indirect golang.org/x/sync v0.6.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b70902c1b..c5a424e19 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+Licev github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -90,12 +90,12 @@ github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8J github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-framework v1.7.0 h1:wOULbVmfONnJo9iq7/q+iBOBJul5vRovaYJIu2cY/Pw= -github.com/hashicorp/terraform-plugin-framework v1.7.0/go.mod h1:jY9Id+3KbZ17OMpulgnWLSfwxNVYSoYBQFTgsx044CI= +github.com/hashicorp/terraform-plugin-framework v1.8.0 h1:P07qy8RKLcoBkCrY2RHJer5AEvJnDuXomBgou6fD8kI= +github.com/hashicorp/terraform-plugin-framework v1.8.0/go.mod h1:/CpTukO88PcL/62noU7cuyaSJ4Rsim+A/pa+3rUVufY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= -github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= +github.com/hashicorp/terraform-plugin-go v0.22.2 h1:5o8uveu6eZUf5J7xGPV0eY0TPXg3qpmwX9sce03Bxnc= +github.com/hashicorp/terraform-plugin-go v0.22.2/go.mod h1:drq8Snexp9HsbFZddvyLHN6LuWHHndSQg+gV+FPkcIM= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-mux v0.15.0 h1:+/+lDx0WUsIOpkAmdwBIoFU8UP9o2eZASoOnLsWbKME= @@ -186,8 +186,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -235,10 +235,10 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= From 774a5650e3d45a938d713a974abcfe79b022fcff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:52:43 -0400 Subject: [PATCH 336/420] Build(deps): Bump actions/upload-artifact from 4.3.1 to 4.3.2 (#1321) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/5d5d22a31266ced268874388b861e4b58bb5c2f3...1746f4ab65b179e0ea60a494b83293b640dd5bba) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e841ca4e..0bbefa453 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 46d9ac220..29668d197 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e45101d3f..a25e5c0a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: release-notes path: release-notes.txt From b719418ca2264f281dc38322f103a8da5fa48073 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:52:23 -0400 Subject: [PATCH 337/420] Build(deps): Bump slackapi/slack-github-action from 1.25.0 to 1.26.0 (#1323) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/6c661ce58804a1a20f6dc5fbee7f0381b469e001...70cd7be8e40a46e8b0eced40b0de447bdb42f68e) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/nightly-tfe-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index e4495da06..98e555719 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: payload: | { From 93fed8b80620c2a2c80e2f86bcc8e3bbfea3167d Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Fri, 19 Apr 2024 17:07:02 -0400 Subject: [PATCH 338/420] correct resource name in import doc --- website/docs/r/organization_default_settings.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/organization_default_settings.html.markdown b/website/docs/r/organization_default_settings.html.markdown index 72f4c3882..04bdee476 100644 --- a/website/docs/r/organization_default_settings.html.markdown +++ b/website/docs/r/organization_default_settings.html.markdown @@ -54,5 +54,5 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` From e8bbfd2ce984585223bc55f3915a650d06ab83d2 Mon Sep 17 00:00:00 2001 From: Netra Mali <42544158+Netra2104@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:59:48 -0400 Subject: [PATCH 339/420] TF-9703 project_ids and organization_scoped to oauth client (#1148) * init * markdown changes * changelog * Update data_source_oauth_client_test.go * Update data_source_oauth_client_test.go * test fix --------- Co-authored-by: Netra Mali Co-authored-by: Netra Mali <104793044+netramali@users.noreply.github.com> --- CHANGELOG.md | 4 +- internal/provider/data_source_oauth_client.go | 16 +++++ .../provider/data_source_oauth_client_test.go | 65 +++++++++++++++++++ website/docs/d/oauth_client.html.markdown | 2 + 4 files changed, 86 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e60d2027a..09640e772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,10 @@ * Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) ### Features +* `d/tfe_oauth_client`: Add `project_ids` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) +* `d/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) - + ## v0.53.0 FEATURES: diff --git a/internal/provider/data_source_oauth_client.go b/internal/provider/data_source_oauth_client.go index 5f977dca2..6c4f92cf2 100644 --- a/internal/provider/data_source_oauth_client.go +++ b/internal/provider/data_source_oauth_client.go @@ -80,6 +80,15 @@ func dataSourceTFEOAuthClient() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "organization_scoped": { + Type: schema.TypeBool, + Computed: true, + }, + "project_ids": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + }, }, } } @@ -132,6 +141,7 @@ func dataSourceTFEOAuthClientRead(d *schema.ResourceData, meta interface{}) erro } d.Set("service_provider", oc.ServiceProvider) d.Set("service_provider_display_name", oc.ServiceProviderName) + d.Set("organization_scoped", oc.OrganizationScoped) switch len(oc.OAuthTokens) { case 0: @@ -142,5 +152,11 @@ func dataSourceTFEOAuthClientRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("unexpected number of OAuth tokens: %d", len(oc.OAuthTokens)) } + var projectIDs []interface{} + for _, project := range oc.Projects { + projectIDs = append(projectIDs, project.ID) + } + d.Set("project_ids", projectIDs) + return nil } diff --git a/internal/provider/data_source_oauth_client_test.go b/internal/provider/data_source_oauth_client_test.go index b9df39804..562289096 100644 --- a/internal/provider/data_source_oauth_client_test.go +++ b/internal/provider/data_source_oauth_client_test.go @@ -20,6 +20,28 @@ func testAccTFEOAuthClientDataSourcePreCheck(t *testing.T) { } } +func TestAccTFEOAuthClientDataSource_basic(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccTFEOAuthClientDataSourcePreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEOAuthClientDataSourceConfig_basic(rInt), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tfe_oauth_client.client", "id"), + resource.TestCheckResourceAttr( + "data.tfe_oauth_client.client", "organization_scoped", "true"), + resource.TestCheckResourceAttr( + "data.tfe_oauth_client.client", "project_ids.#", "1"), + ), + }, + }, + }, + ) +} + func TestAccTFEOAuthClientDataSource_findByID(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -41,6 +63,9 @@ func TestAccTFEOAuthClientDataSource_findByID(t *testing.T) { resource.TestCheckResourceAttrPair( "tfe_oauth_client.test", "oauth_token_id", "data.tfe_oauth_client.client", "oauth_token_id"), + resource.TestCheckResourceAttrPair( + "tfe_oauth_client.test", "organization_scoped", + "data.tfe_oauth_client.client", "organization_scoped"), ), }, }, @@ -68,6 +93,9 @@ func TestAccTFEOAuthClientDataSource_findByName(t *testing.T) { resource.TestCheckResourceAttrPair( "tfe_oauth_client.test", "oauth_token_id", "data.tfe_oauth_client.client", "oauth_token_id"), + resource.TestCheckResourceAttrPair( + "tfe_oauth_client.test", "organization_scoped", + "data.tfe_oauth_client.client", "organization_scoped"), ), }, }, @@ -185,6 +213,41 @@ func TestAccTFEOAuthClientDataSource_sameServiceProvider(t *testing.T) { }) } +func testAccTFEOAuthClientDataSourceConfig_basic(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_project" "foobar" { + name = "project-foo-%d" + organization = tfe_organization.foobar.name +} + +resource "tfe_oauth_client" "test" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" + organization_scoped = true +} + +resource "tfe_project_oauth_client" "foobar" { + oauth_client_id = tfe_oauth_client.test.id + project_id = tfe_project.foobar.id +} + +data "tfe_oauth_client" "client" { + name = tfe_oauth_client.test.name + organization = tfe_organization.foobar.name + oauth_client_id = tfe_oauth_client.test.id + depends_on=[tfe_project_oauth_client.foobar] +} +`, rInt, rInt, envGithubToken) +} + func testAccTFEOAuthClientDataSourceConfig_findByID(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { @@ -197,6 +260,7 @@ resource "tfe_oauth_client" "test" { http_url = "https://github.com" oauth_token = "%s" service_provider = "github" + organization_scoped = true } data "tfe_oauth_client" "client" { oauth_client_id = tfe_oauth_client.test.id @@ -217,6 +281,7 @@ resource "tfe_oauth_client" "test" { name = "tst-github-%d" oauth_token = "%s" service_provider = "github" + organization_scoped = true } data "tfe_oauth_client" "client" { organization = "tst-terraform-%d" diff --git a/website/docs/d/oauth_client.html.markdown b/website/docs/d/oauth_client.html.markdown index 0864c5bd6..3488a8a61 100644 --- a/website/docs/d/oauth_client.html.markdown +++ b/website/docs/d/oauth_client.html.markdown @@ -66,3 +66,5 @@ In addition to all arguments above, the following attributes are exported: * `organization` - The organization in which the OAuth client is registered. * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. +* `organization_scoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `project_ids` - IDs of the projects that use the oauth client. \ No newline at end of file From 48690fc1ea333a24a3ad6799ef9b34bea0e47136 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:37:08 -0400 Subject: [PATCH 340/420] Build(deps): Bump actions/checkout from 4.1.2 to 4.1.3 (#1327) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9bb56186c3b09b4f86b1c65136769dd318469633...1d96c772d19495a3b5c517cd2bc0cb401ea0529f) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bbefa453..6141ff32a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 29668d197..d42655811 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index aeb2998af..c63b6591b 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 98e555719..495b90ffb 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a25e5c0a9..c4bc31d14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 with: fetch-depth: 0 - name: Generate Release Notes From 070639083d368e32be795ad80fd3a28475f064e7 Mon Sep 17 00:00:00 2001 From: Abdurahman Abdelgany <42511430+aaabdelgany@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:39:50 -0400 Subject: [PATCH 341/420] Add support for tfe test environment variables (#1285) --- CHANGELOG.md | 1 + internal/provider/provider_next.go | 1 + .../provider/resource_tfe_test_variable.go | 358 ++++++++++++++++++ .../resource_tfe_test_variable_test.go | 286 ++++++++++++++ .../docs/r/tfe_test_variable.html.markdown | 51 +++ 5 files changed, 697 insertions(+) create mode 100644 internal/provider/resource_tfe_test_variable.go create mode 100644 internal/provider/resource_tfe_test_variable_test.go create mode 100644 website/docs/r/tfe_test_variable.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 09640e772..702242a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * `d/tfe_oauth_client`: Add `project_ids` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * `d/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) +* **New Resource**: `r/tfe_test_variable` is a new resource for creating environment variables used by registry modules for terraform test, by @aaabdelgany [1285](https://github.com/hashicorp/terraform-provider-tfe/pull/1285) ## v0.53.0 diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 1010f00c7..83e74b573 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -142,6 +142,7 @@ func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Res NewResourceVariable, NewResourceWorkspaceSettings, NewSAMLSettingsResource, + NewTestVariableResource, NewWorkspaceRunTaskResource, } } diff --git a/internal/provider/resource_tfe_test_variable.go b/internal/provider/resource_tfe_test_variable.go new file mode 100644 index 000000000..a4e91d8ee --- /dev/null +++ b/internal/provider/resource_tfe_test_variable.go @@ -0,0 +1,358 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "errors" + "fmt" + "log" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +type resourceTFETestVariable struct { + config ConfiguredClient +} + +func NewTestVariableResource() resource.Resource { + return &resourceTFETestVariable{} +} + +// modelTFETestVariable maps the resource schema data to a struct. +type modelTFETestVariable struct { + ID types.String `tfsdk:"id"` + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` + ReadableValue types.String `tfsdk:"readable_value"` + Category types.String `tfsdk:"category"` + Description types.String `tfsdk:"description"` + HCL types.Bool `tfsdk:"hcl"` + Sensitive types.Bool `tfsdk:"sensitive"` + Organization types.String `tfsdk:"organization"` + ModuleName types.String `tfsdk:"module_name"` + ModuleProvider types.String `tfsdk:"module_provider"` +} + +// modelFromTFETestVariable builds a modelTFETestVariable struct from a tfe.TestVariable +// value (plus the last known value of the variable's `value` attribute). +func modelFromTFETestVariable(v tfe.Variable, lastValue types.String, moduleID tfe.RegistryModuleID) modelTFETestVariable { + // Initialize all fields from the provided API struct + m := modelTFETestVariable{ + ID: types.StringValue(v.ID), + Key: types.StringValue(v.Key), + Value: types.StringValue(v.Value), + Category: types.StringValue(string(v.Category)), + Description: types.StringValue(v.Description), + HCL: types.BoolValue(v.HCL), + Sensitive: types.BoolValue(v.Sensitive), + Organization: types.StringValue(moduleID.Organization), + ModuleName: types.StringValue(moduleID.Name), + ModuleProvider: types.StringValue(moduleID.Provider), + } + // BUT: if the variable is sensitive, carry forward the last known value + // instead, because the API never lets us read it again. + if v.Sensitive { + m.Value = lastValue + m.ReadableValue = types.StringNull() + } else { + m.ReadableValue = m.Value + } + return m +} + +// Configure implements resource.ResourceWithConfigure +func (r *resourceTFETestVariable) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Early exit if provider is unconfigured (i.e. we're only validating config or something) + if req.ProviderData == nil { + return + } + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +// Metadata implements resource.Resource +func (r *resourceTFETestVariable) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = "tfe_test_variable" +} + +// Schema implements resource.Resource +func (r *resourceTFETestVariable) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the variable", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "key": schema.StringAttribute{ + Required: true, + Description: "Name of the variable.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplaceIf( + func(ctx context.Context, req planmodifier.StringRequest, resp *stringplanmodifier.RequiresReplaceIfFuncResponse) { + var stateSensitive types.Bool + diags := req.State.GetAttribute(ctx, path.Root("sensitive"), &stateSensitive) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + if stateSensitive.ValueBool() && req.PlanValue.ValueString() != req.StateValue.ValueString() { + resp.RequiresReplace = true + } + }, + "Force replacement if key changed and sensitive is true", + "Force replacement if key changed and sensitive is true", + ), + }, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), + Sensitive: true, + Description: "Value of the variable", + }, + "category": schema.StringAttribute{ + Required: true, + Description: `Whether this is a Terraform or environment variable. Valid values are "terraform" or "env".`, + Validators: []validator.String{ + stringvalidator.OneOf( + string(tfe.CategoryEnv), + ), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), + }, + "hcl": schema.BoolAttribute{ + Optional: true, + Computed: true, + Default: booldefault.StaticBool(false), + }, + "sensitive": schema.BoolAttribute{ + Optional: true, + Computed: true, + Default: booldefault.StaticBool(false), + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.RequiresReplaceIf( + func(ctx context.Context, req planmodifier.BoolRequest, resp *boolplanmodifier.RequiresReplaceIfFuncResponse) { + if req.StateValue.ValueBool() && !req.ConfigValue.ValueBool() { + resp.RequiresReplace = true + } + }, + "Force replacement if sensitive argument changed from true to false.", + "Force replacement if sensitive argument changed from true to false.", + ), + }, + }, + "organization": schema.StringAttribute{ + Required: true, + }, + "module_name": schema.StringAttribute{ + Required: true, + }, + "module_provider": schema.StringAttribute{ + Required: true, + }, + "readable_value": schema.StringAttribute{ + Computed: true, + Description: "A non-sensitive read-only copy of the variable value, which can be viewed or referenced " + + "in plan outputs without being redacted. Will only be present if the variable is not sensitive", + PlanModifiers: []planmodifier.String{ + &updateReadableValuePlanModifier{}, + }, + }, + }, + Description: "", + MarkdownDescription: "", + DeprecationMessage: "", + Version: 1, + } +} + +func (r *resourceTFETestVariable) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data modelTFETestVariable + diags := req.Plan.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + key := data.Key.ValueString() + category := data.Category.ValueString() + moduleID := tfe.RegistryModuleID{ + Organization: data.Organization.ValueString(), + Name: data.ModuleName.ValueString(), + Provider: data.ModuleProvider.ValueString(), + Namespace: data.Organization.ValueString(), + RegistryName: "private", + } + + options := tfe.VariableCreateOptions{ + Key: data.Key.ValueStringPointer(), + Value: data.Value.ValueStringPointer(), + Category: tfe.Category(tfe.CategoryType(category)), + HCL: data.HCL.ValueBoolPointer(), + Sensitive: data.Sensitive.ValueBoolPointer(), + Description: data.Description.ValueStringPointer(), + } + + tflog.Debug(ctx, fmt.Sprintf("Create %s variable: %s", category, key)) + variable, err := r.config.Client.TestVariables.Create(ctx, moduleID, options) + if err != nil { + resp.Diagnostics.AddError( + "Error creating variable", + fmt.Sprintf("Couldn't create %s variable %s: %s", category, key, err.Error()), + ) + return + } + + // We got a variable, so set state to new values + result := modelFromTFETestVariable(*variable, data.Value, moduleID) + diags = resp.State.Set(ctx, &result) + resp.Diagnostics.Append(diags...) +} + +func (r *resourceTFETestVariable) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data modelTFETestVariable + + diags := req.State.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + moduleID := tfe.RegistryModuleID{ + Organization: data.Organization.ValueString(), + Name: data.ModuleName.ValueString(), + Provider: data.ModuleProvider.ValueString(), + Namespace: data.Organization.ValueString(), + RegistryName: "private", + } + + variableID := data.ID.ValueString() + variable, err := r.config.Client.TestVariables.Read(ctx, moduleID, variableID) + if err != nil { + // If it's gone: that's not an error, but we are done. + if errors.Is(err, tfe.ErrResourceNotFound) { + tflog.Debug(ctx, fmt.Sprintf("Variable %s no longer exists", variableID)) + resp.State.RemoveResource(ctx) + } else { + resp.Diagnostics.AddError( + "Error reading variable", + fmt.Sprintf("Couldn't read variable %s: %s", variableID, err.Error()), + ) + } + return + } + + // We got a variable, so update state: + result := modelFromTFETestVariable(*variable, data.Value, moduleID) + diags = resp.State.Set(ctx, &result) + resp.Diagnostics.Append(diags...) +} + +func (r *resourceTFETestVariable) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan modelTFETestVariable + var state modelTFETestVariable + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + diags = req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + variableID := plan.ID.ValueString() + moduleID := tfe.RegistryModuleID{ + Organization: plan.Organization.ValueString(), + Name: plan.ModuleName.ValueString(), + Provider: plan.ModuleProvider.ValueString(), + Namespace: plan.Organization.ValueString(), + RegistryName: "private", + } + + options := tfe.VariableUpdateOptions{ + Key: plan.Key.ValueStringPointer(), + Description: plan.Description.ValueStringPointer(), + HCL: plan.HCL.ValueBoolPointer(), + Sensitive: plan.Sensitive.ValueBoolPointer(), + } + // We ONLY want to set Value if our planned value would be a CHANGE from the + // prior state. See comments in updateWithWorkspace for more color. + if state.Value.ValueString() != plan.Value.ValueString() { + options.Value = plan.Value.ValueStringPointer() + } + + tflog.Debug(ctx, fmt.Sprintf("Update variable: %s", variableID)) + variable, err := r.config.Client.TestVariables.Update(ctx, moduleID, variableID, options) + if err != nil { + resp.Diagnostics.AddError( + "Error updating variable", + fmt.Sprintf("Couldn't update variable %s: %s", variableID, err.Error()), + ) + return + } + // Update state + result := modelFromTFETestVariable(*variable, plan.Value, moduleID) + diags = resp.State.Set(ctx, &result) + resp.Diagnostics.Append(diags...) +} + +func (r *resourceTFETestVariable) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var data modelTFETestVariable + diags := req.State.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + variableID := data.ID.ValueString() + moduleID := tfe.RegistryModuleID{ + Organization: data.Organization.ValueString(), + Name: data.ModuleName.ValueString(), + Provider: data.ModuleProvider.ValueString(), + Namespace: data.Organization.ValueString(), + RegistryName: "private", + } + log.Printf("[DEBUG] Delete variable: %s", variableID) + err := r.config.Client.TestVariables.Delete(ctx, moduleID, variableID) + // Ignore 404s for delete + if err != nil && !errors.Is(err, tfe.ErrResourceNotFound) { + resp.Diagnostics.AddError( + "Error deleting variable", + fmt.Sprintf("Couldn't delete variable %s: %s", variableID, err.Error()), + ) + } + // Resource is implicitly deleted from resp.State if diagnostics have no errors. +} diff --git a/internal/provider/resource_tfe_test_variable_test.go b/internal/provider/resource_tfe_test_variable_test.go new file mode 100644 index 000000000..e66478cee --- /dev/null +++ b/internal/provider/resource_tfe_test_variable_test.go @@ -0,0 +1,286 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFETestVariable_basic(t *testing.T) { + variable := &tfe.Variable{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFETestVariableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFETestVariable_test_variable(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFETestVariableExists( + "tfe_test_variable.foobar", variable), + testAccCheckTFEVariableAttributes(variable), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "key", "key_test"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "value", "value_test"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "description", "some description"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "category", "env"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "hcl", "false"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "sensitive", "false"), + ), + }, + }, + }) +} + +func TestAccTFETestVariable_update(t *testing.T) { + variable := &tfe.Variable{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFETestVariableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFETestVariable_test_variable(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFETestVariableExists( + "tfe_test_variable.foobar", variable), + testAccCheckTFEVariableAttributes(variable), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "key", "key_test"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "value", "value_test"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "description", "some description"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "category", "env"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "hcl", "false"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "sensitive", "false"), + ), + }, + + { + Config: testAccTFETestVariable_update(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFETestVariableExists( + "tfe_test_variable.foobar", variable), + testAccCheckTFETestVariableAttributesUpdate(variable), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "key", "key_updated"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "value", "value_updated"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "description", "another description"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "category", "env"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "hcl", "true"), + resource.TestCheckResourceAttr( + "tfe_test_variable.foobar", "sensitive", "true"), + ), + }, + }, + }) +} + +func testAccCheckTFETestVariableExists( + n string, variable *tfe.Variable) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + moduleID := tfe.RegistryModuleID{ + Organization: rs.Primary.Attributes["organization"], + Name: rs.Primary.Attributes["module_name"], + Provider: rs.Primary.Attributes["module_provider"], + Namespace: rs.Primary.Attributes["organization"], + RegistryName: "private", + } + + v, err := config.Client.TestVariables.Read(ctx, moduleID, rs.Primary.ID) + if err != nil { + return err + } + + *variable = *v + + return nil + } +} + +func testAccCheckTFETestVariableDestroy(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_test_variable" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + moduleID := tfe.RegistryModuleID{ + Organization: rs.Primary.Attributes["organization"], + Name: rs.Primary.Attributes["module_name"], + Provider: rs.Primary.Attributes["module_provider"], + Namespace: rs.Primary.Attributes["organization"], + RegistryName: "private", + } + + _, err := config.Client.TestVariables.Read(ctx, moduleID, rs.Primary.ID) + if err == nil { + return fmt.Errorf("Variable %s still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckTFETestVariableAttributesUpdate( + variable *tfe.Variable) resource.TestCheckFunc { + return func(s *terraform.State) error { + if variable.Key != "key_updated" { + return fmt.Errorf("Bad key: %s", variable.Key) + } + + if variable.Value != "" { + return fmt.Errorf("Bad value: %s", variable.Value) + } + + if variable.Description != "another description" { + return fmt.Errorf("Bad description: %s", variable.Description) + } + + if variable.Category != tfe.CategoryEnv { + return fmt.Errorf("Bad category: %s", variable.Category) + } + + if variable.HCL != true { + return fmt.Errorf("Bad HCL: %t", variable.HCL) + } + + if variable.Sensitive != true { + return fmt.Errorf("Bad sensitive: %t", variable.Sensitive) + } + + return nil + } +} + +func testAccTFETestVariable_test_variable(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "foobar" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.foobar.name + module_name = tfe_registry_module.foobar.name + module_provider = tfe_registry_module.foobar.module_provider +} +`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFETestVariable_update(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "foobar" { + key = "key_updated" + value = "value_updated" + description = "another description" + category = "env" + hcl = true + sensitive = true + organization = tfe_organization.foobar.name + module_name = tfe_registry_module.foobar.name + module_provider = tfe_registry_module.foobar.module_provider +} +`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} diff --git a/website/docs/r/tfe_test_variable.html.markdown b/website/docs/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..05a88c4e7 --- /dev/null +++ b/website/docs/r/tfe_test_variable.html.markdown @@ -0,0 +1,51 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` From e592343aaf35fc7f12df6ef0c80d880e6964f3fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:04:00 -0400 Subject: [PATCH 342/420] Build(deps): Bump actions/download-artifact from 4.1.4 to 4.1.6 (#1332) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.6. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/c850b930e6ba138125429b7e5c93fc707a7f8427...9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6141ff32a..a7637c508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 20 - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index d42655811..1899ade68 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 with: name: terraform-provider-tfe From d703ba45839dbac01d4d119c1c9868a2df3ca4d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:53:22 -0400 Subject: [PATCH 343/420] Build(deps): Bump actions/upload-artifact from 4.3.2 to 4.3.3 (#1331) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/1746f4ab65b179e0ea60a494b83293b640dd5bba...65462800fd760344b1a7b4382951275a0abb4808) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7637c508..c6d21c1fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: junit-test-summary path: ./ci-summary-provider.xml diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 1899ade68..b9c4d15e5 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -51,7 +51,7 @@ jobs: go build -o terraform-provider-tfe - name: Upload test artifacts - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: terraform-provider-tfe path: terraform-provider-tfe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4bc31d14..6540b0549 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Generate Release Notes run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: release-notes path: release-notes.txt From fc605eb1d203c9f2d7e88c073d8a02b1cc853c3a Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Tue, 23 Apr 2024 15:17:27 -0400 Subject: [PATCH 344/420] Rebrand Terraform Cloud to HCP Terraform (#1328) --- .github/ISSUE_TEMPLATE/bug_report.md | 12 +++++----- .github/ISSUE_TEMPLATE/config.yml | 4 ++-- .github/ISSUE_TEMPLATE/feature_request.md | 4 ++-- .github/actions/test-provider-tfe/action.yml | 18 +++++++-------- .github/workflows/create-release-pr.yml | 2 +- CHANGELOG.md | 6 ++--- README.md | 9 ++++---- docs/backwards-compatibility.md | 6 ++--- docs/beta.md | 2 +- docs/development-environment.md | 2 +- docs/index.md | 2 +- docs/test-infrastructure.md | 4 ++-- docs/testing.md | 12 +++++----- examples/workspaces_variables/README.md | 18 +++++++-------- examples/workspaces_variables/manager/main.tf | 4 ++-- .../workspaces_variables/manager/providers.tf | 2 +- ...ata_source_organization_membership_test.go | 2 +- internal/provider/data_source_policy_set.go | 2 +- internal/provider/helper_test.go | 4 ++-- internal/provider/id_helpers.go | 2 +- internal/provider/provider.go | 2 +- internal/provider/provider_next.go | 4 ++-- .../provider/resource_tfe_opa_version_test.go | 4 ++-- internal/provider/resource_tfe_policy_set.go | 2 +- .../resource_tfe_sentinel_version_test.go | 4 ++-- .../resource_tfe_team_project_access.go | 2 +- .../resource_tfe_terraform_version_test.go | 4 ++-- .../provider/resource_tfe_workspace_test.go | 2 +- .../cdktf/csharp/d/ip_ranges.html.markdown | 6 ++--- .../cdktf/csharp/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../docs/cdktf/csharp/d/slug.html.markdown | 2 +- .../cdktf/csharp/d/workspace.html.markdown | 10 ++++----- .../csharp/d/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/csharp/index.html.markdown | 22 +++++++++---------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- .../cdktf/csharp/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- .../cdktf/csharp/r/oauth_client.html.markdown | 4 ++-- .../cdktf/csharp/r/opa_version.html.markdown | 2 +- .../cdktf/csharp/r/organization.html.markdown | 4 ++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../csharp/r/registry_module.html.markdown | 2 +- .../cdktf/csharp/r/run_trigger.html.markdown | 2 +- .../csharp/r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../csharp/r/terraform_version.html.markdown | 6 ++--- .../cdktf/csharp/r/variable.html.markdown | 2 +- .../cdktf/csharp/r/workspace.html.markdown | 9 ++++---- .../csharp/r/workspace_run.html.markdown | 6 ++--- .../csharp/r/workspace_run_task.html.markdown | 2 +- .../csharp/r/workspace_settings.markdown | 2 +- .../docs/cdktf/go/d/ip_ranges.html.markdown | 6 ++--- .../cdktf/go/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../go/d/organization_run_task.html.markdown | 2 +- website/docs/cdktf/go/d/slug.html.markdown | 2 +- .../docs/cdktf/go/d/workspace.html.markdown | 10 ++++----- .../go/d/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/go/index.html.markdown | 22 +++++++++---------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- .../docs/cdktf/go/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- .../cdktf/go/r/oauth_client.html.markdown | 4 ++-- .../docs/cdktf/go/r/opa_version.html.markdown | 4 ++-- .../cdktf/go/r/organization.html.markdown | 4 ++-- .../r/organization_membership.html.markdown | 2 +- .../go/r/organization_run_task.html.markdown | 2 +- .../cdktf/go/r/registry_module.html.markdown | 2 +- .../docs/cdktf/go/r/run_trigger.html.markdown | 2 +- .../cdktf/go/r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../go/r/terraform_version.html.markdown | 6 ++--- .../docs/cdktf/go/r/variable.html.markdown | 2 +- .../docs/cdktf/go/r/workspace.html.markdown | 9 ++++---- .../cdktf/go/r/workspace_run.html.markdown | 6 ++--- .../go/r/workspace_run_task.html.markdown | 2 +- .../cdktf/go/r/workspace_settings.markdown | 2 +- .../docs/cdktf/java/d/ip_ranges.html.markdown | 6 ++--- .../cdktf/java/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- website/docs/cdktf/java/d/slug.html.markdown | 2 +- .../docs/cdktf/java/d/workspace.html.markdown | 10 ++++----- .../java/d/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/java/index.html.markdown | 22 +++++++++---------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- .../cdktf/java/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- .../cdktf/java/r/oauth_client.html.markdown | 4 ++-- .../cdktf/java/r/opa_version.html.markdown | 4 ++-- .../cdktf/java/r/organization.html.markdown | 4 ++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../java/r/registry_module.html.markdown | 2 +- .../cdktf/java/r/run_trigger.html.markdown | 2 +- .../java/r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../java/r/terraform_version.html.markdown | 6 ++--- .../docs/cdktf/java/r/variable.html.markdown | 2 +- .../docs/cdktf/java/r/workspace.html.markdown | 9 ++++---- .../cdktf/java/r/workspace_run.html.markdown | 6 ++--- .../java/r/workspace_run_task.html.markdown | 2 +- .../cdktf/java/r/workspace_settings.markdown | 2 +- .../cdktf/python/d/ip_ranges.html.markdown | 6 ++--- .../cdktf/python/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../docs/cdktf/python/d/slug.html.markdown | 2 +- .../cdktf/python/d/workspace.html.markdown | 10 ++++----- .../python/d/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/python/index.html.markdown | 20 ++++++++--------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- .../cdktf/python/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- .../cdktf/python/r/oauth_client.html.markdown | 4 ++-- .../cdktf/python/r/opa_version.html.markdown | 4 ++-- .../cdktf/python/r/organization.html.markdown | 4 ++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../python/r/registry_module.html.markdown | 2 +- .../cdktf/python/r/run_trigger.html.markdown | 2 +- .../python/r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../python/r/terraform_version.html.markdown | 6 ++--- .../cdktf/python/r/variable.html.markdown | 2 +- .../cdktf/python/r/workspace.html.markdown | 8 +++---- .../python/r/workspace_run.html.markdown | 6 ++--- .../python/r/workspace_run_task.html.markdown | 2 +- .../python/r/workspace_settings.markdown | 2 +- .../typescript/d/ip_ranges.html.markdown | 6 ++--- .../typescript/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../cdktf/typescript/d/slug.html.markdown | 2 +- .../typescript/d/workspace.html.markdown | 10 ++++----- .../d/workspace_run_task.html.markdown | 2 +- .../docs/cdktf/typescript/index.html.markdown | 20 ++++++++--------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- .../typescript/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- .../typescript/r/oauth_client.html.markdown | 4 ++-- .../typescript/r/opa_version.html.markdown | 4 ++-- .../typescript/r/organization.html.markdown | 8 +++++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../r/registry_module.html.markdown | 2 +- .../typescript/r/run_trigger.html.markdown | 2 +- .../r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../r/terraform_version.html.markdown | 6 ++--- .../cdktf/typescript/r/variable.html.markdown | 2 +- .../typescript/r/workspace.html.markdown | 8 +++---- .../typescript/r/workspace_run.html.markdown | 6 ++--- .../r/workspace_run_task.html.markdown | 2 +- .../typescript/r/workspace_settings.markdown | 2 +- website/docs/d/ip_ranges.html.markdown | 6 ++--- website/docs/d/organization.html.markdown | 4 ++-- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- website/docs/d/slug.html.markdown | 2 +- website/docs/d/workspace.html.markdown | 10 ++++----- .../docs/d/workspace_run_task.html.markdown | 2 +- website/docs/index.html.markdown | 22 +++++++++---------- ...gent_pool_allowed_workspaces.html.markdown | 4 ++-- website/docs/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 6 ++--- website/docs/r/oauth_client.html.markdown | 4 ++-- website/docs/r/opa_version.html.markdown | 4 ++-- website/docs/r/organization.html.markdown | 4 ++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- website/docs/r/registry_module.html.markdown | 2 +- website/docs/r/run_trigger.html.markdown | 2 +- website/docs/r/sentinel_version.html.markdown | 6 ++--- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../docs/r/terraform_version.html.markdown | 6 ++--- website/docs/r/variable.html.markdown | 2 +- website/docs/r/workspace.html.markdown | 8 +++---- website/docs/r/workspace_run.html.markdown | 6 ++--- .../docs/r/workspace_run_task.html.markdown | 2 +- website/docs/r/workspace_settings.markdown | 2 +- 190 files changed, 426 insertions(+), 424 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 59621c190..2ea5f5cfd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,16 +9,16 @@ labels: bug Hi there, Thank you for opening an issue! Please note that we try to keep the this issue tracker reserved for -bug reports and feature requests related to the Terraform Cloud/Enterprise provider. If you know -your issue relates to the Terraform Cloud/Enterprise platform itself, please contact +bug reports and feature requests related to the HCP Terraform and Terraform Enterprise provider. If you know +your issue relates to the HCP Terraform or Terraform Enterprise platform itself, please contact tf-cloud@hashicorp.support. For general usage questions, please post to our community forum: https://discuss.hashicorp.com. --> -#### Terraform Cloud/Enterprise version +#### Terraform Enterprise version @@ -27,8 +27,8 @@ Example: Terraform Enterprise v202104-1 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a5d2f0a85..670214e59 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,9 +3,9 @@ blank_issues_enabled: false contact_links: - - name: Terraform Cloud/Enterprise Troubleshooting and Feature Requests + - name: HCP Terraform or Terraform Enterprise Troubleshooting and Feature Requests url: https://support.hashicorp.com/hc/en-us/requests/new - about: For issues and feature requests concerning the Terraform Cloud/Enterprise platform itself, please submit a HashiCorp support request or email tf-cloud@hashicorp.support + about: For issues and feature requests concerning the HCP Terraform and Terraform Enterprise platform itself, please submit a HashiCorp support request or email tf-cloud@hashicorp.support - name: Terraform Language or Workflow Questions url: https://discuss.hashicorp.com about: Please ask Terraform language or workflow related questions through the HashiCorp Discuss forum diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 40b1fd653..b77cb636f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -9,8 +9,8 @@ labels: feature-request Hi there, Thank you for opening a request! Please note that we try to keep the this issue tracker reserved for -bug reports and feature requests related to the Terraform Cloud/Enterprise provider. If you know -your request relates to the Terraform Cloud/Enterprise platform itself, please contact +bug reports and feature requests related to the HCP Terraform and Terraform Enterprise provider. If you know +your request relates to the HCP Terraform and Terraform Enterprise platform itself, please contact tf-cloud@hashicorp.support. For general usage questions, please post to our community forum: https://discuss.hashicorp.com. --> diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index b6b48a3c4..70ccd2bae 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -5,25 +5,25 @@ name: Test description: Tests terraform-provider-tfe within a matrix inputs: admin_configuration_token: - description: TFC Admin API Configuration role token + description: HCP Terraform Admin API Configuration role token required: true admin_provision_licenses_token: - description: TFC Admin API Provision Licenses role token + description: HCP Terraform Admin API Provision Licenses role token required: true admin_security_maintenance_token: - description: TFC Admin API Security Maintenance role token + description: HCP Terraform Admin API Security Maintenance role token required: true admin_site_admin_token: - description: TFC Admin API Site Admin role token + description: HCP Terraform Admin API Site Admin role token required: true admin_subscription_token: - description: TFC Admin API Subscription role token + description: HCP Terraform Admin API Subscription role token required: true admin_support_token: - description: TFC Admin API Support role token + description: HCP Terraform Admin API Support role token required: true admin_version_maintenance_token: - description: TFC Admin API Version Maintenance role token + description: HCP Terraform Admin API Version Maintenance role token required: true matrix_index: description: Index of the matrix strategy runner @@ -32,10 +32,10 @@ inputs: description: Total number of matrix strategy runners required: true hostname: - description: Hostname of the Terraform Cloud instance to test against + description: Hostname of the HCP Terraform or Terraform Enterprise instance to test against required: true token: - description: Terraform Cloud token + description: HCP Terraform or Terraform Enterprise token required: true testing-github-token: description: The GitHub token used for testing scenarios diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index b9c4d15e5..6d1e8102c 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -111,7 +111,7 @@ jobs: This PR is meant to automate certain preparations for release and instruct maintainers on the manual release tasks. Push any changes you make to this branch and merge it just before creating a release. - 1. Ensure both main and nightly CI actions passed. These test the release version against TFC and TFE, respectively. + 1. Ensure both main and nightly CI actions passed. These test the release version against HCP Terraform and Terraform Enterprise, respectively. 2. Review the CHANGELOG and ensure and ensure [everything that's changed since the last release](https://github.com/hashicorp/terraform-provider-tfe/compare/v${{ needs.releasedVersion.outputs.version }}...main) is described. If anything is missing, inaccurate, or unclear, now is the time to fix it! Check the CHANGELOG organization: pull breaking changes to the top and make sure the most important features are at the top of the FEATURES list. Check the version header in the changelog. It must be: `## v${{ github.event.inputs.version }}` 3. Bump the static versions given as an example in the `website/docs/index.html.markdown` docs 4. Bump the static versions given in the README installation section. diff --git a/CHANGELOG.md b/CHANGELOG.md index bbd82b07d..8c387afd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -352,7 +352,7 @@ BREAKING CHANGES: * **Removed Authentication Method**: Host-specific TF_TOKEN_... environment variable (added in 0.31.0) can no longer be used for token authentication. This method of authentication is incompatible with the Terraform Cloud remote execution model. Please use the TFE_TOKEN environment variable. * r/tfe_workspace: Default value of the `file_triggers_enabled` field is changed to `false`. This will align the `file_triggers_enabled` field default value with the default value for the same field in the - [TFC API](https://www.terraform.io/cloud-docs/api-docs/workspaces). + [Terraform Cloud API](https://www.terraform.io/cloud-docs/api-docs/workspaces). If the value of the `file_triggers_enabled` field was not explicitly set and either of the fields `working_directory` (not an empty string) or `trigger_prefixes` was used - to keep the behavior unchanged, the `file_trigger_enabled` field should now explicitly be set to `true`. ([#510](https://github.com/hashicorp/terraform-provider-tfe/pull/510/files)) @@ -451,7 +451,7 @@ ENHANCEMENTS: * r/oauth_client: Added `key`, `secret`, and `rsa_public_key` arguments, used for configuring BitBucket Server and Azure DevOps Server. ([#395](https://github.com/hashicorp/terraform-provider-tfe/pull/395)) * Improved discovery and loading of credentials from Terraform configuration files; the provider - will attempt to use Terraform CLI's authentication with Terraform Cloud/Enterprise for its own + will attempt to use Terraform CLI's authentication with Terraform Cloud or Terraform Enterprise for its own authentication, when present. ([#360](https://github.com/hashicorp/terraform-provider-tfe/pull/360)) BUG FIXES: @@ -665,7 +665,7 @@ If you have already changed all references to this data source's `ids` attribute ## 0.17.1 (May 27, 2020) BUG FIXES: -* r/tfe_team: Fixed a panic occurring with importing Owners teams on Free TFC organizations which do not include visible organization access. ([#181](https://github.com/hashicorp/terraform-provider-tfe/pull/181)) +* r/tfe_team: Fixed a panic occurring with importing Owners teams on Free Terraform Cloud organizations which do not include visible organization access. ([#181](https://github.com/hashicorp/terraform-provider-tfe/pull/181)) ## 0.17.0 (May 21, 2020) diff --git a/README.md b/README.md index 46be170f6..7c69a386c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ Terraform -# Terraform Cloud/Enterprise Provider -The official Terraform provider for [Terraform Cloud/Enterprise](https://www.hashicorp.com/products/terraform). +# HCP Terraform and Terraform Enterprise Provider -As Terraform Enterprise is a self-hosted distribution of Terraform Cloud, this +The official Terraform provider for [HCP Terraform and Terraform Enterprise](https://www.hashicorp.com/products/terraform). + +As Terraform Enterprise is a self-hosted distribution of HCP Terraform, this provider supports both Cloud and Enterprise use cases. In all/most documentation, the platform will always be stated as 'Terraform Enterprise' - but a feature will be explicitly noted as only supported in one or the other, if @@ -55,7 +56,7 @@ For more information on provider installation and constraining provider versions ## Usage -[Create a user or team API token in Terraform Cloud/Enterprise](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens), and use the token in the provider configuration block: +[Create a user or team API token in HCP Terraform or Terraform Enterprise](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens), and use the token in the provider configuration block: ```hcl provider "tfe" { diff --git a/docs/backwards-compatibility.md b/docs/backwards-compatibility.md index 6d37af5c9..c7369ea03 100644 --- a/docs/backwards-compatibility.md +++ b/docs/backwards-compatibility.md @@ -28,7 +28,7 @@ if tmAccess.ProjectAccess != nil { ### Explicit Enterprise Checks -If a resource or attribute is **only** available in Terraform Enterprise, use the go-tfe helper [IsEnterprise()](https://pkg.go.dev/github.com/hashicorp/go-tfe#Client.IsEnterprise) to ensure the client is configured against a TFE instance. This check is derived from the `TFP-AppName` header that Terraform Cloud emits, of which if not present, indicates a Terraform Enterprise installation. +If a resource or attribute is **only** available in Terraform Enterprise, use the go-tfe helper [IsEnterprise()](https://pkg.go.dev/github.com/hashicorp/go-tfe#Client.IsEnterprise) to ensure the client is configured against a Terraform Enterprise instance. This check is derived from the `TFP-AppName` header that HCP Terraform or Terraform Enterprise emits. ```go config := meta.(ConfiguredClient) @@ -51,7 +51,7 @@ For a new resource, add the minimum release required to the top level documentat Provides a my new resource. -~> **NOTE:** Using this resource requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202302-1. +~> **NOTE:** Using this resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202302-1. ``` @@ -64,5 +64,5 @@ The following arguments are supported: * `foo` - (Required) Foo is bar. * `bar` - (Optional) Bar is foo. -* `foobar` - (Optional) Foobar is barfoo. This attribute requires Terraform Cloud or an instance of Terraform Enterprise at least as recent as `v202302-1`. +* `foobar` - (Optional) Foobar is barfoo. This attribute requires HCP Terraform or an instance of Terraform Enterprise at least as recent as `v202302-1`. ``` diff --git a/docs/beta.md b/docs/beta.md index cd4b188a1..acfbf0850 100644 --- a/docs/beta.md +++ b/docs/beta.md @@ -1,6 +1,6 @@ # Introducing Beta Features -This guide discusses how to introduce features that are not yet generally available in Terraform Cloud. +This guide discusses how to introduce features that are not yet generally available in HCP Terraform . In general, beta features should not be merged/released until generally available (GA). However, the maintainers recognize almost any reason to release beta features on a case-by-case basis. These could include: partial customer availability, software dependency, or any reason short of feature completeness. diff --git a/docs/development-environment.md b/docs/development-environment.md index 4402abce0..26bc867ce 100644 --- a/docs/development-environment.md +++ b/docs/development-environment.md @@ -45,7 +45,7 @@ See the [Provider Requirements](https://developer.hashicorp.com/terraform/langua ## Running the Tests -The provider is mainly tested using a suite of acceptance tests that run against an internal instance of Terraform Cloud. We also test against Terraform Enterprise prior to release. +The provider is mainly tested using a suite of acceptance tests that run against an internal instance of HCP Terraform. We also test against Terraform Enterprise prior to release. To run the acceptance tests, run `make testacc` diff --git a/docs/index.md b/docs/index.md index b7fb0aabf..ddad79820 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Welcome to the Contributing Guide -Thanks for your interest in contributing to the official Terraform Cloud/Enterprise provider. We appreciate your help! If you're unsure or afraid of anything, you can submit a work in progress (WIP) pull request, or file an issue with the parts you know. We'll do our best to guide you in the right direction, and let you know if there are guidelines we will need to follow. We want people to be able to participate without fear of doing the wrong thing. +Thanks for your interest in contributing to the official HCP Terraform and Terraform Enterprise provider. We appreciate your help! If you're unsure or afraid of anything, you can submit a work in progress (WIP) pull request, or file an issue with the parts you know. We'll do our best to guide you in the right direction, and let you know if there are guidelines we will need to follow. We want people to be able to participate without fear of doing the wrong thing. This guide is broken down into sections to help you [configure your environment](development-environment.md), [creating new resources](new-resources.md), [debug](debugging.md), and [test](testing.md) code to ensure your contribution can be included in a release. diff --git a/docs/test-infrastructure.md b/docs/test-infrastructure.md index c65d3a38d..5dc5bf57f 100644 --- a/docs/test-infrastructure.md +++ b/docs/test-infrastructure.md @@ -1,8 +1,8 @@ # Test Infrastructure -We rely on acceptance tests that test the provider against infrastructure that simulates both Terraform Cloud and Terraform Enterprise. The only exception is features that depend on a feature flag evaluation: In this case, we rely on running the tests locally and reporting the results in the PR description. +We rely on acceptance tests that test the provider against infrastructure that simulates both HCP Terraform and Terraform Enterprise. The only exception is features that depend on a feature flag evaluation: In this case, we rely on running the tests locally and reporting the results in the PR description. -Within the Pull Request process, test checks are executed against infrastructure that simulates Terraform Cloud, which is rebuilt nightly and uses the latest nightly TFE build image. Changes to the underlying Terraform Cloud platform may take 24-48 hours to be reflected in this infrastructure. Tests that use the helper `skipIfCloud` are skipped during this check. +Within the Pull Request process, test checks are executed against infrastructure that simulates HCP Terraform, which is rebuilt nightly and uses the latest nightly TFE build image. Changes to the underlying HCP Terraform platform may take 24-48 hours to be reflected in this infrastructure. Tests that use the helper `skipIfCloud` are skipped during this check. In addition, we test the main branch of the provider once each night against the same image but configured to simulate Terraform Enterprise. Tests that use the helper `skipIfEnterprise` are skipped during this nightly job. diff --git a/docs/testing.md b/docs/testing.md index 3b977d5cf..6b731cdec 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,6 +1,6 @@ # Running tests -Running all the tests for this provider requires access to Terraform Cloud with +Running all the tests for this provider requires access to HCP Terraform with a full feature set; most tests can be run against your own installation of Terraform Enterprise. @@ -31,11 +31,11 @@ default, these are loaded from the `credentials` in the [CLI config file](https://developer.hashicorp.com/terraform/cli/config/config-file). You can override these values with the environment variables specified below: -1. `TFE_HOSTNAME` - URL of a Terraform Cloud or Terraform Enterprise instance to be used for testing, without the scheme. Example: `tfe.local` -1. `TFE_TOKEN` - A [user API token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/users#tokens) for an administrator account on the Terraform Cloud or Terraform Enterprise instance being used for testing. +1. `TFE_HOSTNAME` - URL of a HCP Terraform or Terraform Enterprise instance to be used for testing, without the scheme. Example: `tfe.local` +1. `TFE_TOKEN` - A [user API token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/users#tokens) for an administrator account on the HCP Terraform or Terraform Enterprise instance being used for testing. ##### Optional: -1. `TFE_USER1` and `TFE_USER2`: The usernames of two pre-existing users on the Terraform Cloud or Terraform Enterprise instance being used for testing. Required for running team membership tests. +1. `TFE_USER1` and `TFE_USER2`: The usernames of two pre-existing users on the HCP Terraform or Terraform Enterprise instance being used for testing. Required for running team membership tests. 2. `GITHUB_TOKEN` - [GitHub personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Used to establish a VCS provider connection. 3. `GITHUB_POLICY_SET_IDENTIFIER` - GitHub policy set repository identifier in the format `username/repository`. Required for running policy set tests. 4. `GITHUB_POLICY_SET_BRANCH`: A GitHub branch for the repository specified by `GITHUB_POLICY_SET_IDENTIFIER`. Required for running policy set tests. @@ -43,13 +43,13 @@ these values with the environment variables specified below: 6. `GITHUB_REGISTRY_MODULE_IDENTIFIER` - GitHub registry module repository identifier in the format `username/repository`. Required for running registry module tests. 7. `GITHUB_WORKSPACE_IDENTIFIER` - GitHub workspace repository identifier in the format `username/repository`. Required for running workspace tests. 8. `GITHUB_WORKSPACE_BRANCH`: A GitHub branch for the repository specified by `GITHUB_WORKSPACE_IDENTIFIER`. Required for running workspace tests. -9. `ENABLE_TFE` - Some tests cover features available only in Terraform Cloud. To skip these tests when running against a Terraform Enterprise instance, set `ENABLE_TFE=1`. +9. `ENABLE_TFE` - Some tests cover features available only in HCP Terraform. To skip these tests when running against a Terraform Enterprise instance, set `ENABLE_TFE=1`. 10. `RUN_TASKS_URL` - External URL to use for testing Run Tasks operations, for example `RUN_TASKS_URL=http://somewhere.local:8080/pass`. Required for running run tasks tests. 11. `RUN_TASKS_HMAC` - The optional HMAC Key that should be used for Run Task operations. The default is no key. 12. `GITHUB_APP_INSTALLATION_ID` - GitHub App installation internal id in the format `ghain-xxxxxxx`. Required for running any tests that use GitHub App VCS (workspace, policy sets, registry module). 13. `GITHUB_APP_INSTALLATION_NAME` - GitHub App installation name. Required for running tfe_github_app_installation data source test. -**Note:** In order to run integration tests for **Paid** features you will need a token `TFE_TOKEN` with TFC/E administrator privileges, otherwise the attempt to upgrade an organization's feature set will fail. +**Note:** In order to run integration tests for **Paid** features you will need a token `TFE_TOKEN` with HCP Terraform or Terraform Enterprise administrator privileges, otherwise the attempt to upgrade an organization's feature set will fail. You can set your environment variables up however you prefer. The following are instructions for setting up environment variables using [envchain](https://github.com/sorah/envchain). 1. Make sure you have envchain installed. [Instructions for this can be found in the envchain README](https://github.com/sorah/envchain#installation). diff --git a/examples/workspaces_variables/README.md b/examples/workspaces_variables/README.md index 767ec80de..b8f8c7371 100644 --- a/examples/workspaces_variables/README.md +++ b/examples/workspaces_variables/README.md @@ -1,6 +1,6 @@ ## Managing workspaces and variables -This configuration provides an example of how to manage Terraform Cloud / Enterprise workspaces and the variables set on those workspaces using the `tfe` provider. +This configuration provides an example of how to manage HCP Terraform or Terraform Enterprise workspaces and the variables set on those workspaces using the `tfe` provider. There are two configurations supplied in this example. The `manager` configuration uses the `tfe` provider to create workspaces and variables. The `managed` configuration is the configuration that will be associated with the workspaces being created. This `managed` workspace represents what would do the actual deployment of the resources of interest, which could represent environments (dev/test/prod), customers, and so on. The use case is for any configuration that needs to be deployed where the only difference is the variables supplied. @@ -8,14 +8,14 @@ There are two configurations supplied in this example. The `manager` configurati Successful configuration of this example requires several things to be prepared in advance. -* Create or join a Terraform Cloud or Enterprise [organization](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations#creating-organizations). -* Create a Terraform Cloud or Enterprise token to use with the `tfe` [provider](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs). While other token types can be used, a [User Token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/users#api-tokens) is recommended in the beginning so that the provider has the same access as the user experimenting with this configuration. +* Create or join a HCP Terraform or Terraform Enterprise [organization](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations#creating-organizations). +* Create a HCP Terraform or Terraform Enterprise token to use with the `tfe` [provider](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs). While other token types can be used, a [User Token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/users#api-tokens) is recommended in the beginning so that the provider has the same access as the user experimenting with this configuration. * Create a [Github token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) that has access to create and manage OAuth clients. A personal access token with full repo scope should be sufficient. This example uses Github, so the configuration will need to be modified to work with other VCS providers. Have the following information handy for the next steps: -* TFC or TFE organization name -* TFC or TFE token +* HCP Terraform or TFE organization name +* HCP Terraform or TFE token * Github organization name * Github repository names (`managed` and `manager`, but you could, and eventually probably will, rename them) * Github token @@ -25,7 +25,7 @@ Have the following information handy for the next steps: * Create two Github repositories named `manager` and `managed`. * Add the `manager` configuration to the `manager` repository. * Add the `managed` configuration to the `managed` repository. -* Create a TFC/TFE workspace named `manager` in the organization that was created or joined. +* Create a HCP Terraform and Terraform Enterprise workspace named `manager` in the organization that was created or joined. - If there is no existing connection for Github configured, select to [add a connection](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs). - With Github connected, choose the `manager` repository from the list. - Use the default options for the remaining settings to complete the workspace setup. @@ -34,9 +34,9 @@ Have the following information handy for the next steps: The `manager` workspace requires certain Terraform variables to be set on the [Variables page in the UI](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#managing-variables-in-the-ui). All variables should be "Terraform Variables". There are no "Environment Variables" required. -* `tf_hostname` - The Terraform Cloud or Enterprise hostname. Defaults to app.terraform.io -* `tf_api_token` - The TFC/TFE user token that was generated. Mark this as sensitive. -* `tf_organization` - The TFC/TFE organization name where the managed workspaces should exist. This will most commonly be the organization that was created or joined, where the `manager` workspace also exists. The token supplied to perform the operations should have sufficient access to the organization. +* `tf_hostname` - The HCP Terraform or Enterprise hostname. Defaults to app.terraform.io +* `tf_api_token` - The HCP Terraform or Terraform Enterprise user token that was generated. Mark this as sensitive. +* `tf_organization` - The HCP Terraform or Terraform Enterprise organization name where the managed workspaces should exist. This will most commonly be the organization that was created or joined, where the `manager` workspace also exists. The token supplied to perform the operations should have sufficient access to the organization. * `vcs_repo_identifier` - A reference to the `managed` repository in the format `/`. The format of the VCS repo identifier might differ depending on the VCS provider, see [tfe_workspace](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace) * `vcs_token` - The Github personal access token that can create OAuth connections. Mark this as sensitive. diff --git a/examples/workspaces_variables/manager/main.tf b/examples/workspaces_variables/manager/main.tf index 3c2c86074..782c57cdf 100644 --- a/examples/workspaces_variables/manager/main.tf +++ b/examples/workspaces_variables/manager/main.tf @@ -1,14 +1,14 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: MPL-2.0 -# This configuration creates and manages workspaces in Terraform Cloud / +# This configuration creates and manages workspaces in HCP Terraform / # Enterprise. Workspaces and the variables that should be set on them come from # two maps, and can come from additional sources as well, such as individual # variable resource blocks. The maps are merged, and then the result is # iterated over using for_each. variable "tf_organization" { - description = "The Terraform Cloud or Enterprise organization under which all operations should be performed." + description = "The HCP Terraform or Enterprise organization under which all operations should be performed." type = string } diff --git a/examples/workspaces_variables/manager/providers.tf b/examples/workspaces_variables/manager/providers.tf index b9b38b59e..e037c1fb7 100644 --- a/examples/workspaces_variables/manager/providers.tf +++ b/examples/workspaces_variables/manager/providers.tf @@ -8,7 +8,7 @@ variable "tf_api_token" { } variable "tf_hostname" { - description = "The Terraform Cloud or Enterprise hostname." + description = "The HCP Terraform or Enterprise hostname." default = "app.terraform.io" } diff --git a/internal/provider/data_source_organization_membership_test.go b/internal/provider/data_source_organization_membership_test.go index 6b31553de..646e7c7c7 100644 --- a/internal/provider/data_source_organization_membership_test.go +++ b/internal/provider/data_source_organization_membership_test.go @@ -55,7 +55,7 @@ func TestAccTFEOrganizationMembershipDataSource_findByName(t *testing.T) { t.Skip("CI Seeded users are not in the hashicorp org in CI") } - // This test requires a user that exists in a TFC organization called "hashicorp". + // This test requires a user that exists in a HCP Terraform organization called "hashicorp". // Our CI instance has a default organization "hashicorp" and prepopulates it // with users (i.e TFE_USER1, etc) since we are unable to create users via the API. // In order to run this against your own organization, simply modify the organization diff --git a/internal/provider/data_source_policy_set.go b/internal/provider/data_source_policy_set.go index 069584f9c..d17b473df 100644 --- a/internal/provider/data_source_policy_set.go +++ b/internal/provider/data_source_policy_set.go @@ -54,7 +54,7 @@ func dataSourceTFEPolicySet() *schema.Resource { }, "agent_enabled": { - Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", + Description: "Whether the policy set is executed in the HCP Terraform agent. True by default for OPA policies", Type: schema.TypeBool, Computed: true, }, diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index 7d3bcc395..56a46e4f0 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -178,7 +178,7 @@ func createProject(t *testing.T, client *tfe.Client, orgName string, options tfe func skipIfCloud(t *testing.T) { if !enterpriseEnabled() { - t.Skip("Skipping test for a feature unavailable in Terraform Cloud. Set 'ENABLE_TFE=1' to run.") + t.Skip("Skipping test for a feature unavailable in HCP Terraform. Set 'ENABLE_TFE=1' to run.") } } @@ -196,7 +196,7 @@ func skipUnlessRunTasksDefined(t *testing.T) { func skipUnlessBeta(t *testing.T) { if !betaFeaturesEnabled() { - t.Skip("Skipping test related to a Terraform Cloud/Enterprise beta feature. Set ENABLE_BETA=1 to run.") + t.Skip("Skipping test related to a HCP Terraform and Terraform Enterprise beta feature. Set ENABLE_BETA=1 to run.") } } diff --git a/internal/provider/id_helpers.go b/internal/provider/id_helpers.go index 5547e856c..039e3d2d0 100644 --- a/internal/provider/id_helpers.go +++ b/internal/provider/id_helpers.go @@ -8,7 +8,7 @@ import ( "regexp" ) -// Checks if a given string matches the typical ID format for a TFC/E ressource +// Checks if a given string matches the typical ID format for a HCP Terraform and Terraform Enterprise ressource // -<16 base58 characters > func isResourceIDFormat(resourcePrefix string, id string) bool { base58Regex, err := regexp.Compile(fmt.Sprintf("^%s-[1-9A-HJ-NP-Za-km-z]{16}$", resourcePrefix)) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index e20a3fd80..cd0e1c15c 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -50,7 +50,7 @@ var ctx = context.Background() func Provider() *schema.Provider { return &schema.Provider{ // Note that defaults and fallbacks which are usually handled by DefaultFunc here are - // instead handled when fetching a TFC/E client in getClient(). This is because the this + // instead handled when fetching a HCP Terraform and Terraform Enterprise client in getClient(). This is because the this // provider is actually two muxed providers which must respect the same logic for fetching // those values in each schema. Schema: map[string]*schema.Schema{ diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 83e74b573..443e66823 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -28,7 +28,7 @@ var _ provider.Provider = &frameworkProvider{} // Can be used to construct ID regexp patterns var base58Alphabet = "[1-9A-HJ-NP-Za-km-z]" -// IDPattern constructs a regexp pattern for Terraform Cloud with the given prefix +// IDPattern constructs a regexp pattern for HCP Terraform with the given prefix func IDPattern(prefix string) *regexp.Regexp { return regexp.MustCompile(fmt.Sprintf("^%s-%s{16}$", prefix, base58Alphabet)) } @@ -81,7 +81,7 @@ func (p *frameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest, } } -// Configure (a Provider interface function) sets up the TFC client per the +// Configure (a Provider interface function) sets up the HCP Terraform client per the // specified provider configuration block and env vars. func (p *frameworkProvider) Configure(ctx context.Context, req provider.ConfigureRequest, res *provider.ConfigureResponse) { var data FrameworkProviderConfig diff --git a/internal/provider/resource_tfe_opa_version_test.go b/internal/provider/resource_tfe_opa_version_test.go index e42bef6a6..28a638ae7 100644 --- a/internal/provider/resource_tfe_opa_version_test.go +++ b/internal/provider/resource_tfe_opa_version_test.go @@ -255,8 +255,8 @@ func genOPASha(t *testing.T, secret, data string) string { } // genSafeRandomOPAVersion returns a random version number of the form -// `0.0.`, which TFC won't ever select as the latest available -// OPA. (At the time of writing, a fresh TFC instance will include +// `0.0.`, which HCP Terraform won't ever select as the latest available +// OPA. (At the time of writing, a fresh HCP Terraform instance will include // official OPAs 0.44.0 and higher.) This is necessary because newly created // workspaces default to the latest available version, and there's nothing // preventing unrelated processes from creating workspaces during these tests. diff --git a/internal/provider/resource_tfe_policy_set.go b/internal/provider/resource_tfe_policy_set.go index ce4317fd1..802dd080a 100644 --- a/internal/provider/resource_tfe_policy_set.go +++ b/internal/provider/resource_tfe_policy_set.go @@ -76,7 +76,7 @@ func resourceTFEPolicySet() *schema.Resource { }, "agent_enabled": { - Description: "Whether the policy set is executed in the TFC agent. True by default for OPA policies", + Description: "Whether the policy set is executed in the HCP Terraform agent. True by default for OPA policies", Type: schema.TypeBool, Optional: true, Computed: true, diff --git a/internal/provider/resource_tfe_sentinel_version_test.go b/internal/provider/resource_tfe_sentinel_version_test.go index df1818f4e..54de29d5b 100644 --- a/internal/provider/resource_tfe_sentinel_version_test.go +++ b/internal/provider/resource_tfe_sentinel_version_test.go @@ -255,8 +255,8 @@ func genSentinelSha(t *testing.T, secret, data string) string { } // genSafeRandomSentinelVersion returns a random version number of the form -// `0.0.`, which TFC won't ever select as the latest available -// Sentinel. (At the time of writing, a fresh TFC instance will include +// `0.0.`, which HCP Terraform won't ever select as the latest available +// Sentinel. (At the time of writing, a fresh HCP Terraform instance will include // official Sentinels 0.22.1 and higher.) This is necessary because newly created // workspaces default to the latest available version, and there's nothing // preventing unrelated processes from creating workspaces during these tests. diff --git a/internal/provider/resource_tfe_team_project_access.go b/internal/provider/resource_tfe_team_project_access.go index 94f5b360e..ab1abe49e 100644 --- a/internal/provider/resource_tfe_team_project_access.go +++ b/internal/provider/resource_tfe_team_project_access.go @@ -315,7 +315,7 @@ func resourceTFETeamProjectAccessRead(ctx context.Context, d *schema.ResourceDat d.Set("project_id", "") } - // These two fields are only available in TFC and TFE v202308-1 and later + // These two fields are only available in HCP Terraform and TFE v202308-1 and later if tmAccess.ProjectAccess != nil { projectAccess := []map[string]interface{}{{ "settings": tmAccess.ProjectAccess.ProjectSettingsPermission, diff --git a/internal/provider/resource_tfe_terraform_version_test.go b/internal/provider/resource_tfe_terraform_version_test.go index 2a4df5bca..eb3561b61 100644 --- a/internal/provider/resource_tfe_terraform_version_test.go +++ b/internal/provider/resource_tfe_terraform_version_test.go @@ -255,8 +255,8 @@ func genSha(t *testing.T, secret, data string) string { } // genSafeRandomTerraformVersion returns a random version number of the form -// `1.0.`, which TFC won't ever select as the latest available -// Terraform. (At the time of writing, a fresh TFC instance will include +// `1.0.`, which HCP Terraform won't ever select as the latest available +// Terraform. (At the time of writing, a fresh HCP Terraform instance will include // official Terraforms 1.2 and higher.) This is necessary because newly created // workspaces default to the latest available version, and there's nothing // preventing unrelated processes from creating workspaces during these tests. diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index cc6f3903a..59c6afaec 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2287,7 +2287,7 @@ func testAccCheckTFEWorkspacePanic(n string) resource.TestCheckFunc { return func(s *terraform.State) error { config := testAccProvider.Meta().(ConfiguredClient) - // Grab the resource out of the state and delete it from TFC/E directly. + // Grab the resource out of the state and delete it from HCP Terraform and Terraform Enterprise directly. rs, ok := s.RootModule().Resources[n] if !ok { return fmt.Errorf("Not found: %s", n) diff --git a/website/docs/cdktf/csharp/d/ip_ranges.html.markdown b/website/docs/cdktf/csharp/d/ip_ranges.html.markdown index 3a0ef1b05..88e31258f 100644 --- a/website/docs/cdktf/csharp/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/csharp/d/ip_ranges.html.markdown @@ -2,12 +2,12 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -37,7 +37,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `Api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `Api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `Notifications` - The list of IP ranges in CIDR notation used for notifications. * `Sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `Vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/cdktf/csharp/d/organization.html.markdown b/website/docs/cdktf/csharp/d/organization.html.markdown index c4fc8f4fb..da3f0a42e 100644 --- a/website/docs/cdktf/csharp/d/organization.html.markdown +++ b/website/docs/cdktf/csharp/d/organization.html.markdown @@ -41,9 +41,9 @@ In addition to all arguments above, the following attributes are exported: * `Email` - Admin email address. * `ExternalId` - An identifier for the organization. -* `AssessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `AssessmentsEnforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `CollaboratorAuthPolicy` - Authentication policy (`Password` or `TwoFactorMandatory`). Defaults to `Password`. -* `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `OwnersTeamSamlRoleId` - The name of the "owners" team. * `SendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/cdktf/csharp/d/organization_membership.html.markdown b/website/docs/cdktf/csharp/d/organization_membership.html.markdown index 6c507d22b..2ee63b153 100644 --- a/website/docs/cdktf/csharp/d/organization_membership.html.markdown +++ b/website/docs/cdktf/csharp/d/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/cdktf/csharp/d/organization_run_task.html.markdown b/website/docs/cdktf/csharp/d/organization_run_task.html.markdown index d162d6a70..6d6651039 100644 --- a/website/docs/cdktf/csharp/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/csharp/d/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/csharp/d/slug.html.markdown b/website/docs/cdktf/csharp/d/slug.html.markdown index d00dccb39..97b8add0b 100644 --- a/website/docs/cdktf/csharp/d/slug.html.markdown +++ b/website/docs/cdktf/csharp/d/slug.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/cdktf/csharp/d/workspace.html.markdown b/website/docs/cdktf/csharp/d/workspace.html.markdown index baef07cdf..6cc97f431 100644 --- a/website/docs/cdktf/csharp/d/workspace.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -48,7 +48,7 @@ In addition to all arguments above, the following attributes are exported: * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `AssessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). * `RemoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `GlobalRemoteState` is set to `True`. @@ -68,9 +68,9 @@ In addition to all arguments above, the following attributes are exported: * `StructuredRunOutputEnabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `TagNames` - The names of tags added to this workspace. * `TerraformVersion` - The version (or version constraint) of Terraform used for this workspace. -* `TriggerPrefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `TriggerPrefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `VcsRepo` - Settings for the workspace's VCS repository. * `WorkingDirectory` - A relative path that Terraform will execute within. * `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`TfeWorkspaceSettings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown b/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown index 33ab24428..c69ab0109 100644 --- a/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index c87eddf03..0bfcf9188 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -1,18 +1,18 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -24,7 +24,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -48,12 +48,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `Remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` + hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token version = "~> 0.53.0" } @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `Hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `Hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TfeHostname` environment variable. -* `Token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `Token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. See [Authentication](#authentication) above for more information. * `SslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `False`. Can be overridden setting the `TfeSslSkipVerify` diff --git a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown index 87264830a..cdaa77bcc 100644 --- a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown @@ -11,9 +11,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/cdktf/csharp/r/agent_token.html.markdown b/website/docs/cdktf/csharp/r/agent_token.html.markdown index e82dea728..46388e5e8 100644 --- a/website/docs/cdktf/csharp/r/agent_token.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_token.html.markdown @@ -8,7 +8,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/cdktf/csharp/r/notification_configuration.html.markdown b/website/docs/cdktf/csharp/r/notification_configuration.html.markdown index 7ed4721e3..af6e18b37 100644 --- a/website/docs/cdktf/csharp/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/csharp/r/notification_configuration.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -150,9 +150,9 @@ The following arguments are supported: * `DestinationType` - (Required) The type of notification configuration payload to send. Valid values are: * `Generic` - * `Email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `Email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `Slack` - * `MicrosoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `MicrosoftTeams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `EmailAddresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `DestinationType` is `Generic`, `MicrosoftTeams`, or `Slack`. * `EmailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/cdktf/csharp/r/oauth_client.html.markdown b/website/docs/cdktf/csharp/r/oauth_client.html.markdown index 77beca461..44a5a4074 100644 --- a/website/docs/cdktf/csharp/r/oauth_client.html.markdown +++ b/website/docs/cdktf/csharp/r/oauth_client.html.markdown @@ -40,7 +40,7 @@ class MyConvertedCode : TerraformStack #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -72,7 +72,7 @@ class MyConvertedCode : TerraformStack #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. diff --git a/website/docs/cdktf/csharp/r/opa_version.html.markdown b/website/docs/cdktf/csharp/r/opa_version.html.markdown index 3445e35ce..73ffd4d52 100644 --- a/website/docs/cdktf/csharp/r/opa_version.html.markdown +++ b/website/docs/cdktf/csharp/r/opa_version.html.markdown @@ -42,7 +42,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `Official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `Deprecated` is true. diff --git a/website/docs/cdktf/csharp/r/organization.html.markdown b/website/docs/cdktf/csharp/r/organization.html.markdown index 9731348cc..761199855 100644 --- a/website/docs/cdktf/csharp/r/organization.html.markdown +++ b/website/docs/cdktf/csharp/r/organization.html.markdown @@ -46,10 +46,10 @@ The following arguments are supported: * `CollaboratorAuthPolicy` - (Optional) Authentication policy (`Password` or `TwoFactorMandatory`). Defaults to `Password`. * `OwnersTeamSamlRoleId` - (Optional) The name of the "owners" team. -* `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `SendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `AggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `SendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. -* `AssessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `AssessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `AllowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/cdktf/csharp/r/organization_membership.html.markdown b/website/docs/cdktf/csharp/r/organization_membership.html.markdown index fa4bc7a4e..77ac662b7 100644 --- a/website/docs/cdktf/csharp/r/organization_membership.html.markdown +++ b/website/docs/cdktf/csharp/r/organization_membership.html.markdown @@ -9,7 +9,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/cdktf/csharp/r/organization_run_task.html.markdown b/website/docs/cdktf/csharp/r/organization_run_task.html.markdown index 767fab5fd..c8cdf6f7b 100644 --- a/website/docs/cdktf/csharp/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/csharp/r/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index d79ea5c63..478fe17fe 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/cdktf/csharp/r/run_trigger.html.markdown b/website/docs/cdktf/csharp/r/run_trigger.html.markdown index 6d7e3e3f6..10be6cd02 100644 --- a/website/docs/cdktf/csharp/r/run_trigger.html.markdown +++ b/website/docs/cdktf/csharp/r/run_trigger.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/cdktf/csharp/r/sentinel_version.html.markdown b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown index b1c40adaf..11d841fd2 100644 --- a/website/docs/cdktf/csharp/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -42,7 +42,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `Official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `Deprecated` is true. @@ -63,6 +63,6 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team_organization_member.html.markdown b/website/docs/cdktf/csharp/r/team_organization_member.html.markdown index 43bf4a9a5..990182cae 100644 --- a/website/docs/cdktf/csharp/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/csharp/r/team_organization_member.html.markdown @@ -14,7 +14,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/csharp/r/team_organization_members.html.markdown b/website/docs/cdktf/csharp/r/team_organization_members.html.markdown index 0e580d489..248c30f82 100644 --- a/website/docs/cdktf/csharp/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/csharp/r/team_organization_members.html.markdown @@ -14,7 +14,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/csharp/r/terraform_version.html.markdown b/website/docs/cdktf/csharp/r/terraform_version.html.markdown index ca77c024d..171d72745 100644 --- a/website/docs/cdktf/csharp/r/terraform_version.html.markdown +++ b/website/docs/cdktf/csharp/r/terraform_version.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -40,7 +40,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `Official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `Deprecated` is true. @@ -61,6 +61,6 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/variable.html.markdown b/website/docs/cdktf/csharp/r/variable.html.markdown index 72f148929..736515ccc 100644 --- a/website/docs/cdktf/csharp/r/variable.html.markdown +++ b/website/docs/cdktf/csharp/r/variable.html.markdown @@ -106,7 +106,7 @@ variable is written once and not visible thereafter. Defaults to `False`. * `VariableSetId` - ID of the variable set that owns the variable. ~> **NOTE:** When `Sensitive` is set to true, Terraform cannot detect and repair -drift if `Value` is later changed out-of-band via the Terraform Cloud UI. +drift if `Value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `Value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index e7cf18ea1..0ab6aab2f 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -12,8 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. - -~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -107,7 +106,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `True`. When set to `False`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `False`. The provider uses `True` as any workspace provisioned with `False` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -124,7 +123,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `SpeculativeEnabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `True`. Setting this to `False` prevents Terraform Cloud + plans. Defaults to `True`. Setting this to `False` prevents HCP Terraform 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. @@ -145,7 +144,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. +* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. * `TriggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `VcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/cdktf/csharp/r/workspace_run.html.markdown b/website/docs/cdktf/csharp/r/workspace_run.html.markdown index 3d2bd4be3..ee1a71395 100644 --- a/website/docs/cdktf/csharp/r/workspace_run.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace_run.html.markdown @@ -204,8 +204,8 @@ The following arguments are supported: Both `Apply` and `Destroy` block supports: -* `ManualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `False`. - * If `WaitForRun` is set to `False`, this auto-apply will be done by Terraform Cloud. +* `ManualConfirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `False`. + * If `WaitForRun` is set to `False`, this auto-apply will be done by HCP Terraform. * If `WaitForRun` is set to `True`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `ManualConfirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `AutoApply` with the `TfeWorkspace` data source. * `Retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `RetryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `True`. @@ -218,5 +218,5 @@ Both `Apply` and `Destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. +* `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown b/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown index 9120d9a02..af04183ce 100644 --- a/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/csharp/r/workspace_settings.markdown b/website/docs/cdktf/csharp/r/workspace_settings.markdown index 3199f9e63..d4dbc523c 100644 --- a/website/docs/cdktf/csharp/r/workspace_settings.markdown +++ b/website/docs/cdktf/csharp/r/workspace_settings.markdown @@ -118,7 +118,7 @@ The following arguments are supported: * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference diff --git a/website/docs/cdktf/go/d/ip_ranges.html.markdown b/website/docs/cdktf/go/d/ip_ranges.html.markdown index 8a1607b08..6b0294d06 100644 --- a/website/docs/cdktf/go/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/go/d/ip_ranges.html.markdown @@ -2,12 +2,12 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -41,7 +41,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `Api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `Api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `Notifications` - The list of IP ranges in CIDR notation used for notifications. * `Sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `Vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/cdktf/go/d/organization.html.markdown b/website/docs/cdktf/go/d/organization.html.markdown index dba59c1a3..9c3136c58 100644 --- a/website/docs/cdktf/go/d/organization.html.markdown +++ b/website/docs/cdktf/go/d/organization.html.markdown @@ -44,9 +44,9 @@ In addition to all arguments above, the following attributes are exported: * `Email` - Admin email address. * `ExternalId` - An identifier for the organization. -* `AssessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `AssessmentsEnforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `CollaboratorAuthPolicy` - Authentication policy (`Password` or `TwoFactorMandatory`). Defaults to `Password`. -* `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `CostEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `OwnersTeamSamlRoleId` - The name of the "owners" team. * `SendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/cdktf/go/d/organization_membership.html.markdown b/website/docs/cdktf/go/d/organization_membership.html.markdown index 921208eab..66d8edf1a 100644 --- a/website/docs/cdktf/go/d/organization_membership.html.markdown +++ b/website/docs/cdktf/go/d/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/cdktf/go/d/organization_run_task.html.markdown b/website/docs/cdktf/go/d/organization_run_task.html.markdown index f3dedceaa..7828a5c2d 100644 --- a/website/docs/cdktf/go/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/go/d/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/go/d/slug.html.markdown b/website/docs/cdktf/go/d/slug.html.markdown index e87154825..92813d2bd 100644 --- a/website/docs/cdktf/go/d/slug.html.markdown +++ b/website/docs/cdktf/go/d/slug.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/cdktf/go/d/workspace.html.markdown b/website/docs/cdktf/go/d/workspace.html.markdown index 81084b9c6..0468d5103 100644 --- a/website/docs/cdktf/go/d/workspace.html.markdown +++ b/website/docs/cdktf/go/d/workspace.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -51,7 +51,7 @@ In addition to all arguments above, the following attributes are exported: * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `AssessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). * `RemoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `GlobalRemoteState` is set to `True`. @@ -71,9 +71,9 @@ In addition to all arguments above, the following attributes are exported: * `StructuredRunOutputEnabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `TagNames` - The names of tags added to this workspace. * `TerraformVersion` - The version (or version constraint) of Terraform used for this workspace. -* `TriggerPrefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `TriggerPrefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `TriggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `VcsRepo` - Settings for the workspace's VCS repository. * `WorkingDirectory` - A relative path that Terraform will execute within. * `ExecutionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`TfeWorkspaceSettings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/cdktf/go/d/workspace_run_task.html.markdown b/website/docs/cdktf/go/d/workspace_run_task.html.markdown index 22d0cdda5..36c184ffc 100644 --- a/website/docs/cdktf/go/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/go/d/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index c87eddf03..0bfcf9188 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -1,18 +1,18 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -24,7 +24,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -48,12 +48,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `Remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `AppTerraformIo` + hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token version = "~> 0.53.0" } @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `Hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `Hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TfeHostname` environment variable. -* `Token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `Token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. See [Authentication](#authentication) above for more information. * `SslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `False`. Can be overridden setting the `TfeSslSkipVerify` diff --git a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown index 87264830a..cdaa77bcc 100644 --- a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown @@ -11,9 +11,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/cdktf/go/r/agent_token.html.markdown b/website/docs/cdktf/go/r/agent_token.html.markdown index 4e569863e..c4f5ddc9a 100644 --- a/website/docs/cdktf/go/r/agent_token.html.markdown +++ b/website/docs/cdktf/go/r/agent_token.html.markdown @@ -8,7 +8,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/cdktf/go/r/notification_configuration.html.markdown b/website/docs/cdktf/go/r/notification_configuration.html.markdown index 4318042fa..da58281f4 100644 --- a/website/docs/cdktf/go/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/go/r/notification_configuration.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -187,9 +187,9 @@ The following arguments are supported: * `DestinationType` - (Required) The type of notification configuration payload to send. Valid values are: * `Generic` - * `Email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `Email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `Slack` - * `MicrosoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `MicrosoftTeams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `EmailAddresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `DestinationType` is `Generic`, `MicrosoftTeams`, or `Slack`. * `EmailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/cdktf/go/r/oauth_client.html.markdown b/website/docs/cdktf/go/r/oauth_client.html.markdown index 52a8a520d..55ebb3aa2 100644 --- a/website/docs/cdktf/go/r/oauth_client.html.markdown +++ b/website/docs/cdktf/go/r/oauth_client.html.markdown @@ -43,7 +43,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -75,7 +75,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. diff --git a/website/docs/cdktf/go/r/opa_version.html.markdown b/website/docs/cdktf/go/r/opa_version.html.markdown index 3404fc6b2..787153ae7 100644 --- a/website/docs/cdktf/go/r/opa_version.html.markdown +++ b/website/docs/cdktf/go/r/opa_version.html.markdown @@ -45,7 +45,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `Official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `Deprecated` is true. @@ -66,6 +66,6 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization.html.markdown b/website/docs/cdktf/go/r/organization.html.markdown index 18aa8b09a..104e0968f 100644 --- a/website/docs/cdktf/go/r/organization.html.markdown +++ b/website/docs/cdktf/go/r/organization.html.markdown @@ -49,10 +49,10 @@ The following arguments are supported: * `CollaboratorAuthPolicy` - (Optional) Authentication policy (`Password` or `TwoFactorMandatory`). Defaults to `Password`. * `OwnersTeamSamlRoleId` - (Optional) The name of the "owners" team. -* `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `CostEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `SendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `AggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `SendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. -* `AssessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `AssessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `AllowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/cdktf/go/r/organization_membership.html.markdown b/website/docs/cdktf/go/r/organization_membership.html.markdown index e2178d921..eb82ce5f7 100644 --- a/website/docs/cdktf/go/r/organization_membership.html.markdown +++ b/website/docs/cdktf/go/r/organization_membership.html.markdown @@ -9,7 +9,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/cdktf/go/r/organization_run_task.html.markdown b/website/docs/cdktf/go/r/organization_run_task.html.markdown index 3f61e4f7a..0f1853c50 100644 --- a/website/docs/cdktf/go/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/go/r/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index 5ea05e661..e1dfc5499 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/cdktf/go/r/run_trigger.html.markdown b/website/docs/cdktf/go/r/run_trigger.html.markdown index 1415e02c4..2e3f1f1b9 100644 --- a/website/docs/cdktf/go/r/run_trigger.html.markdown +++ b/website/docs/cdktf/go/r/run_trigger.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/cdktf/go/r/sentinel_version.html.markdown b/website/docs/cdktf/go/r/sentinel_version.html.markdown index d3e4dc21f..f8604a4be 100644 --- a/website/docs/cdktf/go/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/go/r/sentinel_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -45,7 +45,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `Official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `Deprecated` is true. @@ -66,6 +66,6 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team_organization_member.html.markdown b/website/docs/cdktf/go/r/team_organization_member.html.markdown index 68050926d..3bca2cdf7 100644 --- a/website/docs/cdktf/go/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/go/r/team_organization_member.html.markdown @@ -14,7 +14,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/go/r/team_organization_members.html.markdown b/website/docs/cdktf/go/r/team_organization_members.html.markdown index 30e3aa131..1ea1c7c40 100644 --- a/website/docs/cdktf/go/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/go/r/team_organization_members.html.markdown @@ -14,7 +14,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/go/r/terraform_version.html.markdown b/website/docs/cdktf/go/r/terraform_version.html.markdown index 8babb3618..acdb57ea4 100644 --- a/website/docs/cdktf/go/r/terraform_version.html.markdown +++ b/website/docs/cdktf/go/r/terraform_version.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -43,7 +43,7 @@ The following arguments are supported: * `Url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `Sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `Official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `Enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `Enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `Beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `Deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `DeprecatedReason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `Deprecated` is true. @@ -64,6 +64,6 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/go/r/variable.html.markdown b/website/docs/cdktf/go/r/variable.html.markdown index 89e3df028..24801da02 100644 --- a/website/docs/cdktf/go/r/variable.html.markdown +++ b/website/docs/cdktf/go/r/variable.html.markdown @@ -116,7 +116,7 @@ variable is written once and not visible thereafter. Defaults to `False`. * `VariableSetId` - ID of the variable set that owns the variable. ~> **NOTE:** When `Sensitive` is set to true, Terraform cannot detect and repair -drift if `Value` is later changed out-of-band via the Terraform Cloud UI. +drift if `Value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `Value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index ec6f8d392..764ac546b 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -12,8 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. - -~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -119,7 +118,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `True`. When set to `False`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `False`. The provider uses `True` as any workspace provisioned with `False` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -136,7 +135,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `SpeculativeEnabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `True`. Setting this to `False` prevents Terraform Cloud + plans. Defaults to `True`. Setting this to `False` prevents HCP Terraform 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. @@ -157,7 +156,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. +* `TriggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `TriggerPrefixes`. * `TriggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `VcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/cdktf/go/r/workspace_run.html.markdown b/website/docs/cdktf/go/r/workspace_run.html.markdown index 86eba172a..17d31514f 100644 --- a/website/docs/cdktf/go/r/workspace_run.html.markdown +++ b/website/docs/cdktf/go/r/workspace_run.html.markdown @@ -224,8 +224,8 @@ The following arguments are supported: Both `Apply` and `Destroy` block supports: -* `ManualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `False`. - * If `WaitForRun` is set to `False`, this auto-apply will be done by Terraform Cloud. +* `ManualConfirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `False`. + * If `WaitForRun` is set to `False`, this auto-apply will be done by HCP Terraform. * If `WaitForRun` is set to `True`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `ManualConfirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `AutoApply` with the `TfeWorkspace` data source. * `Retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `RetryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `True`. @@ -238,5 +238,5 @@ Both `Apply` and `Destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. +* `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_run_task.html.markdown b/website/docs/cdktf/go/r/workspace_run_task.html.markdown index 9120d9a02..af04183ce 100644 --- a/website/docs/cdktf/go/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/go/r/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/go/r/workspace_settings.markdown b/website/docs/cdktf/go/r/workspace_settings.markdown index 3b5cd4d88..2ae60b1cf 100644 --- a/website/docs/cdktf/go/r/workspace_settings.markdown +++ b/website/docs/cdktf/go/r/workspace_settings.markdown @@ -142,7 +142,7 @@ The following arguments are supported: * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference diff --git a/website/docs/cdktf/java/d/ip_ranges.html.markdown b/website/docs/cdktf/java/d/ip_ranges.html.markdown index 263877c09..26c254cb9 100644 --- a/website/docs/cdktf/java/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/java/d/ip_ranges.html.markdown @@ -2,12 +2,12 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -36,7 +36,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `notifications` - The list of IP ranges in CIDR notation used for notifications. * `sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/cdktf/java/d/organization.html.markdown b/website/docs/cdktf/java/d/organization.html.markdown index c91e00ea9..c0a56628d 100644 --- a/website/docs/cdktf/java/d/organization.html.markdown +++ b/website/docs/cdktf/java/d/organization.html.markdown @@ -40,9 +40,9 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. -* `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `assessmentsEnforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `collaboratorAuthPolicy` - Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. -* `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/cdktf/java/d/organization_membership.html.markdown b/website/docs/cdktf/java/d/organization_membership.html.markdown index f7dc4b44f..95270a8e3 100644 --- a/website/docs/cdktf/java/d/organization_membership.html.markdown +++ b/website/docs/cdktf/java/d/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/cdktf/java/d/organization_run_task.html.markdown b/website/docs/cdktf/java/d/organization_run_task.html.markdown index f9cf694c6..54f03175b 100644 --- a/website/docs/cdktf/java/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/java/d/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/java/d/slug.html.markdown b/website/docs/cdktf/java/d/slug.html.markdown index e21a72d67..04646bb98 100644 --- a/website/docs/cdktf/java/d/slug.html.markdown +++ b/website/docs/cdktf/java/d/slug.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/cdktf/java/d/workspace.html.markdown b/website/docs/cdktf/java/d/workspace.html.markdown index c2757acbe..6c35a05c2 100644 --- a/website/docs/cdktf/java/d/workspace.html.markdown +++ b/website/docs/cdktf/java/d/workspace.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -47,7 +47,7 @@ In addition to all arguments above, the following attributes are exported: * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `assessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). * `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `globalRemoteState` is set to `true`. @@ -67,9 +67,9 @@ In addition to all arguments above, the following attributes are exported: * `structuredRunOutputEnabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `tagNames` - The names of tags added to this workspace. * `terraformVersion` - The version (or version constraint) of Terraform used for this workspace. -* `triggerPrefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `triggerPrefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. * `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfeWorkspaceSettings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/cdktf/java/d/workspace_run_task.html.markdown b/website/docs/cdktf/java/d/workspace_run_task.html.markdown index 743a50ecb..648f04556 100644 --- a/website/docs/cdktf/java/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/java/d/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index f5fc97051..bfcf361ab 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -1,18 +1,18 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -24,7 +24,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -48,12 +48,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + hostname = var.hostname # Optional, defaults to HCP Terraform `appTerraformIo` token = var.token version = "~> 0.53.0" } @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `tfeHostname` environment variable. -* `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` diff --git a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown index 78e686b1f..622ca4ab5 100644 --- a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown @@ -11,9 +11,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/cdktf/java/r/agent_token.html.markdown b/website/docs/cdktf/java/r/agent_token.html.markdown index 7c7950c62..ee927bb0d 100644 --- a/website/docs/cdktf/java/r/agent_token.html.markdown +++ b/website/docs/cdktf/java/r/agent_token.html.markdown @@ -8,7 +8,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/cdktf/java/r/notification_configuration.html.markdown b/website/docs/cdktf/java/r/notification_configuration.html.markdown index b5dfcaaa5..1d8226dbf 100644 --- a/website/docs/cdktf/java/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/java/r/notification_configuration.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -155,9 +155,9 @@ The following arguments are supported: * `destinationType` - (Required) The type of notification configuration payload to send. Valid values are: * `generic` - * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoftTeams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoftTeams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `destinationType` is `generic`, `microsoftTeams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/cdktf/java/r/oauth_client.html.markdown b/website/docs/cdktf/java/r/oauth_client.html.markdown index 10ffa2236..b9971f0e2 100644 --- a/website/docs/cdktf/java/r/oauth_client.html.markdown +++ b/website/docs/cdktf/java/r/oauth_client.html.markdown @@ -39,7 +39,7 @@ public class MyConvertedCode extends TerraformStack { #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -67,7 +67,7 @@ public class MyConvertedCode extends TerraformStack { #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsaPublicKey`. diff --git a/website/docs/cdktf/java/r/opa_version.html.markdown b/website/docs/cdktf/java/r/opa_version.html.markdown index 73ad963fc..ec06ecbe8 100644 --- a/website/docs/cdktf/java/r/opa_version.html.markdown +++ b/website/docs/cdktf/java/r/opa_version.html.markdown @@ -41,7 +41,7 @@ The following arguments are supported: * `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. @@ -62,6 +62,6 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization.html.markdown b/website/docs/cdktf/java/r/organization.html.markdown index 28d572537..31a21048f 100644 --- a/website/docs/cdktf/java/r/organization.html.markdown +++ b/website/docs/cdktf/java/r/organization.html.markdown @@ -45,10 +45,10 @@ The following arguments are supported: * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. -* `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `sendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. -* `assessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `assessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/cdktf/java/r/organization_membership.html.markdown b/website/docs/cdktf/java/r/organization_membership.html.markdown index beb0aa529..d79169891 100644 --- a/website/docs/cdktf/java/r/organization_membership.html.markdown +++ b/website/docs/cdktf/java/r/organization_membership.html.markdown @@ -9,7 +9,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/cdktf/java/r/organization_run_task.html.markdown b/website/docs/cdktf/java/r/organization_run_task.html.markdown index b5526b76d..06e680375 100644 --- a/website/docs/cdktf/java/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/java/r/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index 7b4570b1a..b3f6bbbd6 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/cdktf/java/r/run_trigger.html.markdown b/website/docs/cdktf/java/r/run_trigger.html.markdown index ab39f922e..aa1f0d6f3 100644 --- a/website/docs/cdktf/java/r/run_trigger.html.markdown +++ b/website/docs/cdktf/java/r/run_trigger.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/cdktf/java/r/sentinel_version.html.markdown b/website/docs/cdktf/java/r/sentinel_version.html.markdown index 4dfbecd80..a3b78d9b4 100644 --- a/website/docs/cdktf/java/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/java/r/sentinel_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -41,7 +41,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. @@ -62,6 +62,6 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team_organization_member.html.markdown b/website/docs/cdktf/java/r/team_organization_member.html.markdown index 47ee810c7..5eaa5550e 100644 --- a/website/docs/cdktf/java/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/java/r/team_organization_member.html.markdown @@ -14,7 +14,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/java/r/team_organization_members.html.markdown b/website/docs/cdktf/java/r/team_organization_members.html.markdown index 5164b24cb..bb5fd68a2 100644 --- a/website/docs/cdktf/java/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/java/r/team_organization_members.html.markdown @@ -14,7 +14,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/java/r/terraform_version.html.markdown b/website/docs/cdktf/java/r/terraform_version.html.markdown index 7e7d59769..e35695f98 100644 --- a/website/docs/cdktf/java/r/terraform_version.html.markdown +++ b/website/docs/cdktf/java/r/terraform_version.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -39,7 +39,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `deprecated` is true. @@ -60,6 +60,6 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/java/r/variable.html.markdown b/website/docs/cdktf/java/r/variable.html.markdown index 779e4a090..477cd345c 100644 --- a/website/docs/cdktf/java/r/variable.html.markdown +++ b/website/docs/cdktf/java/r/variable.html.markdown @@ -108,7 +108,7 @@ variable is written once and not visible thereafter. Defaults to `false`. * `variableSetId` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair -drift if `value` is later changed out-of-band via the Terraform Cloud UI. +drift if `value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index dbc42ef46..731b3184f 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -12,8 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `executionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. - -~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -108,7 +107,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `true`. When set to `false`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -125,7 +124,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `speculativeEnabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `true`. Setting this to `false` prevents Terraform Cloud + plans. Defaults to `true`. Setting this to `false` prevents HCP Terraform 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. @@ -146,7 +145,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/cdktf/java/r/workspace_run.html.markdown b/website/docs/cdktf/java/r/workspace_run.html.markdown index e384d6dc2..cef85d937 100644 --- a/website/docs/cdktf/java/r/workspace_run.html.markdown +++ b/website/docs/cdktf/java/r/workspace_run.html.markdown @@ -210,8 +210,8 @@ The following arguments are supported: Both `apply` and `destroy` block supports: -* `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. +* `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. + * If `waitForRun` is set to `false`, this auto-apply will be done by HCP Terraform. * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfeWorkspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. @@ -224,5 +224,5 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. +* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_run_task.html.markdown b/website/docs/cdktf/java/r/workspace_run_task.html.markdown index 384eaef1d..0947c38b7 100644 --- a/website/docs/cdktf/java/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/java/r/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/java/r/workspace_settings.markdown b/website/docs/cdktf/java/r/workspace_settings.markdown index f1b7262d3..b26d65803 100644 --- a/website/docs/cdktf/java/r/workspace_settings.markdown +++ b/website/docs/cdktf/java/r/workspace_settings.markdown @@ -122,7 +122,7 @@ The following arguments are supported: * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index 545b0540a..8815924b6 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -2,14 +2,14 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -39,7 +39,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `notifications` - The list of IP ranges in CIDR notation used for notifications. * `sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index e28ac7661..07b6e2775 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -41,9 +41,9 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `external_id` - An identifier for the organization. -* `assessments_enforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `assessments_enforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `collaborator_auth_policy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. -* `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index 5d34fc000..7e5cfd59f 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index f4057ee90..fe30dd820 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index c4f0c8a54..3cde8b5ec 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index a60c39267..3286a7bed 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -48,7 +48,7 @@ In addition to all arguments above, the following attributes are exported: * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `assessments_enabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). * `remote_state_consumer_ids` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `global_remote_state` is set to `true`. @@ -68,9 +68,9 @@ In addition to all arguments above, the following attributes are exported: * `structured_run_output_enabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `tag_names` - The names of tags added to this workspace. * `terraform_version` - The version (or version constraint) of Terraform used for this workspace. -* `trigger_prefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `trigger_prefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcs_repo` - Settings for the workspace's VCS repository. * `working_directory` - A relative path that Terraform will execute within. * `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 84261df7d..8a0452d2a 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index ade17ce04..88f5382fa 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -1,18 +1,18 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -24,7 +24,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -48,12 +48,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -125,10 +125,10 @@ class MyConvertedCode(TerraformStack): The following arguments are supported: -* `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TFE_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. See [Authentication](#authentication) above for more information. * `ssl_skip_verify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index b3908db0f..eb8ae5940 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -11,9 +11,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index 0a6b17a56..d2176cbb4 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -10,7 +10,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index d6e1694af..dbd5276f3 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -154,9 +154,9 @@ The following arguments are supported: * `destination_type` - (Required) The type of notification configuration payload to send. Valid values are: * `generic` - * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoft-teams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `email_addresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `destination_type` is `generic`, `microsoft-teams`, or `slack`. * `email_user_ids` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index a0d2139ef..f856bc68c 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -42,7 +42,7 @@ class MyConvertedCode(TerraformStack): #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -71,7 +71,7 @@ class MyConvertedCode(TerraformStack): #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsa_public_key`. diff --git a/website/docs/cdktf/python/r/opa_version.html.markdown b/website/docs/cdktf/python/r/opa_version.html.markdown index a6beba2e4..243e8df08 100644 --- a/website/docs/cdktf/python/r/opa_version.html.markdown +++ b/website/docs/cdktf/python/r/opa_version.html.markdown @@ -42,7 +42,7 @@ The following arguments are supported: * `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. @@ -63,6 +63,6 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index babd13d88..4b6dee594 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -46,10 +46,10 @@ The following arguments are supported: * `collaborator_auth_policy` - (Optional) Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. * `owners_team_saml_role_id` - (Optional) The name of the "owners" team. -* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. -* `assessments_enforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `assessments_enforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allow_force_delete_workspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 93f7c20b1..9170eb8d7 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 0f562bca2..343f6b044 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 9aadf00f2..709544552 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index 1ef9fc6f8..df20da152 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/cdktf/python/r/sentinel_version.html.markdown b/website/docs/cdktf/python/r/sentinel_version.html.markdown index f1cf14543..9cdc86f21 100644 --- a/website/docs/cdktf/python/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -42,7 +42,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. @@ -63,6 +63,6 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 048cfa5d9..30df802ba 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -16,7 +16,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 7895bcf61..e24bd8262 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -16,7 +16,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 010e15457..741305dbf 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -42,7 +42,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `deprecated` is true. @@ -63,6 +63,6 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index a606daed4..bacb23e52 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -112,7 +112,7 @@ variable is written once and not visible thereafter. Defaults to `false`. * `variable_set_id` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair -drift if `value` is later changed out-of-band via the Terraform Cloud UI. +drift if `value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 99f3ba59a..7eff9ff55 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -13,7 +13,7 @@ Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `execution_mode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. -~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -110,7 +110,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `true`. When set to `false`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -127,7 +127,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `speculative_enabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `true`. Setting this to `false` prevents Terraform Cloud + plans. Defaults to `true`. Setting this to `false` prevents HCP Terraform 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. @@ -148,7 +148,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. +* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `trigger_prefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcs_repo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index 200047332..84e2790a6 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -213,8 +213,8 @@ The following arguments are supported: Both `apply` and `destroy` block supports: -* `manual_confirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `wait_for_run` is set to `false`, this auto-apply will be done by Terraform Cloud. +* `manual_confirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. + * If `wait_for_run` is set to `false`, this auto-apply will be done by HCP Terraform. * If `wait_for_run` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manual_confirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `auto_apply` with the `tfe_workspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retry_attempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. @@ -227,5 +227,5 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. +* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index b27948513..9a8c536d6 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index 3825237d4..5bed20c55 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -128,7 +128,7 @@ The following arguments are supported: * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 93428bb23..619c8b782 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -2,14 +2,14 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -42,7 +42,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `notifications` - The list of IP ranges in CIDR notation used for notifications. * `sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 7f2b0b3fc..c8c2e5f36 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -44,9 +44,9 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. -* `assessmentsEnforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `assessmentsEnforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `collaboratorAuthPolicy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. -* `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index 1f6b95439..17657f337 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index eb3ef17ab..ced7a4194 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 84a8bf12d..3e121741d 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 5a491e8d7..d78b4727a 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -11,7 +11,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -51,7 +51,7 @@ In addition to all arguments above, the following attributes are exported: * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `assessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `assessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). * `remoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `globalRemoteState` is set to `true`. @@ -71,9 +71,9 @@ In addition to all arguments above, the following attributes are exported: * `structuredRunOutputEnabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `tagNames` - The names of tags added to this workspace. * `terraformVersion` - The version (or version constraint) of Terraform used for this workspace. -* `triggerPrefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `triggerPrefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. * `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 5d1a71a5b..5ccb6689f 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index dae0514b7..e1c75f06d 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -1,18 +1,18 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -24,7 +24,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -48,12 +48,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -135,10 +135,10 @@ class MyConvertedCode extends TerraformStack { The following arguments are supported: -* `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TFE_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index f532fa426..76bb59161 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -11,9 +11,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index a9b84db50..f36186414 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -10,7 +10,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index a4d382fde..8b8518e06 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -186,9 +186,9 @@ The following arguments are supported: * `destinationType` - (Required) The type of notification configuration payload to send. Valid values are: * `generic` - * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoft-teams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `destinationType` is `generic`, `microsoft-teams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 1a3b53615..d02868f1f 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -45,7 +45,7 @@ class MyConvertedCode extends TerraformStack { #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -78,7 +78,7 @@ class MyConvertedCode extends TerraformStack { #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsaPublicKey`. diff --git a/website/docs/cdktf/typescript/r/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown index e1d634b0d..616a73c82 100644 --- a/website/docs/cdktf/typescript/r/opa_version.html.markdown +++ b/website/docs/cdktf/typescript/r/opa_version.html.markdown @@ -45,7 +45,7 @@ The following arguments are supported: * `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. @@ -66,6 +66,6 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 3ba278ef1..05b4e55e4 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -49,10 +49,14 @@ The following arguments are supported: * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. -* `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. +<<<<<<< HEAD * `aggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `sendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. -* `assessmentsEnforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `assessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +======= +* `assessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +>>>>>>> 79010b4f (Removed all references to HCP Terraform) * `allowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 094241ddd..7874e4048 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -11,7 +11,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index a52e2e0b8..462ace970 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 1404322a4..b29f30999 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 24f65857b..e8bc59ed1 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown index c11688de7..f439c7125 100644 --- a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -45,7 +45,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. @@ -66,6 +66,6 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index 9c60fbb77..f264c9f96 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -16,7 +16,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 7dda75e25..425e367ba 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -16,7 +16,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 498537295..7dfc5508d 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -45,7 +45,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `deprecatedReason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `deprecated` is true. @@ -66,6 +66,6 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 329aa0a2d..46e787a4f 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -118,7 +118,7 @@ variable is written once and not visible thereafter. Defaults to `false`. * `variableSetId` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair -drift if `value` is later changed out-of-band via the Terraform Cloud UI. +drift if `value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index e260749b3..4630dc0ce 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -13,7 +13,7 @@ Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `executionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. -~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -116,7 +116,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `true`. When set to `false`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -133,7 +133,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `speculativeEnabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `true`. Setting this to `false` prevents Terraform Cloud + plans. Defaults to `true`. Setting this to `false` prevents HCP Terraform 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. @@ -154,7 +154,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 388a6fded..fabcce29e 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -222,8 +222,8 @@ The following arguments are supported: Both `apply` and `destroy` block supports: -* `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `waitForRun` is set to `false`, this auto-apply will be done by Terraform Cloud. +* `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. + * If `waitForRun` is set to `false`, this auto-apply will be done by HCP Terraform. * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfe_workspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. @@ -236,5 +236,5 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. +* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index b45d66f2a..f4c7001e4 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -9,7 +9,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index 26cba38c8..5ce4c9141 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -146,7 +146,7 @@ The following arguments are supported: * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference diff --git a/website/docs/d/ip_ranges.html.markdown b/website/docs/d/ip_ranges.html.markdown index 0a2559354..9fcec42c5 100644 --- a/website/docs/d/ip_ranges.html.markdown +++ b/website/docs/d/ip_ranges.html.markdown @@ -2,12 +2,12 @@ layout: "tfe" page_title: "Terraform Enterprise: tfe_ip_ranges" description: |- - Get Terraform Cloud/Enterprise's IP ranges of its services + Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- # Data Source: tfe_ip_ranges -Use this data source to retrieve a list of Terraform Cloud's IP ranges. For more information about these IP ranges, view our [documentation about Terraform Cloud IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). +Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). ## Example Usage @@ -27,7 +27,7 @@ No arguments are required for this datasource. The following attributes are exported: -* `api` - The list of IP ranges in CIDR notation used for connections from user site to Terraform Cloud APIs. +* `api` - The list of IP ranges in CIDR notation used for connections from user site to HCP Terraform APIs. * `notifications` - The list of IP ranges in CIDR notation used for notifications. * `sentinel` - The list of IP ranges in CIDR notation used for outbound requests from Sentinel policies. * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. diff --git a/website/docs/d/organization.html.markdown b/website/docs/d/organization.html.markdown index 95fb50f3b..062b406c3 100644 --- a/website/docs/d/organization.html.markdown +++ b/website/docs/d/organization.html.markdown @@ -28,9 +28,9 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `external_id` - An identifier for the organization. -* `assessments_enforced` - (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. +* `assessments_enforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. * `collaborator_auth_policy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. -* `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `cost_estimation_enabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `owners_team_saml_role_id` - The name of the "owners" team. * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. diff --git a/website/docs/d/organization_membership.html.markdown b/website/docs/d/organization_membership.html.markdown index 14ec12230..b8b2a6662 100644 --- a/website/docs/d/organization_membership.html.markdown +++ b/website/docs/d/organization_membership.html.markdown @@ -9,7 +9,7 @@ description: |- Use this data source to get information about an organization membership. -~> **NOTE:** This data source requires using the provider with Terraform Cloud or +~> **NOTE:** This data source requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** If a user updates their email address, configurations using the email address should diff --git a/website/docs/d/organization_run_task.html.markdown b/website/docs/d/organization_run_task.html.markdown index a92c820ca..0efd1dd8b 100644 --- a/website/docs/d/organization_run_task.html.markdown +++ b/website/docs/d/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about an [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/d/slug.html.markdown b/website/docs/d/slug.html.markdown index e6756d755..2b70a13ee 100644 --- a/website/docs/d/slug.html.markdown +++ b/website/docs/d/slug.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem -intended to be uploaded to Terraform Cloud/Enterprise, in lieu of those files being +intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of those files being sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index c05287009..da6018846 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -9,7 +9,7 @@ description: |- Use this data source to get information about a workspace. -~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -35,7 +35,7 @@ In addition to all arguments above, the following attributes are exported: * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -* `assessments_enabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +* `assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). * `remote_state_consumer_ids` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `global_remote_state` is set to `true`. @@ -55,9 +55,9 @@ In addition to all arguments above, the following attributes are exported: * `structured_run_output_enabled` - Indicates whether runs in this workspace use the enhanced apply UI. * `tag_names` - The names of tags added to this workspace. * `terraform_version` - The version (or version constraint) of Terraform used for this workspace. -* `trigger_prefixes` - List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. - Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. -* `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. +* `trigger_prefixes` - List of trigger prefixes that describe the paths HCP Terraform monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. + HCP Terraform or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes. +* `trigger_patterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcs_repo` - Settings for the workspace's VCS repository. * `working_directory` - A relative path that Terraform will execute within. * `execution_mode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. diff --git a/website/docs/d/workspace_run_task.html.markdown b/website/docs/d/workspace_run_task.html.markdown index bff6bf459..05d0131ad 100644 --- a/website/docs/d/workspace_run_task.html.markdown +++ b/website/docs/d/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # Data Source: tfe_workspace_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. Use this data source to get information about a [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 51add7bd3..90fc05815 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -1,16 +1,16 @@ --- layout: "tfe" -page_title: "Provider: Terraform Cloud/Enterprise" +page_title: "Provider: HCP Terraform and Terraform Enterprise" description: |- - Provision Terraform Cloud or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the Terraform Cloud team at HashiCorp. + Provision HCP Terraform or Terraform Enterprise - with Terraform! Management of organizations, workspaces, teams, variables, run triggers, policy sets, and more. Maintained by the HCP Terraform team at HashiCorp. --- -# Terraform Cloud/Enterprise Provider +# HCP Terraform and Terraform Enterprise Provider This provider is used to interact with the many resources supported by -[Terraform Cloud](/docs/cloud/index.html). As [Terraform +[HCP Terraform](/docs/cloud/index.html). As [Terraform Enterprise](/docs/enterprise/index.html) is a self-hosted distribution of -Terraform Cloud, this provider supports both Cloud and Enterprise. +HCP Terraform, this provider supports both Cloud and Enterprise. Use the navigation to the left to read about the available resources. @@ -22,7 +22,7 @@ For more information, see [Versions](#versions). ## Authentication -This provider requires a Terraform Cloud/Enterprise API token in order to manage +This provider requires a HCP Terraform and Terraform Enterprise API token in order to manage resources. To manage the full selection of resources, provide a [user @@ -46,12 +46,12 @@ the token. When configuring the input variable for either of these options, mark them as sensitive. --> **Note:** If you are using this provider in Terraform Cloud or Terraform +-> **Note:** If you are using this provider in HCP Terraform or Terraform Enterprise, you will need to use one of the two options above, even if you're using the `remote` backend with [remote operations](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) and the [CLI-driven Run workflow](/docs/cloud/run/cli.html). -If you are using this provider on your local command line without remote operations (i.e. only using Terraform Cloud as a +If you are using this provider on your local command line without remote operations (i.e. only using HCP Terraform as a [remote state backend](https://developer.hashicorp.com/terraform/language/state/remote)), there are two more options available to you: @@ -99,7 +99,7 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + hostname = var.hostname # Optional, defaults to HCP Terraform `app.terraform.io` token = var.token version = "~> 0.53.0" } @@ -114,10 +114,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `hostname` - (Optional) The Terraform Cloud/Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TFE_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with Terraform Cloud/Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `ssl_skip_verify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` diff --git a/website/docs/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/r/agent_pool_allowed_workspaces.html.markdown index 6f533db42..b753d64dd 100644 --- a/website/docs/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/r/agent_pool_allowed_workspaces.html.markdown @@ -9,9 +9,9 @@ description: |- Adds and removes allowed workspaces on an agent pool. -~> **NOTE:** This resource requires using the provider with Terraform Cloud and a Terraform Cloud +~> **NOTE:** This resource requires using the provider with HCP Terraform and a HCP Terraform for Business account. -[Learn more about Terraform Cloud pricing here](https://www.hashicorp.com/products/terraform/pricing). +[Learn more about HCP Terraform pricing here](https://www.hashicorp.com/products/terraform/pricing). ## Example Usage diff --git a/website/docs/r/agent_token.html.markdown b/website/docs/r/agent_token.html.markdown index d6b15696d..0a8111a7f 100644 --- a/website/docs/r/agent_token.html.markdown +++ b/website/docs/r/agent_token.html.markdown @@ -8,7 +8,7 @@ description: |- # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. -These tokens allow agents to communicate securely with Terraform Cloud. +These tokens allow agents to communicate securely with HCP Terraform. ## Example Usage diff --git a/website/docs/r/notification_configuration.html.markdown b/website/docs/r/notification_configuration.html.markdown index 10b6c2c0e..2abe6d4d1 100644 --- a/website/docs/r/notification_configuration.html.markdown +++ b/website/docs/r/notification_configuration.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_notification_configuration -Terraform Cloud can be configured to send notifications for run state transitions. +HCP Terraform can be configured to send notifications for run state transitions. Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace. @@ -102,9 +102,9 @@ The following arguments are supported: * `destination_type` - (Required) The type of notification configuration payload to send. Valid values are: * `generic` - * `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later + * `email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later + * `microsoft-teams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `email_addresses` - (Optional) **TFE only** A list of email addresses. This value _must not_ be provided if `destination_type` is `generic`, `microsoft-teams`, or `slack`. * `email_user_ids` - (Optional) A list of user IDs. This value _must not_ be provided diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index 00aec36b0..60155e2bd 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -30,7 +30,7 @@ resource "tfe_oauth_client" "test" { #### Azure DevOps Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/azure-devops-server). **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. @@ -48,7 +48,7 @@ resource "tfe_oauth_client" "test" { #### BitBucket Server Usage -See [documentation for TFC/E setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). When using BitBucket Server, you must use three required fields: `key`, `secret`, `rsa_public_key`. diff --git a/website/docs/r/opa_version.html.markdown b/website/docs/r/opa_version.html.markdown index 8c8503021..a87ff5fe3 100644 --- a/website/docs/r/opa_version.html.markdown +++ b/website/docs/r/opa_version.html.markdown @@ -29,7 +29,7 @@ The following arguments are supported: * `url` - (Required) The URL where a 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed OPA binary. * `official` - (Optional) Whether or not this is an official release of OPA. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of OPA is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of OPA is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of OPA is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of OPA is deprecated. Defaults to "null" unless `deprecated` is true. @@ -50,4 +50,4 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` diff --git a/website/docs/r/organization.html.markdown b/website/docs/r/organization.html.markdown index c72a0ff49..c2c24451e 100644 --- a/website/docs/r/organization.html.markdown +++ b/website/docs/r/organization.html.markdown @@ -33,10 +33,10 @@ The following arguments are supported: * `collaborator_auth_policy` - (Optional) Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. * `owners_team_saml_role_id` - (Optional) The name of the "owners" team. -* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. +* `cost_estimation_enabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `send_passing_statuses_for_untriggered_speculative_plans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `send_passing_statuses_for_untriggered_speculative_plans` needs to be false. -* `assessments_enforced` - (Optional) (Available only in Terraform Cloud) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. +* `assessments_enforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. * `allow_force_delete_workspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference diff --git a/website/docs/r/organization_membership.html.markdown b/website/docs/r/organization_membership.html.markdown index ba03cd04d..b2feec05a 100644 --- a/website/docs/r/organization_membership.html.markdown +++ b/website/docs/r/organization_membership.html.markdown @@ -9,7 +9,7 @@ description: |- Add or remove a user from an organization. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ~> **NOTE:** This resource cannot be used to update an existing user's email address diff --git a/website/docs/r/organization_run_task.html.markdown b/website/docs/r/organization_run_task.html.markdown index 5676125ef..4e019f4a4 100644 --- a/website/docs/r/organization_run_task.html.markdown +++ b/website/docs/r/organization_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_organization_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_organization_run_task resource creates, updates and destroys [Organization Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index 548dcbed9..495700a2f 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_registry_module -Terraform Cloud's private module registry helps you share Terraform modules across your organization. +HCP Terraform's private module registry helps you share Terraform modules across your organization. ## Example Usage diff --git a/website/docs/r/run_trigger.html.markdown b/website/docs/r/run_trigger.html.markdown index 973e0a458..930389e92 100644 --- a/website/docs/r/run_trigger.html.markdown +++ b/website/docs/r/run_trigger.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_run_trigger -Terraform Cloud provides a way to connect your workspace to one or more workspaces within your organization, +HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, known as "source workspaces". These connections, called run triggers, allow runs to queue automatically in your workspace on successful apply of runs in any of the source workspaces. You can connect your workspace to up to 20 source workspaces. diff --git a/website/docs/r/sentinel_version.html.markdown b/website/docs/r/sentinel_version.html.markdown index d1b669953..91ac02b60 100644 --- a/website/docs/r/sentinel_version.html.markdown +++ b/website/docs/r/sentinel_version.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_sentinel_version -Manage Sentinel versions available on Terraform Cloud/Enterprise. +Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -29,7 +29,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Sentinel binary. * `official` - (Optional) Whether or not this is an official release of Sentinel. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Sentinel is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Sentinel is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Sentinel is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of Sentinel is deprecated. Defaults to "null" unless `deprecated` is true. @@ -50,4 +50,4 @@ terraform import tfe_sentinel_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_sentinel_version.test 0.24.0 ``` --> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` diff --git a/website/docs/r/team_organization_member.html.markdown b/website/docs/r/team_organization_member.html.markdown index 4966bbc06..84eb67747 100644 --- a/website/docs/r/team_organization_member.html.markdown +++ b/website/docs/r/team_organization_member.html.markdown @@ -14,7 +14,7 @@ Add or remove a team member using a resources for managing team memberships. This - along with [tfe_organization_membership](organization_membership.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/r/team_organization_members.html.markdown b/website/docs/r/team_organization_members.html.markdown index e021768d4..ed21af645 100644 --- a/website/docs/r/team_organization_members.html.markdown +++ b/website/docs/r/team_organization_members.html.markdown @@ -14,7 +14,7 @@ Add or remove one or more team members using a resources for managing team memberships. This - along with [tfe_team_organization_member](team_organization_member.html) - is the preferred method as it allows you to add members to a team by email addresses. The [tfe_team_organization_member](team_organization_member.html) is used to manage a single team membership whereas [tfe_team_organization_members](team_organization_members.html) is used to manage all team memberships at once. All four resources cannot be used for the same team simultaneously. -~> **NOTE:** This resource requires using the provider with Terraform Cloud or +~> **NOTE:** This resource requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202004-1. ## Example Usage diff --git a/website/docs/r/terraform_version.html.markdown b/website/docs/r/terraform_version.html.markdown index bd321176d..3f1a4288d 100644 --- a/website/docs/r/terraform_version.html.markdown +++ b/website/docs/r/terraform_version.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_terraform_version -Manage Terraform versions available on Terraform Cloud/Enterprise. +Manage Terraform versions available on HCP Terraform and Terraform Enterprise. ## Example Usage @@ -29,7 +29,7 @@ The following arguments are supported: * `url` - (Required) The URL where a ZIP-compressed 64-bit Linux binary of this version can be downloaded. * `sha` - (Required) The SHA-256 checksum of the compressed Terraform binary. * `official` - (Optional) Whether or not this is an official release of Terraform. Defaults to "false". -* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in Terraform Cloud/Enterprise. Defaults to "true". +* `enabled` - (Optional) Whether or not this version of Terraform is enabled for use in HCP Terraform and Terraform Enterprise. Defaults to "true". * `beta` - (Optional) Whether or not this version of Terraform is beta pre-release. Defaults to "false". * `deprecated` - (Optional) Whether or not this version of Terraform is deprecated. Defaults to "false". * `deprecated_reason` - (Optional) Additional context about why a version of Terraform is deprecated. Defaults to "null" unless `deprecated` is true. @@ -50,4 +50,4 @@ terraform import tfe_terraform_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_terraform_version.test 1.1.2 ``` --> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` diff --git a/website/docs/r/variable.html.markdown b/website/docs/r/variable.html.markdown index 30a431098..92b57b1c6 100644 --- a/website/docs/r/variable.html.markdown +++ b/website/docs/r/variable.html.markdown @@ -83,7 +83,7 @@ variable is written once and not visible thereafter. Defaults to `false`. * `variable_set_id` - ID of the variable set that owns the variable. ~> **NOTE:** When `sensitive` is set to true, Terraform cannot detect and repair -drift if `value` is later changed out-of-band via the Terraform Cloud UI. +drift if `value` is later changed out-of-band via the HCP Terraform UI. Terraform will only change the value for a sensitive variable if you change `value` in the configuration, so that it no longer matches the last known value in the state. diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 378aac39a..879e9f43a 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -11,7 +11,7 @@ Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `execution_mode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. -~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1. +~> **NOTE:** Using `global_remote_state` or `remote_state_consumer_ids` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -86,7 +86,7 @@ The following arguments are supported: automatically performing runs immediately after its creation. Defaults to `true`. When set to `false`, runs triggered by a webhook (such as a commit in VCS) will not be queued until at least one run has been manually queued. - **Note:** This default differs from the Terraform Cloud API default, which + **Note:** This default differs from the HCP Terraform API default, which is `false`. The provider uses `true` as any workspace provisioned with `false` would need to then have a run manually queued out-of-band before accepting webhooks. @@ -103,7 +103,7 @@ The following arguments are supported: workspace has been created, so modifying this value will result in the workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument * `speculative_enabled` - (Optional) Whether this workspace allows speculative - plans. Defaults to `true`. Setting this to `false` prevents Terraform Cloud + plans. Defaults to `true`. Setting this to `false` prevents HCP Terraform 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. @@ -124,7 +124,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. +* `trigger_patterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. * `trigger_prefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcs_repo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). diff --git a/website/docs/r/workspace_run.html.markdown b/website/docs/r/workspace_run.html.markdown index 9bc7e76b2..602ca6c9a 100644 --- a/website/docs/r/workspace_run.html.markdown +++ b/website/docs/r/workspace_run.html.markdown @@ -190,8 +190,8 @@ The following arguments are supported: Both `apply` and `destroy` block supports: -* `manual_confirm` - (Required) If set to true a human will have to manually confirm a plan in Terraform Cloud's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. - * If `wait_for_run` is set to `false`, this auto-apply will be done by Terraform Cloud. +* `manual_confirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. + * If `wait_for_run` is set to `false`, this auto-apply will be done by HCP Terraform. * If `wait_for_run` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manual_confirm` is set to false. * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `auto_apply` with the `tfe_workspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retry_attempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. @@ -204,4 +204,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: -* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in Terraform Cloud. \ No newline at end of file +* `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. \ No newline at end of file diff --git a/website/docs/r/workspace_run_task.html.markdown b/website/docs/r/workspace_run_task.html.markdown index ae7fb562d..de0b3a012 100644 --- a/website/docs/r/workspace_run_task.html.markdown +++ b/website/docs/r/workspace_run_task.html.markdown @@ -7,7 +7,7 @@ description: |- # tfe_workspace_run_task -[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. The tfe_workspace_run_task resource associates, updates and removes [Workspace Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#associating-run-tasks-with-a-workspace). diff --git a/website/docs/r/workspace_settings.markdown b/website/docs/r/workspace_settings.markdown index e47b78f9a..8caeea24a 100644 --- a/website/docs/r/workspace_settings.markdown +++ b/website/docs/r/workspace_settings.markdown @@ -88,7 +88,7 @@ The following arguments are supported: * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference From c325dcb3f8b9570a65cd71b68bd5a9942296f5bc Mon Sep 17 00:00:00 2001 From: Lauren Date: Tue, 23 Apr 2024 17:19:34 -0400 Subject: [PATCH 345/420] [TF-14896] Add rule to ignore linter (#1333) * add rule to ignore linter --- .golangci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index f4593b7c1..b777cc1a8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -100,6 +100,10 @@ issues: -|resource_tfe_run_trigger|resource_tfe_team_access|resource_tfe_organization_membership|resource_tfe_policy_set|resource_tfe_team_member| -|resource_tfe_workspace|resource_tfe_team_organization_member|resource_tfe_variable_set|resource_tfe_team_project_access)\.go text: "SA1019" + - linters: + - staticcheck + path: resource_tfe_workspace_run_task\.go + text: "SA1019: v.Stage is deprecated: Use Stages property instead" linters-settings: # errcheck: # # https://github.com/kisielk/errcheck#excluding-functions From 7f7950738fb776d81199d3fbd2b2aac40392146f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:54:11 +0000 Subject: [PATCH 346/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.49.0 to 1.50.0 Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.49.0 to 1.50.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.49.0...v1.50.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be30a5156..817c41069 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.15.0 - github.com/hashicorp/go-tfe v1.49.0 + github.com/hashicorp/go-tfe v1.50.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index c5a424e19..1d158d9c8 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMmZhI= github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.49.0 h1:HIxG/fwjXoZ5M4EQZcZkgYFCJkWtbsT9T/x71HQr5kw= -github.com/hashicorp/go-tfe v1.49.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= +github.com/hashicorp/go-tfe v1.50.0 h1:zs4ZNyxTqZq4EwDdLP4YxFZ6ye9aDgCG+qML/dvZnkY= +github.com/hashicorp/go-tfe v1.50.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 3c19f269747ee4e2c0596bf5f772d6d45996a0fe Mon Sep 17 00:00:00 2001 From: Zain Hasan Date: Tue, 23 Apr 2024 16:38:21 -0700 Subject: [PATCH 347/420] remaining bitbucket server references --- .../provider/resource_tfe_oauth_client_test.go | 6 +++--- .../docs/cdktf/csharp/r/oauth_client.html.markdown | 8 ++++---- website/docs/cdktf/go/r/oauth_client.html.markdown | 6 +++--- .../docs/cdktf/java/r/oauth_client.html.markdown | 6 +++--- website/docs/r/oauth_client.html.markdown | 14 +++++++------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/provider/resource_tfe_oauth_client_test.go b/internal/provider/resource_tfe_oauth_client_test.go index 45e6e2d6a..a3fe5e7d4 100644 --- a/internal/provider/resource_tfe_oauth_client_test.go +++ b/internal/provider/resource_tfe_oauth_client_test.go @@ -200,9 +200,9 @@ resource "tfe_organization" "foobar" { resource "tfe_oauth_client" "foobar" { organization = tfe_organization.foobar.id name = "foobar_oauth" - api_url = "https://bbs.example.com" - http_url = "https://bbs.example.com" - service_provider = "bitbucket_server" + api_url = "https://bbdc.example.com" + http_url = "https://bbdc.example.com" + service_provider = "bitbucket_data_center" key = "1e4843e138b0d44911a50d15e0f7cee4" secret = < \ No newline at end of file + diff --git a/website/docs/cdktf/go/r/oauth_client.html.markdown b/website/docs/cdktf/go/r/oauth_client.html.markdown index ab98761d2..a2385138a 100644 --- a/website/docs/cdktf/go/r/oauth_client.html.markdown +++ b/website/docs/cdktf/go/r/oauth_client.html.markdown @@ -94,10 +94,10 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { this := &myConvertedCode{} cdktf.NewTerraformStack_Override(this, scope, name) oauthClient.NewOauthClient(this, jsii.String("test"), &oauthClientConfig{ - apiUrl: jsii.String("https://bbs.example.com"), - httpUrl: jsii.String("https://bss.example.com"), + apiUrl: jsii.String("https://bbdc.example.com"), + httpUrl: jsii.String("https://bbdc.example.com"), key: jsii.String(""), - name: jsii.String("my-bbs-oauth-client"), + name: jsii.String("my-bbdc-oauth-client"), organization: jsii.String("my-org-name"), rsaPublicKey: jsii.String("-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----\n"), secret: jsii.String("-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----\n"), diff --git a/website/docs/cdktf/java/r/oauth_client.html.markdown b/website/docs/cdktf/java/r/oauth_client.html.markdown index 5f17a0c6e..809b05412 100644 --- a/website/docs/cdktf/java/r/oauth_client.html.markdown +++ b/website/docs/cdktf/java/r/oauth_client.html.markdown @@ -82,8 +82,8 @@ public class MyConvertedCode extends TerraformStack { public MyConvertedCode(Construct scope, String name) { super(scope, name); new OauthClient(this, "test", new OauthClientConfig() - .apiUrl("https://bbs.example.com") - .httpUrl("https://bss.example.com") + .apiUrl("https://bbdc.example.com") + .httpUrl("https://bbdc.example.com") .key("") .name("my-bbdc-oauth-client") .organization("my-org-name") @@ -125,4 +125,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index 73b5393c3..89a650fb7 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -55,14 +55,14 @@ When using Bitbucket Data Center, you must use three required fields: `key`, `se ```hcl resource "tfe_oauth_client" "test" { - name = "my-bbs-oauth-client" + name = "my-bbdc-oauth-client" organization = "my-org-name" - api_url = "https://bbs.example.com" - http_url = "https://bss.example.com" + api_url = "https://bbdc.example.com" + http_url = "https://bbdc.example.com" key = "" secret = "-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----" rsa_public_key = "-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----" - service_provider = "bitbucket_server" + service_provider = "bitbucket_data_center" } ``` @@ -80,11 +80,11 @@ The following arguments are supported: * `private_key` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucket_server`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the +* `secret` - (Required for `bitbucket_data_center`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `rsa_public_key` - (Required for `bitbucket_server`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The +* `rsa_public_key` - (Required for `bitbucket_data_center`) Required for Bitbucket + Data Center in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your Bitbucket Data Center Application Link. * `service_provider` - (Required) The VCS provider being connected with. Valid From 54e561d083dfae04c75bc21f76fce6b2aa22eb23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:38:40 +0000 Subject: [PATCH 348/420] Build(deps): Bump actions/checkout from 4.1.3 to 4.1.4 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/1d96c772d19495a3b5c517cd2bc0cb401ea0529f...0ad4b8fadaa221de15dcec353f45205ec38ea70b) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6d21c1fe..321167ce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 6d1e8102c..5db16f5a5 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index c63b6591b..3cca9f677 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 495b90ffb..26b3c7a26 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6540b0549..398c6a6ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: fetch-depth: 0 - name: Generate Release Notes From c98e7b1d64315642fe9b789188e1b2cd383a36e1 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Wed, 24 Apr 2024 17:44:21 -0400 Subject: [PATCH 349/420] v0.54.0 changelog (#1336) --- CHANGELOG.md | 11 +- README.md | 2 +- .../cdktf/csharp/d/workspace.html.markdown | 6 +- website/docs/cdktf/csharp/index.html.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 61 +++-- .../cdktf/csharp/r/workspace.html.markdown | 2 +- .../docs/cdktf/go/d/workspace.html.markdown | 2 +- website/docs/cdktf/go/index.html.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 65 ++--- .../docs/cdktf/go/r/workspace.html.markdown | 2 +- .../docs/cdktf/java/d/workspace.html.markdown | 2 +- website/docs/cdktf/java/index.html.markdown | 8 +- ...gent_pool_allowed_workspaces.html.markdown | 63 ++--- .../docs/cdktf/java/r/workspace.html.markdown | 2 +- .../cdktf/python/d/agent_pool.html.markdown | 17 +- .../d/github_installation.html.markdown | 37 ++- .../cdktf/python/d/ip_ranges.html.markdown | 21 +- .../cdktf/python/d/oauth_client.html.markdown | 47 ++-- .../cdktf/python/d/organization.html.markdown | 18 +- .../d/organization_members.html.markdown | 22 +- .../d/organization_membership.html.markdown | 47 ++-- .../d/organization_run_task.html.markdown | 17 +- .../python/d/organization_tags.html.markdown | 17 +- .../python/d/organizations.html.markdown | 17 +- .../docs/cdktf/python/d/outputs.html.markdown | 27 +- .../cdktf/python/d/policy_set.html.markdown | 17 +- .../docs/cdktf/python/d/project.html.markdown | 17 +- .../python/d/saml_settings.html.markdown | 42 ++- .../docs/cdktf/python/d/slug.html.markdown | 22 +- .../docs/cdktf/python/d/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/d/team.html.markdown | 17 +- .../cdktf/python/d/team_access.html.markdown | 17 +- .../d/team_project_access.html.markdown | 17 +- .../docs/cdktf/python/d/teams.html.markdown | 17 +- .../cdktf/python/d/variable_set.html.markdown | 17 +- .../cdktf/python/d/variables.html.markdown | 43 ++-- .../cdktf/python/d/workspace.html.markdown | 17 +- .../python/d/workspace_ids.html.markdown | 23 +- .../python/d/workspace_run_task.html.markdown | 17 +- website/docs/cdktf/python/index.html.markdown | 51 ++-- .../r/admin_organization_settings.markdown | 78 +++--- .../cdktf/python/r/agent_pool.html.markdown | 22 +- ...gent_pool_allowed_workspaces.html.markdown | 44 ++-- .../cdktf/python/r/agent_token.html.markdown | 27 +- .../python/r/no_code_module.html.markdown | 56 ++-- .../notification_configuration.html.markdown | 96 ++++--- .../cdktf/python/r/oauth_client.html.markdown | 47 ++-- .../cdktf/python/r/organization.html.markdown | 17 +- .../r/organization_membership.html.markdown | 17 +- .../organization_module_sharing.html.markdown | 17 +- .../r/organization_run_task.html.markdown | 17 +- .../python/r/organization_token.html.markdown | 48 ++-- .../docs/cdktf/python/r/policy.html.markdown | 32 +-- .../cdktf/python/r/policy_set.html.markdown | 42 ++- .../r/policy_set_parameter.html.markdown | 28 +- .../docs/cdktf/python/r/project.html.markdown | 22 +- .../python/r/project_policy_set.html.markdown | 34 +-- .../r/project_variable_set.html.markdown | 35 ++- .../python/r/registry_module.html.markdown | 121 ++++----- .../cdktf/python/r/run_trigger.html.markdown | 33 +-- .../python/r/saml_settings.html.markdown | 35 +-- .../python/r/sentinel_policy.html.markdown | 17 +- .../docs/cdktf/python/r/ssh_key.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 32 +-- .../cdktf/python/r/team_access.html.markdown | 27 +- .../cdktf/python/r/team_member.html.markdown | 22 +- .../cdktf/python/r/team_members.html.markdown | 46 ++-- .../r/team_organization_member.html.markdown | 29 +-- .../r/team_organization_members.html.markdown | 72 +++--- .../r/team_project_access.html.markdown | 53 ++-- .../cdktf/python/r/team_token.html.markdown | 48 ++-- .../python/r/terraform_version.html.markdown | 17 +- .../cdktf/python/r/variable.html.markdown | 118 ++++----- .../cdktf/python/r/variable_set.html.markdown | 125 +++++---- .../cdktf/python/r/workspace.html.markdown | 60 ++--- .../r/workspace_policy_set.html.markdown | 35 ++- ...rkspace_policy_set_exclusion.html.markdown | 35 ++- .../python/r/workspace_run.html.markdown | 110 ++++---- .../python/r/workspace_run_task.html.markdown | 25 +- .../r/workspace_variable_set.html.markdown | 35 ++- .../typescript/d/agent_pool.html.markdown | 21 +- .../d/github_installation.html.markdown | 57 ++-- .../typescript/d/ip_ranges.html.markdown | 29 ++- .../typescript/d/oauth_client.html.markdown | 59 ++--- .../typescript/d/organization.html.markdown | 22 +- .../d/organization_members.html.markdown | 26 +- .../d/organization_membership.html.markdown | 89 +++---- .../d/organization_run_task.html.markdown | 31 +-- .../d/organization_tags.html.markdown | 23 +- .../typescript/d/organizations.html.markdown | 21 +- .../cdktf/typescript/d/outputs.html.markdown | 47 ++-- .../typescript/d/policy_set.html.markdown | 21 +- .../cdktf/typescript/d/project.html.markdown | 21 +- .../typescript/d/saml_settings.html.markdown | 41 +-- .../cdktf/typescript/d/slug.html.markdown | 26 +- .../cdktf/typescript/d/ssh_key.html.markdown | 21 +- .../cdktf/typescript/d/team.html.markdown | 21 +- .../typescript/d/team_access.html.markdown | 21 +- .../d/team_project_access.html.markdown | 21 +- .../cdktf/typescript/d/teams.html.markdown | 21 +- .../typescript/d/variable_set.html.markdown | 21 +- .../typescript/d/variables.html.markdown | 79 +++--- .../typescript/d/workspace.html.markdown | 21 +- .../typescript/d/workspace_ids.html.markdown | 27 +- .../d/workspace_run_task.html.markdown | 21 +- .../docs/cdktf/typescript/index.html.markdown | 53 ++-- .../r/admin_organization_settings.markdown | 77 +++--- .../typescript/r/agent_pool.html.markdown | 36 +-- ...gent_pool_allowed_workspaces.html.markdown | 89 ++++--- .../typescript/r/agent_token.html.markdown | 49 ++-- .../typescript/r/no_code_module.html.markdown | 140 +++++----- .../notification_configuration.html.markdown | 208 ++++++++------- .../typescript/r/oauth_client.html.markdown | 59 ++--- .../typescript/r/organization.html.markdown | 21 +- .../r/organization_membership.html.markdown | 21 +- .../organization_module_sharing.html.markdown | 21 +- .../r/organization_run_task.html.markdown | 21 +- .../r/organization_token.html.markdown | 51 ++-- .../cdktf/typescript/r/policy.html.markdown | 40 ++- .../typescript/r/policy_set.html.markdown | 43 +--- .../r/policy_set_parameter.html.markdown | 48 ++-- .../cdktf/typescript/r/project.html.markdown | 36 +-- .../r/project_policy_set.html.markdown | 54 ++-- .../r/project_variable_set.html.markdown | 51 ++-- .../r/registry_module.html.markdown | 243 ++++++++++-------- .../typescript/r/run_trigger.html.markdown | 63 +++-- .../typescript/r/saml_settings.html.markdown | 34 +-- .../r/sentinel_policy.html.markdown | 21 +- .../cdktf/typescript/r/ssh_key.html.markdown | 21 +- .../cdktf/typescript/r/team.html.markdown | 40 ++- .../typescript/r/team_access.html.markdown | 31 +-- .../typescript/r/team_member.html.markdown | 26 +- .../typescript/r/team_members.html.markdown | 54 ++-- .../r/team_organization_member.html.markdown | 47 ++-- .../r/team_organization_members.html.markdown | 119 ++++----- .../r/team_project_access.html.markdown | 65 ++--- .../typescript/r/team_token.html.markdown | 56 ++-- .../r/terraform_version.html.markdown | 21 +- .../cdktf/typescript/r/variable.html.markdown | 145 +++++------ .../typescript/r/variable_set.html.markdown | 168 +++++++----- .../typescript/r/workspace.html.markdown | 98 ++++--- .../r/workspace_policy_set.html.markdown | 51 ++-- ...rkspace_policy_set_exclusion.html.markdown | 59 +++-- .../typescript/r/workspace_run.html.markdown | 182 +++++++------ .../r/workspace_run_task.html.markdown | 26 +- .../r/workspace_variable_set.html.markdown | 55 ++-- website/docs/index.html.markdown | 2 +- 147 files changed, 2860 insertions(+), 3364 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c387afd3..29b831d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,20 @@ ## UNRELEASED -### Enhancements + +## v0.54.0 + +ENHANCEMENTS: +* Rebrand Terraform Cloud to HCP Terraform by @sebasslash [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1328) * Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) -### Features +FEATURES: * `d/tfe_oauth_client`: Add `project_ids` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * `d/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) * **New Resource**: `r/tfe_test_variable` is a new resource for creating environment variables used by registry modules for terraform test, by @aaabdelgany [1285](https://github.com/hashicorp/terraform-provider-tfe/pull/1285) +BUG FIXES: +* `r/tfe_organization_default_settings`: Fix import resource address documentation by @Uk1288 [#1324](https://github.com/hashicorp/terraform-provider-tfe/pull/1324) + ## v0.53.0 ENHANCEMENTS: diff --git a/README.md b/README.md index 7c69a386c..de048ce59 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.53.0" + version = "~> 0.54.0" } } } diff --git a/website/docs/cdktf/csharp/d/workspace.html.markdown b/website/docs/cdktf/csharp/d/workspace.html.markdown index 6cc97f431..3d1c9023a 100644 --- a/website/docs/cdktf/csharp/d/workspace.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace.html.markdown @@ -48,7 +48,11 @@ In addition to all arguments above, the following attributes are exported: * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +<<<<<<< HEAD * `AssessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. +======= +* `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. +>>>>>>> adf61bce (cdktf: update documentation) * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). * `RemoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `GlobalRemoteState` is set to `True`. @@ -88,4 +92,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index 0bfcf9188..d9f3e9b69 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.53.0" + version = "~> 0.54.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.54.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.53.0" + version = "~> 0.54.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown index cdaa77bcc..89e616d85 100644 --- a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown @@ -19,36 +19,34 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -// Ensure workspace and agent pool are create first -resource "tfe_workspace" "test-workspace" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = false -} - -// Ensure permissions are assigned second -resource "tfe_agent_pool_allowed_workspaces" "allowed" { - agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] -} - -// Lastly, ensure the workspace agent execution is assigned last by -// referencing allowed_workspaces -resource "tfe_workspace_settings" "test-workspace-settings" { - workspace_id = tfe_workspace.test-workspace.id - execution_mode = "agent" - agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeWorkspaceTestWorkspace = new Workspace.Workspace(this, "test-workspace", new WorkspaceConfig { + Name = "my-workspace-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name) + }); + var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { + Name = "my-agent-pool-name", + Organization = Token.AsString(tfeOrganizationTestOrganization.Name), + OrganizationScoped = false + }); + new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig { + AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), + AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTestWorkspace.Id) } + }); + } } ``` @@ -68,4 +66,5 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + + diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index 0ab6aab2f..87f303c48 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -187,4 +187,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/go/d/workspace.html.markdown b/website/docs/cdktf/go/d/workspace.html.markdown index 0468d5103..aafa7b257 100644 --- a/website/docs/cdktf/go/d/workspace.html.markdown +++ b/website/docs/cdktf/go/d/workspace.html.markdown @@ -91,4 +91,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index 0bfcf9188..d9f3e9b69 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.53.0" + version = "~> 0.54.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.54.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.53.0" + version = "~> 0.54.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown index cdaa77bcc..3eb86ba12 100644 --- a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown @@ -19,36 +19,42 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" +import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" +type myConvertedCode struct { + terraformStack } -// Ensure workspace and agent pool are create first -resource "tfe_workspace" "test-workspace" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = false -} - -// Ensure permissions are assigned second -resource "tfe_agent_pool_allowed_workspaces" "allowed" { - agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] -} - -// Lastly, ensure the workspace agent execution is assigned last by -// referencing allowed_workspaces -resource "tfe_workspace_settings" "test-workspace-settings" { - workspace_id = tfe_workspace.test-workspace.id - execution_mode = "agent" - agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeWorkspaceTestWorkspace := workspace.NewWorkspace(this, jsii.String("test-workspace"), &workspaceConfig{ + name: jsii.String("my-workspace-name"), + organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + }) + tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ + name: jsii.String("my-agent-pool-name"), + organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), + organizationScoped: jsii.Boolean(false), + }) + agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test-allowed-workspaces"), &agentPoolAllowedWorkspacesConfig{ + agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: []*string{ + cdktf.Token_*AsString(tfeWorkspaceTestWorkspace.id), + }, + }) + return this } ``` @@ -68,4 +74,5 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + + diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index 764ac546b..c7511d8ab 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -199,4 +199,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/java/d/workspace.html.markdown b/website/docs/cdktf/java/d/workspace.html.markdown index 6c35a05c2..6e5340ca3 100644 --- a/website/docs/cdktf/java/d/workspace.html.markdown +++ b/website/docs/cdktf/java/d/workspace.html.markdown @@ -87,4 +87,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index bfcf361ab..5f6c5117d 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.53.0" + version = "~> 0.54.0" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.54.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `appTerraformIo` token = var.token - version = "~> 0.53.0" + version = "~> 0.54.0" } # Create an organization @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown index 622ca4ab5..66bacc0fa 100644 --- a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown @@ -19,36 +19,36 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```hcl -resource "tfe_organization" "test-organization" { - name = "my-org-name" - email = "admin@company.com" -} - -// Ensure workspace and agent pool are create first -resource "tfe_workspace" "test-workspace" { - name = "my-workspace-name" - organization = tfe_organization.test-organization.name -} - -resource "tfe_agent_pool" "test-agent-pool" { - name = "my-agent-pool-name" - organization = tfe_organization.test-organization.name - organization_scoped = false -} - -// Ensure permissions are assigned second -resource "tfe_agent_pool_allowed_workspaces" "allowed" { - agent_pool_id = tfe_agent_pool.test-agent-pool.id - allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] -} - -// Lastly, ensure the workspace agent execution is assigned last by -// referencing allowed_workspaces -resource "tfe_workspace_settings" "test-workspace-settings" { - workspace_id = tfe_workspace.test-workspace.id - execution_mode = "agent" - agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.workspace.*; +import gen.providers.tfe.agentPool.*; +import gen.providers.tfe.agentPoolAllowedWorkspaces.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + Workspace tfeWorkspaceTestWorkspace = new Workspace(this, "test-workspace", new WorkspaceConfig() + .name("my-workspace-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + ); + AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() + .name("my-agent-pool-name") + .organization(Token.asString(tfeOrganizationTestOrganization.getName())) + .organizationScoped(false) + ); + new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig() + .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) + .allowedWorkspaceIds(List.of(Token.asString(tfeWorkspaceTestWorkspace.getId()))) + ); + } } ``` @@ -68,4 +68,5 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + + diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index 731b3184f..0ca2f132a 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -188,4 +188,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index df964f4cc..9445061a1 100644 --- a/website/docs/cdktf/python/d/agent_pool.html.markdown +++ b/website/docs/cdktf/python/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_agent_pool import DataTfeAgentPool -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeAgentPool(self, "test", + tfe.data_tfe_agent_pool.DataTfeAgentPool(self, "test", name="my-agent-pool-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organization_scoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 2d5ab9fd9..407d3b977 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -16,38 +16,32 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", - installation_id=12345678 + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + installation_id=12345 ) ``` ### Finding a Github App Installation by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeGithubAppInstallation(self, "gha_installation", - name="github_username_or_organization" + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", + name="installation_name" ) ``` @@ -65,5 +59,4 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index 8815924b6..fd2a980e7 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -14,20 +14,17 @@ Use this data source to retrieve a list of HCP Terraform's IP ranges. For more i ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformOutput, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ip_ranges import DataTfeIpRanges -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - addresses = DataTfeIpRanges(self, "addresses") - TerraformOutput(self, "notifications_ips", - value=addresses.notifications + data_tfe_ip_ranges_addresses = tfe.data_tfe_ip_ranges.DataTfeIpRanges(self, "addresses") + cdktf.TerraformOutput(self, "notifications_ips", + value=data_tfe_ip_ranges_addresses.notifications ) ``` @@ -45,4 +42,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 79b1e70ef..e58955357 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", oauth_client_id="oc-XXXXXXX" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its name ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", name="my-oauth-client", organization="my-org" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): ### Finding an OAuth client by its service provider ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_oauth_client import DataTfeOauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOauthClient(self, "client", + tfe.data_tfe_oauth_client.DataTfeOauthClient(self, "client", organization="my-org", service_provider="github" ) @@ -102,4 +93,4 @@ In addition to all arguments above, the following attributes are exported: * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 07b6e2775..41bc85607 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization import DataTfeOrganization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganization(self, "foo", + tfe.data_tfe_organization.DataTfeOrganization(self, "foo", name="organization-name" ) ``` @@ -48,5 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organization_members.html.markdown b/website/docs/cdktf/python/d/organization_members.html.markdown index d27f10272..701afbe7f 100644 --- a/website/docs/cdktf/python/d/organization_members.html.markdown +++ b/website/docs/cdktf/python/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_members import DataTfeOrganizationMembers -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - bar = Organization(self, "bar", + tfe_organization_bar = tfe.organization.Organization(self, "bar", email="user@hashicorp.com", name="org-bar" ) - DataTfeOrganizationMembers(self, "foo", - organization=bar.name + tfe.data_tfe_organization_members.DataTfeOrganizationMembers(self, "foo", + organization=cdktf.Token.as_string(tfe_organization_bar.name) ) ``` @@ -52,4 +48,4 @@ The `member` block contains: * `user_id` - The ID of the user. * `organization_membership_id` - The ID of the organization membership. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index 7e5cfd59f..8f9932c99 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -22,18 +22,15 @@ be updated manually. ### Fetch by email ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -42,18 +39,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by username ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", username="my-username" ) @@ -62,18 +56,15 @@ class MyConvertedCode(TerraformStack): ### Fetch by organization membership ID ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_membership import DataTfeOrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationMembership(self, "test", + tfe.data_tfe_organization_membership.DataTfeOrganizationMembership(self, "test", organization="my-org-name", organization_membership_id="ou-xxxxxxxxxxx" ) @@ -98,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index fe30dd820..0bfc0dc1e 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_run_task import DataTfeOrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationRunTask(self, "example", + tfe.data_tfe_organization_run_task.DataTfeOrganizationRunTask(self, "example", name="task-name", organization="my-org-name" ) @@ -50,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organization_tags.html.markdown b/website/docs/cdktf/python/d/organization_tags.html.markdown index 35e8ecf05..d1eebf753 100644 --- a/website/docs/cdktf/python/d/organization_tags.html.markdown +++ b/website/docs/cdktf/python/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organization_tags import DataTfeOrganizationTags -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizationTags(self, "example", + tfe.data_tfe_organization_tags.DataTfeOrganizationTags(self, "example", organization="my-org-name" ) ``` @@ -47,4 +44,4 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag * `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/organizations.html.markdown b/website/docs/cdktf/python/d/organizations.html.markdown index 40acebd22..23d6acab4 100644 --- a/website/docs/cdktf/python/d/organizations.html.markdown +++ b/website/docs/cdktf/python/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_organizations import DataTfeOrganizations -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeOrganizations(self, "foo") + tfe.data_tfe_organizations.DataTfeOrganizations(self, "foo") ``` ## Argument Reference @@ -44,4 +41,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/outputs.html.markdown b/website/docs/cdktf/python/d/outputs.html.markdown index 81fff84bc..e0724371d 100644 --- a/website/docs/cdktf/python/d/outputs.html.markdown +++ b/website/docs/cdktf/python/d/outputs.html.markdown @@ -21,26 +21,25 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.random.id import Id -from imports.tfe.data_tfe_outputs import DataTfeOutputs -class MyConvertedCode(TerraformStack): +import ...gen.providers.random as random +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foo = DataTfeOutputs(self, "foo", + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. + # For a more precise conversion please use the --provider flag in convert. + data_tfe_outputs_foo = tfe.data_tfe_outputs.DataTfeOutputs(self, "foo", organization="my-org", workspace="my-workspace" ) - Id(self, "vpc_id", + random.id.Id(self, "vpc_id", byte_length=8, - keepers={ - "bar": foo.values.bar + keepers=[{ + "bar": data_tfe_outputs_foo.values.bar } ) ``` @@ -59,4 +58,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitive_values` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index f07549b13..7792c0828 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_policy_set import DataTfePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfePolicySet(self, "test", + tfe.data_tfe_policy_set.DataTfePolicySet(self, "test", name="my-policy-set-name", organization="my-org-name" ) @@ -69,4 +66,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/project.html.markdown b/website/docs/cdktf/python/d/project.html.markdown index 7d521d696..d45e87f6e 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_project import DataTfeProject -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeProject(self, "foo", + tfe.data_tfe_project.DataTfeProject(self, "foo", name="my-project-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspace_ids` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/saml_settings.html.markdown b/website/docs/cdktf/python/d/saml_settings.html.markdown index f103ca385..878fb1f95 100644 --- a/website/docs/cdktf/python/d/saml_settings.html.markdown +++ b/website/docs/cdktf/python/d/saml_settings.html.markdown @@ -16,31 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_saml_settings import DataTfeSamlSettings -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - DataTfeSamlSettings(self, "foo", - provider=admin - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -74,4 +64,4 @@ The following attributes are exported: * `signature_signing_method` - Signature Signing Method. * `signature_digest_method` - Signature Digest Method. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 3cde8b5ec..7335bc887 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeSlug(self, "test", + data_tfe_slug_test = tfe.data_tfe_slug.DataTfeSlug(self, "test", source_path="policies/my-policy-set" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set", organization="my-org-name", - slug=Token.as_string_map(test) + slug=cdktf.Token.as_string_map(data_tfe_slug_test) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") @@ -51,4 +47,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/ssh_key.html.markdown b/website/docs/cdktf/python/d/ssh_key.html.markdown index d5d2e6bba..c0e3cf6b3 100644 --- a/website/docs/cdktf/python/d/ssh_key.html.markdown +++ b/website/docs/cdktf/python/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_ssh_key import DataTfeSshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeSshKey(self, "test", + tfe.data_tfe_ssh_key.DataTfeSshKey(self, "test", name="my-ssh-key-name", organization="my-org-name" ) @@ -44,4 +41,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/team.html.markdown b/website/docs/cdktf/python/d/team.html.markdown index 620317566..5d3b5c0c9 100644 --- a/website/docs/cdktf/python/d/team.html.markdown +++ b/website/docs/cdktf/python/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team import DataTfeTeam -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeam(self, "test", + tfe.data_tfe_team.DataTfeTeam(self, "test", name="my-team-name", organization="my-org-name" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `sso_team_id` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/team_access.html.markdown b/website/docs/cdktf/python/d/team_access.html.markdown index d0e17f1f6..6298539a8 100644 --- a/website/docs/cdktf/python/d/team_access.html.markdown +++ b/website/docs/cdktf/python/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_access import DataTfeTeamAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamAccess(self, "test", + tfe.data_tfe_team_access.DataTfeTeamAccess(self, "test", team_id="my-team-id", workspace_id="my-workspace-id" ) @@ -55,4 +52,4 @@ The `permissions` block contains: * `workspace_locking` - Whether permission is granted to manually lock the workspace or not. * `run_tasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/team_project_access.html.markdown b/website/docs/cdktf/python/d/team_project_access.html.markdown index b6e18fa24..79d8e2dde 100644 --- a/website/docs/cdktf/python/d/team_project_access.html.markdown +++ b/website/docs/cdktf/python/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_team_project_access import DataTfeTeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeamProjectAccess(self, "test", + tfe.data_tfe_team_project_access.DataTfeTeamProjectAccess(self, "test", project_id="my-project-id", team_id="my-team-id" ) @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/teams.html.markdown b/website/docs/cdktf/python/d/teams.html.markdown index 6580fd5fb..2a1affca4 100644 --- a/website/docs/cdktf/python/d/teams.html.markdown +++ b/website/docs/cdktf/python/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_teams import DataTfeTeams -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeTeams(self, "foo", + tfe.data_tfe_teams.DataTfeTeams(self, "foo", organization="my-org-name" ) ``` @@ -42,4 +39,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/variable_set.html.markdown b/website/docs/cdktf/python/d/variable_set.html.markdown index 27fae8882..175cc05d2 100644 --- a/website/docs/cdktf/python/d/variable_set.html.markdown +++ b/website/docs/cdktf/python/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeVariableSet(self, "test", + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) @@ -52,4 +49,4 @@ The following arguments are supported: * `variable_ids` - IDs of the variables attached to the variable set. * `project_ids` - IDs of the projects that use the variable set. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/variables.html.markdown b/website/docs/cdktf/python/d/variables.html.markdown index cd3625403..a3e5ef957 100644 --- a/website/docs/cdktf/python/d/variables.html.markdown +++ b/website/docs/cdktf/python/d/variables.html.markdown @@ -16,24 +16,20 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variables import DataTfeVariables -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - workspace_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -42,24 +38,21 @@ class MyConvertedCode(TerraformStack): For variable set variables: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_variable_set import DataTfeVariableSet -from imports.tfe.data_tfe_variables import DataTfeVariables -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeVariableSet(self, "test", + data_tfe_variable_set_test = + tfe.data_tfe_variable_set.DataTfeVariableSet(self, "test", name="my-variable-set-name", organization="my-org-name" ) - data_tfe_variables_test = DataTfeVariables(self, "test_1", - variable_set_id=Token.as_string(test.id) + data_tfe_variables_test = tfe.data_tfe_variables.DataTfeVariables(self, "test_1", + variable_set_id=cdktf.Token.as_string(data_tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_tfe_variables_test.override_logical_id("test") @@ -87,4 +80,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 3286a7bed..64a5d731d 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspace(self, "test", + tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) @@ -88,4 +85,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/workspace_ids.html.markdown b/website/docs/cdktf/python/d/workspace_ids.html.markdown index ca8b5f27a..574df030f 100644 --- a/website/docs/cdktf/python/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/python/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_ids import DataTfeWorkspaceIds -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceIds(self, "all", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "all", names=["*"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "app-frontend", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "app-frontend", names=["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization="my-org-name" ) - DataTfeWorkspaceIds(self, "prod-apps", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-apps", organization="my-org-name", tag_names=["prod", "app", "aws"] ) - DataTfeWorkspaceIds(self, "prod-only", + tfe.data_tfe_workspace_ids.DataTfeWorkspaceIds(self, "prod-only", exclude_tags=["app"], organization="my-org-name", tag_names=["prod"] @@ -64,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: * `full_names` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 8a0452d2a..5ca5e8c3b 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace_run_task import DataTfeWorkspaceRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeWorkspaceRunTask(self, "foobar", + tfe.data_tfe_workspace_run_task.DataTfeWorkspaceRunTask(self, "foobar", task_id="task-def456", workspace_id="ws-abc123" ) @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 88f5382fa..4fb4ecf50 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -73,13 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.54.0" + } + } +} ``` As this provider is still at version zero, you should constrain the acceptable @@ -89,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.54.0" ... } ``` @@ -98,27 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name, *, email, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - Organization(self, "org", - email=email, - name=name - ) +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + token = var.token + version = "~> 0.54.0" +} + +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -138,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 43e9e3b4e..6701ab676 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -17,45 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.admin_organization_settings import AdminOrganizationSettings -from imports.tfe.organization import Organization -from imports.tfe.provider import TfeProvider -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=token.string_value - ) - admin = TfeProvider(self, "tfe_1", - alias="admin", - hostname=hostname.string_value, - token=admin_token.string_value - ) - a_module_consumer = Organization(self, "a-module-consumer", - email="admin@company.com", - name="my-other-org" - ) - a_module_producer = Organization(self, "a-module-producer", - email="admin@company.com", - name="my-org" - ) - AdminOrganizationSettings(self, "test-settings", - access_beta_tools=False, - global_module_sharing=False, - module_sharing_consumer_organizations=[a_module_consumer.name], - organization=a_module_producer.name, - provider="${tfe.admin}", - workspace_limit=15 - ) +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" +} + +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" +} + +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -72,4 +66,8 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization - \ No newline at end of file +## Import + +This resource does not manage the creation of an organization and there is no need to import it. + + diff --git a/website/docs/cdktf/python/r/agent_pool.html.markdown b/website/docs/cdktf/python/r/agent_pool.html.markdown index f0997789c..6cddfb917 100644 --- a/website/docs/cdktf/python/r/agent_pool.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool.html.markdown @@ -18,25 +18,21 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - AgentPool(self, "test-agent-pool", + tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), organization_scoped=True ) ``` @@ -67,4 +63,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index eb8ae5940..f7ce8f7b8 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -20,43 +20,32 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_workspace = Workspace(self, "test-workspace", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), organization_scoped=False ) - allowed = AgentPoolAllowedWorkspaces(self, "allowed", - agent_pool_id=test_agent_pool.id, - allowed_workspace_ids=Token.as_list("${[ for key, value in ${" + - Fn.lookup_nested(test, ["*", "id"]) + "} : value]}") - ) - WorkspaceSettings(self, "test-workspace-settings", - agent_pool_id=allowed.id, - execution_mode="agent", - workspace_id=test_workspace.id + tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + allowed_workspace_ids=[ + cdktf.Token.as_string(tfe_workspace_test_workspace.id) + ] ) ``` @@ -76,4 +65,5 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + + diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index d2176cbb4..a0a13b601 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -17,29 +17,24 @@ These tokens allow agents to communicate securely with HCP Terraform. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_token import AgentToken -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - AgentToken(self, "test-agent-token", - agent_pool_id=test_agent_pool.id, + tfe.agent_token.AgentToken(self, "test-agent-token", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), description="my-agent-token-name" ) ``` @@ -57,4 +52,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/no_code_module.html.markdown b/website/docs/cdktf/python/r/no_code_module.html.markdown index a35a6503c..b908eb697 100644 --- a/website/docs/cdktf/python/r/no_code_module.html.markdown +++ b/website/docs/cdktf/python/r/no_code_module.html.markdown @@ -16,33 +16,28 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id) + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_no_code_module_foobar.override_logical_id("foobar") @@ -51,33 +46,28 @@ class MyConvertedCode(TerraformStack): Creating a no-code module with variable options: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - foobar = Organization(self, "foobar", + tfe_organization_foobar = tfe.organization.Organization(self, "foobar", email="admin@company.com", name="my-org-name" ) - tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + tfe_registry_module_foobar = tfe.registry_module.RegistryModule(self, "foobar_1", module_provider="my_provider", name="test_module", - organization=foobar.id + organization=cdktf.Token.as_string(tfe_organization_foobar.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_module_foobar.override_logical_id("foobar") - tfe_no_code_module_foobar = NoCodeModule(self, "foobar_2", - organization=foobar.id, - registry_module=Token.as_string(tfe_registry_module_foobar.id), + tfe_no_code_module_foobar = tfe.no_code_module.NoCodeModule(self, "foobar_2", + organization=cdktf.Token.as_string(tfe_organization_foobar.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_foobar.id), variable_options=[NoCodeModuleVariableOptions( name="ami", options=["ami-0", "ami-1", "ami-2"], @@ -119,4 +109,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index dbd5276f3..0c1438778 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -19,36 +19,32 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_2", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_2", destination_type="generic", enabled=True, name="my-test-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], url="https://example.com", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -57,43 +53,41 @@ class MyConvertedCode(TerraformStack): With `destination_type` of `email`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -102,45 +96,43 @@ class MyConvertedCode(TerraformStack): (**TFE only**) With `destination_type` of `email`, using `email_addresses` list and `email_users`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.notification_configuration import NotificationConfiguration -from imports.tfe.organization import Organization -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_organization_membership_test = OrganizationMembership(self, "test_1", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test_1", email="test.member@company.com", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_organization_membership_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_notification_configuration_test = NotificationConfiguration(self, "test_3", + tfe_notification_configuration_test = + tfe.notification_configuration.NotificationConfiguration(self, "test_3", destination_type="email", email_addresses=["user1@company.com", "user2@company.com", "user3@company.com" ], - email_user_ids=[Token.as_string(tfe_organization_membership_test.user_id)], + email_user_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.user_id) + ], enabled=True, name="my-test-email-notification-configuration", triggers=["run:created", "run:planning", "run:errored"], - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_notification_configuration_test.override_logical_id("test") @@ -188,4 +180,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index f856bc68c..ab52fe122 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", name="my-github-oauth-client", @@ -47,18 +44,15 @@ See [documentation for HCP Terraform and Terraform Enterprise setup](https://dev **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://ado.example.com", http_url="https://ado.example.com", name="my-ado-oauth-client", @@ -77,18 +71,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OauthClient(self, "test", + tfe.oauth_client.OauthClient(self, "test", api_url="https://bbs.example.com", http_url="https://bss.example.com", key="", @@ -130,4 +121,4 @@ Link. * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index 4b6dee594..30461b99d 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Organization(self, "test", + tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) @@ -65,4 +62,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 9170eb8d7..504dc7ab2 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationMembership(self, "test", + tfe.organization_membership.OrganizationMembership(self, "test", email="user@company.com", organization="my-org-name" ) @@ -69,4 +66,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown index 5e606ea7c..8d269f286 100644 --- a/website/docs/cdktf/python/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/python/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_module_sharing import OrganizationModuleSharing -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationModuleSharing(self, "test", + tfe.organization_module_sharing.OrganizationModuleSharing(self, "test", module_consumers=["my-org-name-2", "my-org-name-3"], organization="my-org-name" ) @@ -43,4 +40,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `module_consumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 343f6b044..49ab61168 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_run_task import OrganizationRunTask -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationRunTask(self, "example", + tfe.organization_run_task.OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -63,4 +60,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/organization_token.html.markdown b/website/docs/cdktf/python/r/organization_token.html.markdown index 02e9544c7..1bd7da35f 100644 --- a/website/docs/cdktf/python/r/organization_token.html.markdown +++ b/website/docs/cdktf/python/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OrganizationToken(self, "test", + tfe.organization_token.OrganizationToken(self, "test", organization="my-org-name" ) ``` @@ -49,28 +46,15 @@ never expire. When a token has an expiry: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_token import OrganizationToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - # For a more precise conversion please use the --provider flag in convert. - example = Rotating(self, "example", - rotation_days=30 - ) - OrganizationToken(self, "test", - expired_at=Token.as_string(example.rotation_rfc3339), - organization=Token.as_string(org.name) - ) +```hcl +resource "time_rotating" "example" { + rotation_days = 30 +} + +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -87,4 +71,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/policy.html.markdown b/website/docs/cdktf/python/r/policy.html.markdown index 3e794c4d2..e1f5ca083 100644 --- a/website/docs/cdktf/python/r/policy.html.markdown +++ b/website/docs/cdktf/python/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", kind="sentinel", @@ -45,18 +42,15 @@ class MyConvertedCode(TerraformStack): Basic usage for Open Policy Agent(OPA): ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy import Policy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Policy(self, "test", + tfe.policy.Policy(self, "test", description="This policy always passes", enforce_mode="mandatory", kind="opa", @@ -97,4 +91,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index 83e93767f..f006acbee 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -79,31 +79,21 @@ class MyConvertedCode(TerraformStack): Manually uploaded policy set, in lieu of VCS: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_slug import DataTfeSlug -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - test = DataTfeSlug(self, "test", - source_path="policies/my-policy-set" - ) - tfe_policy_set_test = PolicySet(self, "test_1", - description="A brand new policy set", - name="my-policy-set", - organization="my-org-name", - slug=Token.as_string_map(test), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_policy_set_test.override_logical_id("test") +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" +} + +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -166,4 +156,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown index 5904442c7..9e0042e62 100644 --- a/website/docs/cdktf/python/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/python/r/policy_set_parameter.html.markdown @@ -16,32 +16,28 @@ Creates, updates and destroys policy set parameters. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.policy_set_parameter import PolicySetParameter -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", name="my-policy-set-name", - organization=test.id + organization=cdktf.Token.as_string(tfe_organization_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_policy_set_parameter_test = PolicySetParameter(self, "test_2", + tfe_policy_set_parameter_test = + tfe.policy_set_parameter.PolicySetParameter(self, "test_2", key="my_key_name", - policy_set_id=Token.as_string(tfe_policy_set_test.id), + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), value="my_value_name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -73,4 +69,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 106e20258..478467ba7 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -16,25 +16,21 @@ Provides a project resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Project(self, "test", + tfe.project.Project(self, "test", name="projectname", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -59,4 +55,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/project_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index 85ad3e390..ffa50629b 100644 --- a/website/docs/cdktf/python/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/project_policy_set.html.markdown @@ -16,40 +16,34 @@ Adds and removes policy sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.project import Project -from imports.tfe.project_policy_set import ProjectPolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_project_test = Project(self, "test_2", + tfe_project_test = tfe.project.Project(self, "test_2", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_project_policy_set_test = ProjectPolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - project_id=Token.as_string(tfe_project_test.id) + tfe_project_policy_set_test = tfe.project_policy_set.ProjectPolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + project_id=cdktf.Token.as_string(tfe_project_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_policy_set_test.override_logical_id("test") @@ -74,4 +68,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/project_variable_set.html.markdown b/website/docs/cdktf/python/r/project_variable_set.html.markdown index 648c90db8..7c2a2b2e3 100644 --- a/website/docs/cdktf/python/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/project_variable_set.html.markdown @@ -16,40 +16,35 @@ Adds and removes variable sets from a project Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="my-project-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_3", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_3", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") @@ -74,4 +69,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index 709544552..6cb8cdf67 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -16,35 +16,30 @@ HCP Terraform's private module registry helps you share Terraform modules across Basic usage with VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", vcs_repo=RegistryModuleVcsRepo( display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -93,31 +88,27 @@ class MyConvertedCode(TerraformStack): Create private registry module with GitHub App: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_github_app_installation import DataTfeGithubAppInstallation -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - gha_installation = DataTfeGithubAppInstallation(self, "gha_installation", + data_tfe_github_app_installation_gha_installation = + tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", name="YOUR_GH_NAME" ) - RegistryModule(self, "petstore", - organization=test_organization.name, + tfe.registry_module.RegistryModule(self, "petstore", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), vcs_repo=RegistryModuleVcsRepo( display_identifier="GH_NAME/REPO_NAME", - github_app_installation_id=Token.as_string(gha_installation.id), + github_app_installation_id=cdktf.Token.as_string(data_tfe_github_app_installation_gha_installation.id), identifier="GH_NAME/REPO_NAME" ) ) @@ -126,26 +117,22 @@ class MyConvertedCode(TerraformStack): Create private registry module without VCS: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-private-registry-module", + tfe.registry_module.RegistryModule(self, "test-private-registry-module", module_provider="my_provider", name="another_test_module", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="private" ) ``` @@ -153,27 +140,23 @@ class MyConvertedCode(TerraformStack): Create public registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - RegistryModule(self, "test-public-registry-module", + tfe.registry_module.RegistryModule(self, "test-public-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) ``` @@ -181,33 +164,29 @@ class MyConvertedCode(TerraformStack): Create no-code provisioning registry module: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.no_code_module import NoCodeModule -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_no_code_provisioning_registry_module = RegistryModule(self, "test-no-code-provisioning-registry-module", + tfe_registry_module_test_no_code_provisioning_registry_module = + tfe.registry_module.RegistryModule(self, "test-no-code-provisioning-registry-module", module_provider="aws", name="vpc", namespace="terraform-aws-modules", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), registry_name="public" ) - NoCodeModule(self, "foobar", - organization=test_organization.id, - registry_module=test_no_code_provisioning_registry_module.id + tfe.no_code_module.NoCodeModule(self, "foobar", + organization=cdktf.Token.as_string(tfe_organization_test_organization.id), + registry_module=cdktf.Token.as_string(tfe_registry_module_test_no_code_provisioning_registry_module.id) ) ``` @@ -265,4 +244,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index df20da152..1d0ac8fb9 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -19,34 +19,29 @@ to up to 20 source workspaces. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.run_trigger import RunTrigger -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_sourceable = Workspace(self, "test-sourceable", + tfe_workspace_test_sourceable = tfe.workspace.Workspace(self, "test-sourceable", name="my-sourceable-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - test_workspace = Workspace(self, "test-workspace", + tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", name="my-workspace-name", - organization=test_organization.id + organization=cdktf.Token.as_string(tfe_organization_test_organization.id) ) - RunTrigger(self, "test", - sourceable_id=test_sourceable.id, - workspace_id=test_workspace.id + tfe.run_trigger.RunTrigger(self, "test", + sourceable_id=cdktf.Token.as_string(tfe_workspace_test_sourceable.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) ) ``` @@ -70,4 +65,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/saml_settings.html.markdown b/website/docs/cdktf/python/r/saml_settings.html.markdown index 3842ee3c9..a808ff0a2 100644 --- a/website/docs/cdktf/python/r/saml_settings.html.markdown +++ b/website/docs/cdktf/python/r/saml_settings.html.markdown @@ -15,28 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.provider import TfeProvider -from imports.tfe.saml_settings import SamlSettings -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - TfeProvider(self, "tfe", - hostname=hostname.string_value, - token=admin_token.string_value - ) - SamlSettings(self, "this", - idp_cert="foobarCertificate", - slo_endpoint_url="https://example.com/slo_endpoint_url", - sso_endpoint_url="https://example.com/sso_endpoint_url" - ) +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -75,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/sentinel_policy.html.markdown b/website/docs/cdktf/python/r/sentinel_policy.html.markdown index 39b7518af..f831b680d 100644 --- a/website/docs/cdktf/python/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_policy import SentinelPolicy -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelPolicy(self, "test", + tfe.sentinel_policy.SentinelPolicy(self, "test", description="This policy always passes", enforce_mode="hard-mandatory", name="my-policy-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 777ce33f4..7bc098f47 100644 --- a/website/docs/cdktf/python/r/ssh_key.html.markdown +++ b/website/docs/cdktf/python/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.ssh_key import SshKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SshKey(self, "test", + tfe.ssh_key.SshKey(self, "test", key="private-ssh-key", name="my-ssh-key-name", organization="my-org-name" @@ -52,4 +49,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 8986aeff9..98dbf8cbf 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): Organization Permission usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - Team(self, "test", + tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name", organization_access=TeamOrganizationAccess( @@ -97,4 +91,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_access.html.markdown b/website/docs/cdktf/python/r/team_access.html.markdown index a52e519f8..d4f34b779 100644 --- a/website/docs/cdktf/python/r/team_access.html.markdown +++ b/website/docs/cdktf/python/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_access import TeamAccess -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_team_access_test = TeamAccess(self, "test_2", + tfe_team_access_test = tfe.team_access.TeamAccess(self, "test_2", access="read", - team_id=test.id, - workspace_id=Token.as_string(tfe_workspace_test.id) + team_id=cdktf.Token.as_string(tfe_team_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_access_test.override_logical_id("test") @@ -82,4 +77,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_member.html.markdown b/website/docs/cdktf/python/r/team_member.html.markdown index e0e91ab64..1b26ef82e 100644 --- a/website/docs/cdktf/python/r/team_member.html.markdown +++ b/website/docs/cdktf/python/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_member import TeamMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_member_test = TeamMember(self, "test_1", - team_id=test.id, + tfe_team_member_test = tfe.team_member.TeamMember(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), username="sander" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -65,4 +61,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_members.html.markdown b/website/docs/cdktf/python/r/team_members.html.markdown index 405b4b098..c0d351920 100644 --- a/website/docs/cdktf/python/r/team_members.html.markdown +++ b/website/docs/cdktf/python/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), usernames=["admin", "sander"] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -52,26 +48,22 @@ class MyConvertedCode(TerraformStack): With a set of usernames: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_members import TeamMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_usernames = Fn.toset(["user1", "user2"]) - test = Team(self, "test", + all_usernames = cdktf.Fn.toset(["user1", "user2"]) + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_members_test = TeamMembers(self, "test_1", - team_id=test.id, - usernames=Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") + tfe_team_members_test = tfe.team_members.TeamMembers(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id), + usernames=cdktf.Token.as_list("${[ for user in ${" + all_usernames + "} : user]}") ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_members_test.override_logical_id("test") @@ -96,4 +88,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 30df802ba..7628e87ec 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -24,32 +24,29 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_member import TeamOrganizationMember -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_1", + tfe_team_test = tfe.team.Team(self, "test_1", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_member_test = TeamOrganizationMember(self, "test_2", - organization_membership_id=test.id, - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_member_test = + tfe.team_organization_member.TeamOrganizationMember(self, "test_2", + organization_membership_id=cdktf.Token.as_string(tfe_organization_membership_test.id), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_member_test.override_logical_id("test") @@ -75,4 +72,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index e24bd8262..3c8682bab 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -24,36 +24,37 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - sample = OrganizationMembership(self, "sample", + tfe_organization_membership_sample = + tfe.organization_membership.OrganizationMembership(self, "sample", email="sample@hashicorp.com", organization="my-org-name" ) - test = OrganizationMembership(self, "test", + tfe_organization_membership_test = + tfe.organization_membership.OrganizationMembership(self, "test", email="example@hashicorp.com", organization="my-org-name" ) - tfe_team_test = Team(self, "test_2", + tfe_team_test = tfe.team.Team(self, "test_2", name="my-team-name", organization="my-org-name" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_test.override_logical_id("test") - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_3", - organization_membership_ids=[test.id, sample.id], - team_id=Token.as_string(tfe_team_test.id) + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_3", + organization_membership_ids=[ + cdktf.Token.as_string(tfe_organization_membership_test.id), + cdktf.Token.as_string(tfe_organization_membership_sample.id) + ], + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -62,38 +63,35 @@ class MyConvertedCode(TerraformStack): With a set of organization members: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformIterator, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization_membership import OrganizationMembership -from imports.tfe.team import Team -from imports.tfe.team_organization_members import TeamOrganizationMembers -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - all_users = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]) + all_users = cdktf.Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com" + ]) # In most cases loops should be handled in the programming language context and # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - all_membership_for_each_iterator = TerraformIterator.from_list( - Token.as_any(all_users)) - OrganizationMembership(self, "all_membership", - email=Token.as_string(all_membership_for_each_iterator.key), + tfe_organization_membership_all_membership_for_each_iterator = + cdktf.TerraformIterator.from_list(cdktf.Token.as_any(all_users)) + tfe.organization_membership.OrganizationMembership(self, "all_membership", + email=cdktf.Token.as_string(tfe_organization_membership_all_membership_for_each_iterator.key), organization="my-org-name", - for_each=all_membership_for_each_iterator + for_each=tfe_organization_membership_all_membership_for_each_iterator ) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_organization_members_test = TeamOrganizationMembers(self, "test_2", - organization_membership_ids=Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), - team_id=test.id + tfe_team_organization_members_test = + tfe.team_organization_members.TeamOrganizationMembers(self, "test_2", + organization_membership_ids=cdktf.Token.as_list("${[ for member in ${" + all_users + "} : tfe_organization_membership.all_membership[member].id]}"), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_organization_members_test.override_logical_id("test") @@ -115,4 +113,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 6a9a2b5c2..06919c267 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -16,31 +16,27 @@ Associate a team to permissions on a project. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - admin = Team(self, "admin", + tfe_team_admin = tfe.team.Team(self, "admin", name="my-admin-team", organization="my-org-name" ) - tfe_team_project_access_admin = TeamProjectAccess(self, "admin_2", + tfe_team_project_access_admin = + tfe.team_project_access.TeamProjectAccess(self, "admin_2", access="admin", - project_id=test.id, - team_id=admin.id + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_admin.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_project_access_admin.override_logical_id("admin") @@ -88,36 +84,31 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.project import Project -from imports.tfe.team import Team -from imports.tfe.team_project_access import TeamProjectAccess -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Project(self, "test", + tfe_project_test = tfe.project.Project(self, "test", name="myproject", organization="my-org-name" ) - dev = Team(self, "dev", + tfe_team_dev = tfe.team.Team(self, "dev", name="my-dev-team", organization="my-org-name" ) - TeamProjectAccess(self, "custom", + tfe.team_project_access.TeamProjectAccess(self, "custom", access="custom", project_access=[TeamProjectAccessProjectAccess( settings="read", teams="none" ) ], - project_id=test.id, - team_id=dev.id, + project_id=cdktf.Token.as_string(tfe_project_test.id), + team_id=cdktf.Token.as_string(tfe_team_dev.id), workspace_access=[TeamProjectAccessWorkspaceAccess( create=True, delete=False, @@ -146,4 +137,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/team_token.html.markdown b/website/docs/cdktf/python/r/team_token.html.markdown index d3a7c2688..1458fc79d 100644 --- a/website/docs/cdktf/python/r/team_token.html.markdown +++ b/website/docs/cdktf/python/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - tfe_team_token_test = TeamToken(self, "test_1", - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_1", + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -56,31 +52,27 @@ never expire. When a token has an expiry: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.team import Team -from imports.tfe.team_token import TeamToken -from imports.time.rotating import Rotating -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +import ...gen.providers.time as time +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. # For a more precise conversion please use the --provider flag in convert. - test = Team(self, "test", + tfe_team_test = tfe.team.Team(self, "test", name="my-team-name", organization="my-org-name" ) - example = Rotating(self, "example", + time_rotating_example = time.rotating.Rotating(self, "example", rotation_days=30 ) - tfe_team_token_test = TeamToken(self, "test_2", - expired_at=Token.as_string(example.rotation_rfc3339), - team_id=test.id + tfe_team_token_test = tfe.team_token.TeamToken(self, "test_2", + expired_at=cdktf.Token.as_string(time_rotating_example.rotation_rfc3339), + team_id=cdktf.Token.as_string(tfe_team_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_team_token_test.override_logical_id("test") @@ -99,4 +91,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 741305dbf..1dfbb2b45 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on HCP Terraform and Terraform Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.terraform_version import TerraformVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - TerraformVersion(self, "test", + tfe.terraform_version.TerraformVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/terraform.zip", version="1.1.2-custom" @@ -65,4 +62,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index bacb23e52..7d5f39b8c 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -16,35 +16,30 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_workspace_test = Workspace(self, "test_1", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_1", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_variable_test = Variable(self, "test_2", + tfe_variable_test = tfe.variable.Variable(self, "test_2", category="terraform", description="a useful description", key="my_key_name", value="my_value_name", - workspace_id=Token.as_string(tfe_workspace_test.id) + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_test.override_logical_id("test") @@ -53,44 +48,39 @@ class MyConvertedCode(TerraformStack): Basic usage for variable sets: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", global=False, name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -129,41 +119,33 @@ While the `value` field may be referenced in other resources, for safety it is a The `readable_value` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.variable import Variable -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - sensitive_var = Variable(self, "sensitive_var", - category="terraform", - key="sensitive_key", - sensitive=True, - value="sensitive_value", - workspace_id=workspace.id - ) - visible_var = Variable(self, "visible_var", - category="terraform", - key="visible_key", - sensitive=False, - value="visible_value", - workspace_id=workspace.id - ) - Workspace(self, "sensitive_workspace", - name="workspace-${" + sensitive_var.value + "}", - organization="organization name" - ) - Workspace(self, "visible_workspace", - name="workspace-${" + visible_var.readable_value + "}", - organization="organization name" - ) +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" +} + ``` `readable_value` will be null if the variable is sensitive. `readable_value` may not be set explicitly in the resource configuration. @@ -189,4 +171,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/variable_set.html.markdown b/website/docs/cdktf/python/r/variable_set.html.markdown index f5e16a6bd..4d192574a 100644 --- a/website/docs/cdktf/python/r/variable_set.html.markdown +++ b/website/docs/cdktf/python/r/variable_set.html.markdown @@ -16,115 +16,142 @@ Creates, updates and destroys variable sets. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.project import Project -from imports.tfe.project_variable_set import ProjectVariableSet -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_project_test = Project(self, "test_1", + tfe_project_test = tfe.project.Project(self, "test_1", name="projectname", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_test.override_logical_id("test") - tfe_variable_set_test = VariableSet(self, "test_2", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_2", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_3", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_3", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_4", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_4", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") - tfe_project_variable_set_test = ProjectVariableSet(self, "test_5", - project_id=Token.as_string(tfe_project_test.id), - variable_set_id=Token.as_string(tfe_variable_set_test.id) + tfe_project_variable_set_test = + tfe.project_variable_set.ProjectVariableSet(self, "test_5", + project_id=cdktf.Token.as_string(tfe_project_test.id), + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_project_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` Creating a global variable set: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable import Variable -from imports.tfe.variable_set import VariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Variable set applied to all workspaces.", global=True, name="Global Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - Variable(self, "test-a", + tfe.variable.Variable(self, "test-a", category="terraform", description="a useful description", key="seperate_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) - Variable(self, "test-b", + tfe.variable.Variable(self, "test-b", category="env", description="an environment variable", key="another_variable", value="my_value_name", - variable_set_id=Token.as_string(tfe_variable_set_test.id) + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + ) +``` + +Create a priority variable set: + +```python +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. +# See https://cdk.tf/provider-generation for more details. +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + tfe_organization_test = tfe.organization.Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", + description="Variable set applied to all workspaces.", + name="Global Varset", + organization=cdktf.Token.as_string(tfe_organization_test.name), + priority=True + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_variable_set_test.override_logical_id("test") + tfe.variable.Variable(self, "test-a", + category="terraform", + description="a useful description", + key="seperate_variable", + value="my_value_name", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) + ) + tfe.variable.Variable(self, "test-b", + category="env", + description="an environment variable", + key="another_variable", + value="my_value_name", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id) ) ``` @@ -198,4 +225,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 7eff9ff55..1be5e8685 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -20,25 +20,21 @@ Provides a workspace resource. Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - Workspace(self, "test", + tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), tag_names=["test", "app"] ) ``` @@ -46,39 +42,35 @@ class MyConvertedCode(TerraformStack): Usage with vcs_repo: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. +<<<<<<< HEAD # from imports.tfe.oauth_client import OauthClient from imports.tfe.organization import Organization from imports.tfe.workspace import Workspace class MyConvertedCode(TerraformStack): +======= +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): +>>>>>>> adf61bce (cdktf: update documentation) def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", - api_url="https://api.github.com", - http_url="https://github.com", - oauth_token="oauth_token_id", - organization=test_organization, - service_provider="github" + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", + name="my-agent-pool-name", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - Workspace(self, "parent", - name="parent-ws", - organization=test_organization, - queue_all_runs=False, - vcs_repo=WorkspaceVcsRepo( - branch="main", - identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id - ) + tfe.workspace.Workspace(self, "test", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + execution_mode="agent", + name="my-workspace-name", + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) ``` @@ -191,4 +183,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index bbf800503..e95a5f9df 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set import WorkspacePolicySet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_test = WorkspacePolicySet(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_test = + tfe.workspace_policy_set.WorkspacePolicySet(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown index ab821e937..1446181d3 100644 --- a/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/python/r/workspace_policy_set_exclusion.html.markdown @@ -18,40 +18,35 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.policy_set import PolicySet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_policy_set_exclusion import WorkspacePolicySetExclusion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_policy_set_test = PolicySet(self, "test_1", + tfe_policy_set_test = tfe.policy_set.PolicySet(self, "test_1", description="Some description.", name="my-policy-set", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_policy_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_policy_set_exclusion_test = WorkspacePolicySetExclusion(self, "test_3", - policy_set_id=Token.as_string(tfe_policy_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_policy_set_exclusion_test = + tfe.workspace_policy_set_exclusion.WorkspacePolicySetExclusion(self, "test_3", + policy_set_id=cdktf.Token.as_string(tfe_policy_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_policy_set_exclusion_test.override_logical_id("test") @@ -76,4 +71,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index 84e2790a6..5550f2faa 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -24,52 +24,46 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - child = Workspace(self, "child", + tfe_workspace_child = tfe.workspace.Workspace(self, "child", name="child-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - ws_run_parent = WorkspaceRun(self, "ws_run_parent", + tfe_workspace_run_ws_run_parent = tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, @@ -82,64 +76,58 @@ class MyConvertedCode(TerraformStack): retry_backoff_min=10, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) - WorkspaceRun(self, "ws_run_child", + tfe.workspace_run.WorkspaceRun(self, "ws_run_child", apply=WorkspaceRunApply( manual_confirm=False, retry_attempts=5, retry_backoff_min=5 ), - depends_on=[ws_run_parent], + depends_on=[tfe_workspace_run_ws_run_parent], destroy=WorkspaceRunDestroy( manual_confirm=False, retry_attempts=3, retry_backoff_min=10, wait_for_run=True ), - workspace_id=child.id + workspace_id=cdktf.Token.as_string(tfe_workspace_child.id) ) ``` With manual confirmation: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=True ), @@ -147,49 +135,43 @@ class MyConvertedCode(TerraformStack): manual_confirm=True, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` With no retries: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_run import WorkspaceRun -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = OauthClient(self, "test", + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=test_organization, + organization=tfe_organization_test_organization, service_provider="github" ) - parent = Workspace(self, "parent", + tfe_workspace_parent = tfe.workspace.Workspace(self, "parent", name="parent-ws", - organization=test_organization, + organization=tfe_organization_test_organization, queue_all_runs=False, vcs_repo=WorkspaceVcsRepo( branch="main", identifier="my-org-name/vcs-repository", - oauth_token_id=test.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) ) ) - WorkspaceRun(self, "ws_run_parent", + tfe.workspace_run.WorkspaceRun(self, "ws_run_parent", apply=WorkspaceRunApply( manual_confirm=False, retry=False @@ -199,7 +181,7 @@ class MyConvertedCode(TerraformStack): retry=False, wait_for_run=True ), - workspace_id=parent.id + workspace_id=cdktf.Token.as_string(tfe_workspace_parent.id) ) ``` @@ -228,4 +210,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 9a8c536d6..4057850fb 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,23 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.workspace_run_task import WorkspaceRunTask -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - WorkspaceRunTask(self, "example", - enforcement_level="advisory", - task_id=tfe_organization_run_task.example.id, - workspace_id=tfe_workspace.example.id - ) +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" +} ``` ## Argument Reference @@ -58,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown index 0d3f249f3..6a52e923d 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -18,40 +18,35 @@ Adds and removes variable sets from a workspace Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.variable_set import VariableSet -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_variable_set import WorkspaceVariableSet -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - tfe_variable_set_test = VariableSet(self, "test_1", + tfe_variable_set_test = tfe.variable_set.VariableSet(self, "test_1", description="Some description.", name="Test Varset", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_variable_set_test.override_logical_id("test") - tfe_workspace_test = Workspace(self, "test_2", + tfe_workspace_test = tfe.workspace.Workspace(self, "test_2", name="my-workspace-name", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_test.override_logical_id("test") - tfe_workspace_variable_set_test = WorkspaceVariableSet(self, "test_3", - variable_set_id=Token.as_string(tfe_variable_set_test.id), - workspace_id=Token.as_string(tfe_workspace_test.id) + tfe_workspace_variable_set_test = + tfe.workspace_variable_set.WorkspaceVariableSet(self, "test_3", + variable_set_id=cdktf.Token.as_string(tfe_variable_set_test.id), + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_variable_set_test.override_logical_id("test") @@ -76,4 +71,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/agent_pool.html.markdown b/website/docs/cdktf/typescript/d/agent_pool.html.markdown index 679a0d95e..b903b551d 100644 --- a/website/docs/cdktf/typescript/d/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/agent_pool.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an agent pool. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeAgentPool } from "./.gen/providers/tfe/data-tfe-agent-pool"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeAgentPool(this, "test", { + new tfe.dataTfeAgentPool.DataTfeAgentPool(this, "test", { name: "my-agent-pool-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The agent pool ID. * `organizationScoped` - Whether or not the agent pool can be used by all workspaces in the organization. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index de4de22b5..729f3c70c 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -16,20 +16,21 @@ Use this data source to get information about the Github App Installation. ### Finding a Github App Installation by its installation ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - installationId: 12345678, - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + installationId: 12345, + } + ); } } @@ -38,20 +39,21 @@ class MyConvertedCode extends TerraformStack { ### Finding a Github App Installation by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeGithubAppInstallation(this, "gha_installation", { - name: "github_username_or_organization", - }); + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "installation_name", + } + ); } } @@ -71,5 +73,4 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 619c8b782..0b3f9604a 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -14,20 +14,21 @@ Use this data source to retrieve a list of HCP Terraform's IP ranges. For more i ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformOutput, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeIpRanges } from "./.gen/providers/tfe/data-tfe-ip-ranges"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const addresses = new DataTfeIpRanges(this, "addresses", {}); - new TerraformOutput(this, "notifications_ips", { - value: addresses.notifications, + const dataTfeIpRangesAddresses = new tfe.dataTfeIpRanges.DataTfeIpRanges( + this, + "addresses", + {} + ); + new cdktf.TerraformOutput(this, "notifications_ips", { + value: dataTfeIpRangesAddresses.notifications, }); } } @@ -48,4 +49,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index 30064e5c7..42e586f55 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about an OAuth client. ### Finding an OAuth client by its ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { oauthClientId: "oc-XXXXXXX", }); } @@ -38,18 +35,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its name ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { name: "my-oauth-client", organization: "my-org", }); @@ -61,18 +55,15 @@ class MyConvertedCode extends TerraformStack { ### Finding an OAuth client by its service provider ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOauthClient } from "./.gen/providers/tfe/data-tfe-oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOauthClient(this, "client", { + new tfe.dataTfeOauthClient.DataTfeOauthClient(this, "client", { organization: "my-org", serviceProvider: "github", }); @@ -111,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index c8c2e5f36..81ca0afca 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganization(this, "foo", { + new tfe.dataTfeOrganization.DataTfeOrganization(this, "foo", { name: "organization-name", }); } @@ -51,5 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/organization_members.html.markdown b/website/docs/cdktf/typescript/d/organization_members.html.markdown index bc6075dcf..5d288c1d0 100644 --- a/website/docs/cdktf/typescript/d/organization_members.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_members.html.markdown @@ -14,24 +14,20 @@ Use this data source to get information about members of an organization. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembers } from "./.gen/providers/tfe/data-tfe-organization-members"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const bar = new Organization(this, "bar", { + const tfeOrganizationBar = new tfe.organization.Organization(this, "bar", { email: "user@hashicorp.com", name: "org-bar", }); - new DataTfeOrganizationMembers(this, "foo", { - organization: bar.name, + new tfe.dataTfeOrganizationMembers.DataTfeOrganizationMembers(this, "foo", { + organization: cdktf.Token.asString(tfeOrganizationBar.name), }); } } @@ -55,4 +51,4 @@ The `member` block contains: * `userId` - The ID of the user. * `organizationMembershipId` - The ID of the organization membership. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index 17657f337..67c15a000 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -22,21 +22,22 @@ be updated manually. ### Fetch by email ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - email: "user@company.com", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + email: "user@company.com", + organization: "my-org-name", + } + ); } } @@ -45,21 +46,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by username ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - username: "my-username", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + username: "my-username", + } + ); } } @@ -68,21 +70,22 @@ class MyConvertedCode extends TerraformStack { ### Fetch by organization membership ID ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationMembership } from "./.gen/providers/tfe/data-tfe-organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationMembership(this, "test", { - organization: "my-org-name", - organizationMembershipId: "ou-xxxxxxxxxxx", - }); + new tfe.dataTfeOrganizationMembership.DataTfeOrganizationMembership( + this, + "test", + { + organization: "my-org-name", + organizationMembershipId: "ou-xxxxxxxxxxx", + } + ); } } @@ -107,4 +110,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index ced7a4194..3d2ce438b 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -16,21 +16,22 @@ Use this data source to get information about an [Organization Run tasks](https: ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationRunTask } from "./.gen/providers/tfe/data-tfe-organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationRunTask(this, "example", { - name: "task-name", - organization: "my-org-name", - }); + new tfe.dataTfeOrganizationRunTask.DataTfeOrganizationRunTask( + this, + "example", + { + name: "task-name", + organization: "my-org-name", + } + ); } } @@ -53,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/organization_tags.html.markdown b/website/docs/cdktf/typescript/d/organization_tags.html.markdown index fa7618293..6c7ae2283 100644 --- a/website/docs/cdktf/typescript/d/organization_tags.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_tags.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about the workspace tags for a given org ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizationTags } from "./.gen/providers/tfe/data-tfe-organization-tags"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizationTags(this, "example", { + new tfe.dataTfeOrganizationTags.DataTfeOrganizationTags(this, "example", { organization: "my-org-name", }); } @@ -49,5 +46,5 @@ The `tag` block contains: * `name` - The name of the workspace tag * `id` - The ID of the workspace tag -* `workspace_count` - The number of workspaces the tag is associate with - \ No newline at end of file +* `workspaceCount` - The number of workspaces the tag is associate with + diff --git a/website/docs/cdktf/typescript/d/organizations.html.markdown b/website/docs/cdktf/typescript/d/organizations.html.markdown index 82fbe35c5..e2d2c7c5a 100644 --- a/website/docs/cdktf/typescript/d/organizations.html.markdown +++ b/website/docs/cdktf/typescript/d/organizations.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Organizations and a map of their IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeOrganizations } from "./.gen/providers/tfe/data-tfe-organizations"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeOrganizations(this, "foo", {}); + new tfe.dataTfeOrganizations.DataTfeOrganizations(this, "foo", {}); } } @@ -47,4 +44,4 @@ The following attributes are exported: * `names` - A list of names of every organization. * `ids` - A map of organization names and their IDs. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/outputs.html.markdown b/website/docs/cdktf/typescript/d/outputs.html.markdown index 2586d6d5f..74f004534 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -21,27 +21,32 @@ Using the `tfe_outputs` data source, the outputs `foo` and `bar` can be used as In the example below, assume we have outputs defined in a `my-org/my-workspace`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Id } from "./.gen/providers/random/id"; -import { DataTfeOutputs } from "./.gen/providers/tfe/data-tfe-outputs"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as random from "./.gen/providers/random"; +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foo = new DataTfeOutputs(this, "foo", { - organization: "my-org", - workspace: "my-workspace", - }); - new Id(this, "vpc_id", { - byteLength: 8, - keepers: { - bar: foo.values.bar, - }, + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random. + For a more precise conversion please use the --provider flag in convert.*/ + const dataTfeOutputsFoo = new tfe.dataTfeOutputs.DataTfeOutputs( + this, + "foo", + { + organization: "my-org", + workspace: "my-workspace", + } + ); + new random.id.Id(this, "vpc_id", { + byte_length: 8, + keepers: [ + { + bar: dataTfeOutputsFoo.values.bar, + }, + ], }); } } @@ -62,4 +67,4 @@ The following attributes are exported: * `values` - The current output values for the specified workspace. * `nonsensitiveValues` - The current non-sensitive output values for the specified workspace, this is a subset of all output values. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 519edc03a..1a242fe1b 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a policy set defined in a specified organiz For workspace policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfePolicySet } from "./.gen/providers/tfe/data-tfe-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfePolicySet(this, "test", { + new tfe.dataTfePolicySet.DataTfePolicySet(this, "test", { name: "my-policy-set-name", organization: "my-org-name", }); @@ -72,4 +69,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/project.html.markdown b/website/docs/cdktf/typescript/d/project.html.markdown index a6059773f..5dc7b21c0 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeProject } from "./.gen/providers/tfe/data-tfe-project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeProject(this, "foo", { + new tfe.dataTfeProject.DataTfeProject(this, "foo", { name: "my-project-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The project ID. * `workspaceIds` - IDs of the workspaces that are associated with the project. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/saml_settings.html.markdown b/website/docs/cdktf/typescript/d/saml_settings.html.markdown index 0f2535cb1..d3ee757b0 100644 --- a/website/docs/cdktf/typescript/d/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/saml_settings.html.markdown @@ -16,34 +16,21 @@ Use this data source to get information about SAML Settings. It applies only to Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSamlSettings } from "./.gen/providers/tfe/data-tfe-saml-settings"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new DataTfeSamlSettings(this, "foo", { - provider: admin, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.token } +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +data "tfe_saml_settings" "foo" { + provider = tfe.admin +} ``` ## Argument Reference @@ -77,4 +64,4 @@ The following attributes are exported: * `signatureSigningMethod` - Signature Signing Method. * `signatureDigestMethod` - Signature Digest Method. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 3e121741d..7146f5fc4 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -21,25 +21,21 @@ tar file containing configuration files (a Terraform "slug") when those files ch Tracking a local directory to upload the Sentinel configuration and policies: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeSlug(this, "test", { + const dataTfeSlugTest = new tfe.dataTfeSlug.DataTfeSlug(this, "test", { sourcePath: "policies/my-policy-set", }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set", organization: "my-org-name", - slug: Token.asStringMap(test), + slug: cdktf.Token.asStringMap(dataTfeSlugTest), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); @@ -54,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/ssh_key.html.markdown b/website/docs/cdktf/typescript/d/ssh_key.html.markdown index 0a783fac4..c8167b534 100644 --- a/website/docs/cdktf/typescript/d/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/d/ssh_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a SSH key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSshKey } from "./.gen/providers/tfe/data-tfe-ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeSshKey(this, "test", { + new tfe.dataTfeSshKey.DataTfeSshKey(this, "test", { name: "my-ssh-key-name", organization: "my-org-name", }); @@ -47,4 +44,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the SSH key. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/team.html.markdown b/website/docs/cdktf/typescript/d/team.html.markdown index 95b80260f..fe9dad43f 100644 --- a/website/docs/cdktf/typescript/d/team.html.markdown +++ b/website/docs/cdktf/typescript/d/team.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a team. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeam } from "./.gen/providers/tfe/data-tfe-team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeam(this, "test", { + new tfe.dataTfeTeam.DataTfeTeam(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the team. * `ssoTeamId` - (Optional) The [SSO Team ID](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/single-sign-on#team-names-and-sso-team-ids) of the team, if it has been defined - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/team_access.html.markdown b/website/docs/cdktf/typescript/d/team_access.html.markdown index e74140956..a5afb95d0 100644 --- a/website/docs/cdktf/typescript/d/team_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamAccess } from "./.gen/providers/tfe/data-tfe-team-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamAccess(this, "test", { + new tfe.dataTfeTeamAccess.DataTfeTeamAccess(this, "test", { teamId: "my-team-id", workspaceId: "my-workspace-id", }); @@ -58,4 +55,4 @@ The `permissions` block contains: * `workspaceLocking` - Whether permission is granted to manually lock the workspace or not. * `runTasks` - Boolean determining whether or not to grant the team permission to manage workspace run tasks. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/team_project_access.html.markdown b/website/docs/cdktf/typescript/d/team_project_access.html.markdown index b53b01c7b..d250165a4 100644 --- a/website/docs/cdktf/typescript/d/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/d/team_project_access.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about team permissions for a project. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeamProjectAccess } from "./.gen/providers/tfe/data-tfe-team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeamProjectAccess(this, "test", { + new tfe.dataTfeTeamProjectAccess.DataTfeTeamProjectAccess(this, "test", { projectId: "my-project-id", teamId: "my-team-id", }); @@ -48,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` The team project access ID. * `access` - The type of access granted to the team on the project. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/teams.html.markdown b/website/docs/cdktf/typescript/d/teams.html.markdown index a882c09e3..e71e2fc1e 100644 --- a/website/docs/cdktf/typescript/d/teams.html.markdown +++ b/website/docs/cdktf/typescript/d/teams.html.markdown @@ -14,18 +14,15 @@ Use this data source to get a list of Teams in an Organization and a map of thei ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeTeams } from "./.gen/providers/tfe/data-tfe-teams"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeTeams(this, "foo", { + new tfe.dataTfeTeams.DataTfeTeams(this, "foo", { organization: "my-org-name", }); } @@ -45,4 +42,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the organization. * `names` - A list of team names in an organization. * `ids` - A map of team names in an organization and their IDs. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/variable_set.html.markdown b/website/docs/cdktf/typescript/d/variable_set.html.markdown index 3ff81d38e..9753bc586 100644 --- a/website/docs/cdktf/typescript/d/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/d/variable_set.html.markdown @@ -16,18 +16,15 @@ This data source is used to retrieve a named variable set For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeVariableSet(this, "test", { + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { name: "my-variable-set-name", organization: "my-org-name", }); @@ -55,4 +52,4 @@ The following arguments are supported: * `variableIds` - IDs of the variables attached to the variable set. * `projectIds` - IDs of the projects that use the variable set. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/variables.html.markdown b/website/docs/cdktf/typescript/d/variables.html.markdown index 09ecfabe9..f4f5aee20 100644 --- a/website/docs/cdktf/typescript/d/variables.html.markdown +++ b/website/docs/cdktf/typescript/d/variables.html.markdown @@ -16,25 +16,29 @@ This data source is used to retrieve all variables defined in a specified worksp For workspace variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -45,25 +49,26 @@ class MyConvertedCode extends TerraformStack { For variable set variables: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeVariableSet } from "./.gen/providers/tfe/data-tfe-variable-set"; -import { DataTfeVariables } from "./.gen/providers/tfe/data-tfe-variables"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeVariableSet(this, "test", { - name: "my-variable-set-name", - organization: "my-org-name", - }); - const dataTfeVariablesTest = new DataTfeVariables(this, "test_1", { - variableSetId: Token.asString(test.id), - }); + const dataTfeVariableSetTest = + new tfe.dataTfeVariableSet.DataTfeVariableSet(this, "test", { + name: "my-variable-set-name", + organization: "my-org-name", + }); + const dataTfeVariablesTest = new tfe.dataTfeVariables.DataTfeVariables( + this, + "test_1", + { + variableSetId: cdktf.Token.asString(dataTfeVariableSetTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataTfeVariablesTest.overrideLogicalId("test"); } @@ -93,4 +98,4 @@ The `variables, terraform and env` blocks contains: * `sensitive` - If the variable is marked as sensitive or not * `hcl` - If the variable is marked as HCL or not - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index d78b4727a..280e4a2d8 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a workspace. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspace(this, "test", { + new tfe.dataTfeWorkspace.DataTfeWorkspace(this, "test", { name: "my-workspace-name", organization: "my-org-name", }); @@ -91,4 +88,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown index 31628da96..6db1fb692 100644 --- a/website/docs/cdktf/typescript/d/workspace_ids.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_ids.html.markdown @@ -14,30 +14,27 @@ Use this data source to get a map of workspace IDs. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceIds } from "./.gen/providers/tfe/data-tfe-workspace-ids"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceIds(this, "all", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "all", { names: ["*"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "app-frontend", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "app-frontend", { names: ["app-frontend-prod", "app-frontend-dev1", "app-frontend-staging"], organization: "my-org-name", }); - new DataTfeWorkspaceIds(this, "prod-apps", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-apps", { organization: "my-org-name", tagNames: ["prod", "app", "aws"], }); - new DataTfeWorkspaceIds(this, "prod-only", { + new tfe.dataTfeWorkspaceIds.DataTfeWorkspaceIds(this, "prod-only", { excludeTags: ["app"], organization: "my-org-name", tagNames: ["prod"], @@ -67,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `fullNames` - A map of workspace names and their full names, which look like `/`. * `ids` - A map of workspace names and their opaque, immutable IDs, which look like `ws-`. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 5ccb6689f..69c36eda8 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a [Workspace Run tasks](https://de ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspaceRunTask } from "./.gen/providers/tfe/data-tfe-workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeWorkspaceRunTask(this, "foobar", { + new tfe.dataTfeWorkspaceRunTask.DataTfeWorkspaceRunTask(this, "foobar", { taskId: "task-def456", workspaceId: "ws-abc123", }); @@ -51,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index e1c75f06d..427420b16 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -73,16 +73,14 @@ For production use, you should constrain the acceptable provider versions via configuration, to ensure that new versions with breaking changes will not be automatically installed by `terraform init` in the future: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); +```hcl +terraform { + required_providers { + tfe = { + version = "~> 0.50.0" + } } } - ``` As this provider is still at version zero, you should constrain the acceptable @@ -92,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.54.0" ... } ``` @@ -101,34 +99,17 @@ For more information on provider installation and constraining provider versions ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -interface MyConfig { - email: any; - name: any; -} -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string, config: MyConfig) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - new Organization(this, "org", { - email: config.email, - name: config.name, - }); - } +```hcl +provider "tfe" { + hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + token = var.token + version = "~> 0.54.0" } +# Create an organization +resource "tfe_organization" "org" { + # ... +} ``` ## Argument Reference @@ -148,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index fbbaca18a..1f0bdf6a7 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -17,48 +17,39 @@ incorporating an admin token in your provider config. Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AdminOrganizationSettings } from "./.gen/providers/tfe/admin-organization-settings"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { TfeProvider } from "./.gen/providers/tfe/provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: token.stringValue, - }); - const admin = new TfeProvider(this, "tfe_1", { - alias: "admin", - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - const aModuleConsumer = new Organization(this, "a-module-consumer", { - email: "admin@company.com", - name: "my-other-org", - }); - const aModuleProducer = new Organization(this, "a-module-producer", { - email: "admin@company.com", - name: "my-org", - }); - new AdminOrganizationSettings(this, "test-settings", { - accessBetaTools: false, - globalModuleSharing: false, - moduleSharingConsumerOrganizations: [aModuleConsumer.name], - organization: aModuleProducer.name, - provider: "${tfe.admin}", - workspaceLimit: 15, - }); - } +```hcl + +provider "tfe" { + hostname = var.hostname + token = var.token +} + +provider "tfe" { + alias = "admin" + hostname = var.hostname + token = var.admin_token +} + +resource "tfe_organization" "a-module-producer" { + name = "my-org" + email = "admin@company.com" } +resource "tfe_organization" "a-module-consumer" { + name = "my-other-org" + email = "admin@company.com" +} + +resource "tfe_admin_organization_settings" "test-settings" { + provider = tfe.admin + organization = tfe_organization.a-module-producer.name + workspace_limit = 15 + access_beta_tools = false + global_module_sharing = false + module_sharing_consumer_organizations = [ + tfe_organization.a-module-consumer.name + ] +} ``` ## Argument Reference @@ -75,4 +66,8 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization - \ No newline at end of file +## Import + +This resource does not manage the creation of an organization and there is no need to import it. + + diff --git a/website/docs/cdktf/typescript/r/agent_pool.html.markdown b/website/docs/cdktf/typescript/r/agent_pool.html.markdown index 1e9d0c0f2..6b05943a6 100644 --- a/website/docs/cdktf/typescript/r/agent_pool.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool.html.markdown @@ -18,25 +18,25 @@ pools to run remote operations with isolated, private, or on-premises infrastruc Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new AgentPool(this, "test-agent-pool", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.agentPool.AgentPool(this, "test-agent-pool", { name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), organizationScoped: true, }); } @@ -70,4 +70,4 @@ terraform import tfe_agent_pool.test apool-rW0KoLSlnuNb5adB terraform import tfe_workspace.test my-org-name/my-agent-pool-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index 76bb59161..d9a33d1d3 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -20,47 +20,53 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.name, - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, - organizationScoped: false, - }); - const allowed = new AgentPoolAllowedWorkspaces(this, "allowed", { - agentPoolId: testAgentPool.id, - allowedWorkspaceIds: Token.asList( - "${[ for key, value in ${" + - Fn.lookupNested(test, ["*", "id"]) + - "} : value]}" - ), - }); - new WorkspaceSettings(this, "test-workspace-settings", { - agentPoolId: allowed.id, - executionMode: "agent", - workspaceId: testWorkspace.id, - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + organizationScoped: false, + } + ); + new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( + this, + "test-allowed-workspaces", + { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: [ + cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + ], + } + ); } } @@ -82,4 +88,5 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - \ No newline at end of file + + diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index f36186414..10ad0157b 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -17,29 +17,32 @@ These tokens allow agents to communicate securely with HCP Terraform. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentToken } from "./.gen/providers/tfe/agent-token"; -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.id, - }); - new AgentToken(this, "test-agent-token", { - agentPoolId: testAgentPool.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.agentToken.AgentToken(this, "test-agent-token", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), description: "my-agent-token-name", }); } @@ -60,4 +63,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/no_code_module.html.markdown b/website/docs/cdktf/typescript/r/no_code_module.html.markdown index 0e9040064..06cdac0ba 100644 --- a/website/docs/cdktf/typescript/r/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/r/no_code_module.html.markdown @@ -16,34 +16,41 @@ Creates, updates and destroys no-code module for registry modules. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -54,46 +61,53 @@ class MyConvertedCode extends TerraformStack { Creating a no-code module with variable options: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const foobar = new Organization(this, "foobar", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryModuleFoobar = new RegistryModule(this, "foobar_1", { - moduleProvider: "my_provider", - name: "test_module", - organization: foobar.id, - }); + const tfeOrganizationFoobar = new tfe.organization.Organization( + this, + "foobar", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryModuleFoobar = new tfe.registryModule.RegistryModule( + this, + "foobar_1", + { + moduleProvider: "my_provider", + name: "test_module", + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryModuleFoobar.overrideLogicalId("foobar"); - const tfeNoCodeModuleFoobar = new NoCodeModule(this, "foobar_2", { - organization: foobar.id, - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - variableOptions: [ - { - name: "ami", - options: ["ami-0", "ami-1", "ami-2"], - type: "string", - }, - { - name: "region", - options: ["us-east-1", "us-east-2", "us-west-1"], - type: "string", - }, - ], - }); + const tfeNoCodeModuleFoobar = new tfe.noCodeModule.NoCodeModule( + this, + "foobar_2", + { + organization: cdktf.Token.asString(tfeOrganizationFoobar.id), + registryModule: cdktf.Token.asString(tfeRegistryModuleFoobar.id), + variableOptions: [ + { + name: "ami", + options: ["ami-0", "ami-1", "ami-2"], + type: "string", + }, + { + name: "region", + options: ["us-east-1", "us-east-2", "us-west-1"], + type: "string", + }, + ], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNoCodeModuleFoobar.overrideLogicalId("foobar"); } @@ -127,4 +141,4 @@ No-code modules can be imported; use `` as the import ID. For terraform import tfe_no_code_module.test nocode-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 8b8518e06..6513e8520 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -19,41 +19,41 @@ Each workspace can have up to 20 notification configurations, and they apply to Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { - name: "my-workspace-name", - organization: test.id, - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_2", + "test", { - destinationType: "generic", - enabled: true, - name: "my-test-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - url: "https://example.com", - workspaceId: Token.asString(tfeWorkspaceTest.id), + email: "admin@company.com", + name: "my-org-name", } ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeWorkspaceTest.overrideLogicalId("test"); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_2", + { + destinationType: "generic", + enabled: true, + name: "my-test-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + url: "https://example.com", + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -64,52 +64,50 @@ class MyConvertedCode extends TerraformStack { With `destinationType` of `email`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -120,57 +118,55 @@ class MyConvertedCode extends TerraformStack { (**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `email_users`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NotificationConfiguration } from "./.gen/providers/tfe/notification-configuration"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeOrganizationMembershipTest = new OrganizationMembership( + const tfeOrganizationTest = new tfe.organization.Organization( this, - "test_1", + "test", { - email: "test.member@company.com", - organization: "my-org-name", + email: "admin@company.com", + name: "my-org-name", } ); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test_1", { + email: "test.member@company.com", + organization: "my-org-name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationMembershipTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeNotificationConfigurationTest = new NotificationConfiguration( - this, - "test_3", - { - destinationType: "email", - emailAddresses: [ - "user1@company.com", - "user2@company.com", - "user3@company.com", - ], - emailUserIds: [Token.asString(tfeOrganizationMembershipTest.userId)], - enabled: true, - name: "my-test-email-notification-configuration", - triggers: ["run:created", "run:planning", "run:errored"], - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeNotificationConfigurationTest = + new tfe.notificationConfiguration.NotificationConfiguration( + this, + "test_3", + { + destinationType: "email", + emailAddresses: [ + "user1@company.com", + "user2@company.com", + "user3@company.com", + ], + emailUserIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.userId), + ], + enabled: true, + name: "my-test-email-notification-configuration", + triggers: ["run:created", "run:planning", "run:errored"], + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeNotificationConfigurationTest.overrideLogicalId("test"); } @@ -220,4 +216,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index d02868f1f..c0e61cb7e 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -19,18 +19,15 @@ provider. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", name: "my-github-oauth-client", @@ -50,18 +47,15 @@ See [documentation for HCP Terraform and Terraform Enterprise setup](https://dev **Note:** This resource requires a private key when creating Azure DevOps Server OAuth clients. ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://ado.example.com", httpUrl: "https://ado.example.com", name: "my-ado-oauth-client", @@ -84,18 +78,15 @@ When using BitBucket Server, you must use three required fields: `key`, `secret` ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OauthClient(this, "test", { + new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://bbs.example.com", httpUrl: "https://bss.example.com", key: "", @@ -142,4 +133,4 @@ Link. * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index 05b4e55e4..dac894796 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -16,18 +16,15 @@ Manages organizations. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Organization(this, "test", { + new tfe.organization.Organization(this, "test", { email: "admin@company.com", name: "my-org-name", }); @@ -72,4 +69,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index 7874e4048..ba4af10f8 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -24,18 +24,15 @@ be updated manually. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationMembership(this, "test", { + new tfe.organizationMembership.OrganizationMembership(this, "test", { email: "user@company.com", organization: "my-org-name", }); @@ -72,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown index 23972ab15..971493fed 100644 --- a/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_module_sharing.html.markdown @@ -19,18 +19,15 @@ use of an admin token and is for Terraform Enterprise only. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationModuleSharing } from "./.gen/providers/tfe/organization-module-sharing"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationModuleSharing(this, "test", { + new tfe.organizationModuleSharing.OrganizationModuleSharing(this, "test", { moduleConsumers: ["my-org-name-2", "my-org-name-3"], organization: "my-org-name", }); @@ -46,4 +43,4 @@ The following arguments are supported: * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `moduleConsumers` - (Required) Names of the organizations to consume the module registry. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index 462ace970..ca4ff3bab 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -18,18 +18,15 @@ The tfe_organization_run_task resource creates, updates and destroys [Organizati Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationRunTask } from "./.gen/providers/tfe/organization-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationRunTask(this, "example", { + new tfe.organizationRunTask.OrganizationRunTask(this, "example", { description: "An example task", enabled: true, name: "task-name", @@ -66,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/organization_token.html.markdown b/website/docs/cdktf/typescript/r/organization_token.html.markdown index 273e96979..2b6aaf5ba 100644 --- a/website/docs/cdktf/typescript/r/organization_token.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_token.html.markdown @@ -17,18 +17,15 @@ can be used to act as the organization service account. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OrganizationToken(this, "test", { + new tfe.organizationToken.OrganizationToken(this, "test", { organization: "my-org-name", }); } @@ -52,31 +49,15 @@ never expire. When a token has an expiry: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationToken } from "./.gen/providers/tfe/organization-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. - For a more precise conversion please use the --provider flag in convert.*/ - const example = new Rotating(this, "example", { - rotation_days: 30, - }); - new OrganizationToken(this, "test", { - expiredAt: Token.asString(example.rotationRfc3339), - organization: Token.asString(org.name), - }); - } +```hcl +resource "time_rotating" "example" { + rotation_days = 30 } +resource "tfe_organization_token" "test" { + organization = data.tfe_organization.org.name + expired_at = time_rotating.example.rotation_rfc3339 +} ``` ## Attributes Reference @@ -93,4 +74,4 @@ For example: terraform import tfe_organization_token.test my-org-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/policy.html.markdown b/website/docs/cdktf/typescript/r/policy.html.markdown index e9edf7291..d03bf3d48 100644 --- a/website/docs/cdktf/typescript/r/policy.html.markdown +++ b/website/docs/cdktf/typescript/r/policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage for Sentinel: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", kind: "sentinel", @@ -48,18 +45,15 @@ class MyConvertedCode extends TerraformStack { Basic usage for Open Policy Agent(OPA): ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Policy } from "./.gen/providers/tfe/policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Policy(this, "test", { + new tfe.policy.Policy(this, "test", { description: "This policy always passes", enforceMode: "mandatory", kind: "opa", @@ -103,4 +97,4 @@ import ID. For example: terraform import tfe_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 6c3c74812..74aa0b73b 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -51,7 +51,6 @@ class MyConvertedCode extends TerraformStack { }); } } - ``` Using manually-specified policies: @@ -80,39 +79,25 @@ class MyConvertedCode extends TerraformStack { }); } } - ``` Manually uploaded policy set, in lieu of VCS: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeSlug } from "./.gen/providers/tfe/data-tfe-slug"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const test = new DataTfeSlug(this, "test", { - sourcePath: "policies/my-policy-set", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { - description: "A brand new policy set", - name: "my-policy-set", - organization: "my-org-name", - slug: Token.asStringMap(test), - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - tfePolicySetTest.overrideLogicalId("test"); - } +```hcl +data "tfe_slug" "test" { + // point to the local directory where the policies are located. + source_path = "policies/my-policy-set" } +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + workspace_ids = [tfe_workspace.test.id] + + // reference the tfe_slug data source. + slug = data.tfe_slug.test +} ``` ## Argument Reference @@ -175,4 +160,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown index 9acedef19..ec27fa502 100644 --- a/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set_parameter.html.markdown @@ -16,34 +16,34 @@ Creates, updates and destroys policy set parameters. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { PolicySetParameter } from "./.gen/providers/tfe/policy-set-parameter"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { name: "my-policy-set-name", - organization: test.id, + organization: cdktf.Token.asString(tfeOrganizationTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfePolicySetParameterTest = new PolicySetParameter(this, "test_2", { - key: "my_key_name", - policySetId: Token.asString(tfePolicySetTest.id), - value: "my_value_name", - }); + const tfePolicySetParameterTest = + new tfe.policySetParameter.PolicySetParameter(this, "test_2", { + key: "my_key_name", + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + value: "my_value_name", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetParameterTest.overrideLogicalId("test"); } @@ -76,4 +76,4 @@ terraform import tfe_policy_set_parameter.test polset-wAs3zYmWAhYK7peR/var-5rTwn ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 98f69dc50..3ec3cb87d 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -16,25 +16,25 @@ Provides a project resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Project(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.project.Project(this, "test", { name: "projectname", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -62,4 +62,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 87d6f764d..ee9336a31 100644 --- a/website/docs/cdktf/typescript/r/project_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown @@ -16,41 +16,43 @@ Adds and removes policy sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectPolicySet } from "./.gen/providers/tfe/project-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeProjectTest = new Project(this, "test_2", { + const tfeProjectTest = new tfe.project.Project(this, "test_2", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeProjectPolicySetTest = new ProjectPolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - projectId: Token.asString(tfeProjectTest.id), - }); + const tfeProjectPolicySetTest = new tfe.projectPolicySet.ProjectPolicySet( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + projectId: cdktf.Token.asString(tfeProjectTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectPolicySetTest.overrideLogicalId("test"); } @@ -77,4 +79,4 @@ Project Policy Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown index cdb622020..5122c9aaa 100644 --- a/website/docs/cdktf/typescript/r/project_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/project_variable_set.html.markdown @@ -16,41 +16,40 @@ Adds and removes variable sets from a project Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "my-project-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_3", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_3", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); } @@ -77,4 +76,4 @@ Project Variable Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index b29f30999..2a7e59ed4 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -16,35 +16,42 @@ HCP Terraform's private module registry helps you share Terraform modules across Basic usage with VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { vcsRepo: { displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -100,35 +107,37 @@ class MyConvertedCode extends TerraformStack { Create private registry module with GitHub App: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeGithubAppInstallation } from "./.gen/providers/tfe/data-tfe-github-app-installation"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const ghaInstallation = new DataTfeGithubAppInstallation( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "gha_installation", + "test-organization", { - name: "YOUR_GH_NAME", + email: "admin@company.com", + name: "my-org-name", } ); - new RegistryModule(this, "petstore", { - organization: testOrganization.name, + const dataTfeGithubAppInstallationGhaInstallation = + new tfe.dataTfeGithubAppInstallation.DataTfeGithubAppInstallation( + this, + "gha_installation", + { + name: "YOUR_GH_NAME", + } + ); + new tfe.registryModule.RegistryModule(this, "petstore", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), vcsRepo: { displayIdentifier: "GH_NAME/REPO_NAME", - githubAppInstallationId: Token.asString(ghaInstallation.id), + githubAppInstallationId: cdktf.Token.asString( + dataTfeGithubAppInstallationGhaInstallation.id + ), identifier: "GH_NAME/REPO_NAME", }, }); @@ -140,28 +149,34 @@ class MyConvertedCode extends TerraformStack { Create private registry module without VCS: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-private-registry-module", { - moduleProvider: "my_provider", - name: "another_test_module", - organization: testOrganization.name, - registryName: "private", - }); + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule( + this, + "test-private-registry-module", + { + moduleProvider: "my_provider", + name: "another_test_module", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "private", + } + ); } } @@ -170,27 +185,27 @@ class MyConvertedCode extends TerraformStack { Create public registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new RegistryModule(this, "test-public-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.registryModule.RegistryModule(this, "test-public-registry-module", { moduleProvider: "aws", name: "vpc", namespace: "terraform-aws-modules", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), registryName: "public", }); } @@ -201,37 +216,41 @@ class MyConvertedCode extends TerraformStack { Create no-code provisioning registry module: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testNoCodeProvisioningRegistryModule = new RegistryModule( + const tfeOrganizationTestOrganization = new tfe.organization.Organization( this, - "test-no-code-provisioning-registry-module", + "test-organization", { - moduleProvider: "aws", - name: "vpc", - namespace: "terraform-aws-modules", - organization: testOrganization.name, - registryName: "public", + email: "admin@company.com", + name: "my-org-name", } ); - new NoCodeModule(this, "foobar", { - organization: testOrganization.id, - registryModule: testNoCodeProvisioningRegistryModule.id, + const tfeRegistryModuleTestNoCodeProvisioningRegistryModule = + new tfe.registryModule.RegistryModule( + this, + "test-no-code-provisioning-registry-module", + { + moduleProvider: "aws", + name: "vpc", + namespace: "terraform-aws-modules", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + registryName: "public", + } + ); + new tfe.noCodeModule.NoCodeModule(this, "foobar", { + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + registryModule: cdktf.Token.asString( + tfeRegistryModuleTestNoCodeProvisioningRegistryModule.id + ), }); } } @@ -292,4 +311,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index e8bc59ed1..1c6bc9701 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -19,34 +19,41 @@ to up to 20 source workspaces. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RunTrigger } from "./.gen/providers/tfe/run-trigger"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testSourceable = new Workspace(this, "test-sourceable", { - name: "my-sourceable-workspace-name", - organization: testOrganization.id, - }); - const testWorkspace = new Workspace(this, "test-workspace", { - name: "my-workspace-name", - organization: testOrganization.id, - }); - new RunTrigger(this, "test", { - sourceableId: testSourceable.id, - workspaceId: testWorkspace.id, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTestSourceable = new tfe.workspace.Workspace( + this, + "test-sourceable", + { + name: "my-sourceable-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( + this, + "test-workspace", + { + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.id), + } + ); + new tfe.runTrigger.RunTrigger(this, "test", { + sourceableId: cdktf.Token.asString(tfeWorkspaceTestSourceable.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), }); } } @@ -73,4 +80,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/saml_settings.html.markdown b/website/docs/cdktf/typescript/r/saml_settings.html.markdown index 78e016f2f..37a16f856 100644 --- a/website/docs/cdktf/typescript/r/saml_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/saml_settings.html.markdown @@ -15,31 +15,17 @@ Use this resource to create, update and destroy SAML Settings. It applies only t Basic usage for SAML Settings: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TfeProvider } from "./.gen/providers/tfe/provider"; -import { SamlSettings } from "./.gen/providers/tfe/saml-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new TfeProvider(this, "tfe", { - hostname: hostname.stringValue, - token: adminToken.stringValue, - }); - new SamlSettings(this, "this", { - idpCert: "foobarCertificate", - sloEndpointUrl: "https://example.com/slo_endpoint_url", - ssoEndpointUrl: "https://example.com/sso_endpoint_url", - }); - } +```hcl +provider "tfe" { + hostname = var.hostname + token = var.admin_token } +resource "tfe_saml_settings" "this" { + idp_cert = "foobarCertificate" + slo_endpoint_url = "https://example.com/slo_endpoint_url" + sso_endpoint_url = "https://example.com/sso_endpoint_url" + } ``` ## Argument Reference @@ -78,4 +64,4 @@ SAML Settings can be imported. terraform import tfe_saml_settings.this saml ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown index 0c1b07cf4..95e04fea9 100644 --- a/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_policy.html.markdown @@ -21,18 +21,15 @@ enforced during runs. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelPolicy } from "./.gen/providers/tfe/sentinel-policy"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelPolicy(this, "test", { + new tfe.sentinelPolicy.SentinelPolicy(this, "test", { description: "This policy always passes", enforceMode: "hard-mandatory", name: "my-policy-name", @@ -69,4 +66,4 @@ import ID. For example: terraform import tfe_sentinel_policy.test my-org-name/pol-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 5005e86a3..2184fb63e 100644 --- a/website/docs/cdktf/typescript/r/ssh_key.html.markdown +++ b/website/docs/cdktf/typescript/r/ssh_key.html.markdown @@ -17,18 +17,15 @@ key. An organization can have multiple SSH keys available. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SshKey } from "./.gen/providers/tfe/ssh-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SshKey(this, "test", { + new tfe.sshKey.SshKey(this, "test", { key: "private-ssh-key", name: "my-ssh-key-name", organization: "my-org-name", @@ -55,4 +52,4 @@ The following arguments are supported: Because the Terraform Enterprise API does not return the private SSH key content, this resource cannot be imported. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index 723937553..2726bf8a9 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -16,18 +16,15 @@ Manages teams. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); @@ -39,18 +36,15 @@ class MyConvertedCode extends TerraformStack { Organization Permission usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new Team(this, "test", { + new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", organizationAccess: { @@ -103,4 +97,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_access.html.markdown b/website/docs/cdktf/typescript/r/team_access.html.markdown index 79dcd1795..fb13753fd 100644 --- a/website/docs/cdktf/typescript/r/team_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_access.html.markdown @@ -16,33 +16,28 @@ Associate a team to permissions on a workspace. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamAccess } from "./.gen/providers/tfe/team-access"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeTeamAccessTest = new TeamAccess(this, "test_2", { + const tfeTeamAccessTest = new tfe.teamAccess.TeamAccess(this, "test_2", { access: "read", - teamId: test.id, - workspaceId: Token.asString(tfeWorkspaceTest.id), + teamId: cdktf.Token.asString(tfeTeamTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamAccessTest.overrideLogicalId("test"); @@ -85,4 +80,4 @@ example: terraform import tfe_team_access.test my-org-name/my-workspace-name/tws-8S5wnRbRpogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_member.html.markdown b/website/docs/cdktf/typescript/r/team_member.html.markdown index d04d60adb..45971f676 100644 --- a/website/docs/cdktf/typescript/r/team_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_member.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMember } from "./.gen/providers/tfe/team-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMemberTest = new TeamMember(this, "test_1", { - teamId: test.id, + const tfeTeamMemberTest = new tfe.teamMember.TeamMember(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), username: "sander", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -68,4 +64,4 @@ example: terraform import tfe_team_member.test team-47qC3LmA47piVan7/sander ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_members.html.markdown b/website/docs/cdktf/typescript/r/team_members.html.markdown index 385531b7e..f1c2fa8b8 100644 --- a/website/docs/cdktf/typescript/r/team_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_members.html.markdown @@ -25,24 +25,20 @@ used once. All four resources cannot be used for the same team simultaneously. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), usernames: ["admin", "sander"], }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ @@ -55,26 +51,22 @@ class MyConvertedCode extends TerraformStack { With a set of usernames: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamMembers } from "./.gen/providers/tfe/team-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsernames = Fn.toset(["user1", "user2"]); - const test = new Team(this, "test", { + const allUsernames = cdktf.Fn.toset(["user1", "user2"]); + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamMembersTest = new TeamMembers(this, "test_1", { - teamId: test.id, - usernames: Token.asList( + const tfeTeamMembersTest = new tfe.teamMembers.TeamMembers(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), + usernames: cdktf.Token.asList( "${[ for user in ${" + allUsernames + "} : user]}" ), }); @@ -104,4 +96,4 @@ Team members can be imported; use `` as the import ID. For example: terraform import tfe_team_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index f264c9f96..c7e1877b3 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -24,37 +24,32 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMember } from "./.gen/providers/tfe/team-organization-member"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_1", { + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_1", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMemberTest = new TeamOrganizationMember( - this, - "test_2", - { - organizationMembershipId: test.id, - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMemberTest = + new tfe.teamOrganizationMember.TeamOrganizationMember(this, "test_2", { + organizationMembershipId: cdktf.Token.asString( + tfeOrganizationMembershipTest.id + ), + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMemberTest.overrideLogicalId("test"); } @@ -82,4 +77,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 425e367ba..12151468f 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -24,41 +24,38 @@ an instance of Terraform Enterprise at least as recent as v202004-1. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const sample = new OrganizationMembership(this, "sample", { - email: "sample@hashicorp.com", - organization: "my-org-name", - }); - const test = new OrganizationMembership(this, "test", { - email: "example@hashicorp.com", - organization: "my-org-name", - }); - const tfeTeamTest = new Team(this, "test_2", { + const tfeOrganizationMembershipSample = + new tfe.organizationMembership.OrganizationMembership(this, "sample", { + email: "sample@hashicorp.com", + organization: "my-org-name", + }); + const tfeOrganizationMembershipTest = + new tfe.organizationMembership.OrganizationMembership(this, "test", { + email: "example@hashicorp.com", + organization: "my-org-name", + }); + const tfeTeamTest = new tfe.team.Team(this, "test_2", { name: "my-team-name", organization: "my-org-name", }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTest.overrideLogicalId("test"); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_3", - { - organizationMembershipIds: [test.id, sample.id], - teamId: Token.asString(tfeTeamTest.id), - } - ); + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_3", { + organizationMembershipIds: [ + cdktf.Token.asString(tfeOrganizationMembershipTest.id), + cdktf.Token.asString(tfeOrganizationMembershipSample.id), + ], + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -69,48 +66,48 @@ class MyConvertedCode extends TerraformStack { With a set of organization members: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OrganizationMembership } from "./.gen/providers/tfe/organization-membership"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamOrganizationMembers } from "./.gen/providers/tfe/team-organization-members"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const allUsers = Fn.toset(["user1@hashicorp.com", "user2@hashicorp.com"]); + const allUsers = cdktf.Fn.toset([ + "user1@hashicorp.com", + "user2@hashicorp.com", + ]); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const allMembershipForEachIterator = TerraformIterator.fromList( - Token.asAny(allUsers) + const tfeOrganizationMembershipAllMembershipForEachIterator = + cdktf.TerraformIterator.fromList(cdktf.Token.asAny(allUsers)); + new tfe.organizationMembership.OrganizationMembership( + this, + "all_membership", + { + email: cdktf.Token.asString( + tfeOrganizationMembershipAllMembershipForEachIterator.key + ), + organization: "my-org-name", + forEach: tfeOrganizationMembershipAllMembershipForEachIterator, + } ); - new OrganizationMembership(this, "all_membership", { - email: Token.asString(allMembershipForEachIterator.key), - organization: "my-org-name", - forEach: allMembershipForEachIterator, - }); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamOrganizationMembersTest = new TeamOrganizationMembers( - this, - "test_2", - { - organizationMembershipIds: Token.asList( + const tfeTeamOrganizationMembersTest = + new tfe.teamOrganizationMembers.TeamOrganizationMembers(this, "test_2", { + organizationMembershipIds: cdktf.Token.asList( "${[ for member in ${" + allUsers + "} : tfe_organization_membership.all_membership[member].id]}" ), - teamId: test.id, - } - ); + teamId: cdktf.Token.asString(tfeTeamTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.overrideLogicalId("test"); } @@ -134,4 +131,8 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file +<<<<<<< HEAD + +======= + +>>>>>>> adf61bce (cdktf: update documentation) diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index f85ec64cc..b221ebff0 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -16,32 +16,28 @@ Associate a team to permissions on a project. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const admin = new Team(this, "admin", { + const tfeTeamAdmin = new tfe.team.Team(this, "admin", { name: "my-admin-team", organization: "my-org-name", }); - const tfeTeamProjectAccessAdmin = new TeamProjectAccess(this, "admin_2", { - access: "admin", - projectId: test.id, - teamId: admin.id, - }); + const tfeTeamProjectAccessAdmin = + new tfe.teamProjectAccess.TeamProjectAccess(this, "admin_2", { + access: "admin", + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamAdmin.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamProjectAccessAdmin.overrideLogicalId("admin"); } @@ -91,28 +87,23 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Project } from "./.gen/providers/tfe/project"; -import { Team } from "./.gen/providers/tfe/team"; -import { TeamProjectAccess } from "./.gen/providers/tfe/team-project-access"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Project(this, "test", { + const tfeProjectTest = new tfe.project.Project(this, "test", { name: "myproject", organization: "my-org-name", }); - const dev = new Team(this, "dev", { + const tfeTeamDev = new tfe.team.Team(this, "dev", { name: "my-dev-team", organization: "my-org-name", }); - new TeamProjectAccess(this, "custom", { + new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { access: "custom", projectAccess: [ { @@ -120,8 +111,8 @@ class MyConvertedCode extends TerraformStack { teams: "none", }, ], - projectId: test.id, - teamId: dev.id, + projectId: cdktf.Token.asString(tfeProjectTest.id), + teamId: cdktf.Token.asString(tfeTeamDev.id), workspaceAccess: [ { create: true, @@ -154,4 +145,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/team_token.html.markdown b/website/docs/cdktf/typescript/r/team_token.html.markdown index 702ea826e..fe120f2cb 100644 --- a/website/docs/cdktf/typescript/r/team_token.html.markdown +++ b/website/docs/cdktf/typescript/r/team_token.html.markdown @@ -16,24 +16,20 @@ Generates a new team token and overrides existing token if one exists. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const tfeTeamTokenTest = new TeamToken(this, "test_1", { - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_1", { + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -59,31 +55,27 @@ never expire. When a token has an expiry: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Team } from "./.gen/providers/tfe/team"; -import { TeamToken } from "./.gen/providers/tfe/team-token"; -import { Rotating } from "./.gen/providers/time/rotating"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +import * as time from "./.gen/providers/time"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: time. For a more precise conversion please use the --provider flag in convert.*/ - const test = new Team(this, "test", { + const tfeTeamTest = new tfe.team.Team(this, "test", { name: "my-team-name", organization: "my-org-name", }); - const example = new Rotating(this, "example", { + const timeRotatingExample = new time.rotating.Rotating(this, "example", { rotation_days: 30, }); - const tfeTeamTokenTest = new TeamToken(this, "test_2", { - expiredAt: Token.asString(example.rotationRfc3339), - teamId: test.id, + const tfeTeamTokenTest = new tfe.teamToken.TeamToken(this, "test_2", { + expiredAt: cdktf.Token.asString(timeRotatingExample.rotationRfc3339), + teamId: cdktf.Token.asString(tfeTeamTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamTokenTest.overrideLogicalId("test"); @@ -105,4 +97,4 @@ Team tokens can be imported; use `` as the import ID. For example: terraform import tfe_team_token.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 7dfc5508d..7ac1306ee 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -16,18 +16,15 @@ Manage Terraform versions available on HCP Terraform and Terraform Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { TerraformVersion } from "./.gen/providers/tfe/terraform-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new TerraformVersion(this, "test", { + new tfe.terraformVersion.TerraformVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/terraform.zip", version: "1.1.2-custom", @@ -68,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 46e787a4f..7a2783483 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -16,35 +16,34 @@ Creates, updates and destroys variables. Basic usage for workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeWorkspaceTest = new Workspace(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_1", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeVariableTest = new Variable(this, "test_2", { + const tfeVariableTest = new tfe.variable.Variable(this, "test_2", { category: "terraform", description: "a useful description", key: "my_key_name", value: "my_value_name", - workspaceId: Token.asString(tfeWorkspaceTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableTest.overrideLogicalId("test"); @@ -56,44 +55,43 @@ class MyConvertedCode extends TerraformStack { Basic usage for variable sets: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", global: false, name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -135,42 +133,31 @@ While the `value` field may be referenced in other resources, for safety it is a The `readableValue` attribute is not sensitive, and will not be redacted; instead, it will be null if the variable is sensitive. This allows other resources to reference it, while keeping their plan outputs readable. For example: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Variable } from "./.gen/providers/tfe/variable"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const sensitiveVar = new Variable(this, "sensitive_var", { - category: "terraform", - key: "sensitive_key", - sensitive: true, - value: "sensitive_value", - workspaceId: workspace.id, - }); - const visibleVar = new Variable(this, "visible_var", { - category: "terraform", - key: "visible_key", - sensitive: false, - value: "visible_value", - workspaceId: workspace.id, - }); - new Workspace(this, "sensitive_workspace", { - name: "workspace-${" + sensitiveVar.value + "}", - organization: "organization name", - }); - new Workspace(this, "visible_workspace", { - name: "workspace-${" + visibleVar.readableValue + "}", - organization: "organization name", - }); - } +``` +resource "tfe_variable" "sensitive_var" { + key = "sensitive_key" + value = "sensitive_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = true +} + +resource "tfe_variable" "visible_var" { + key = "visible_key" + value = "visible_value" // this will be redacted from plan outputs + category = "terraform" + workspace_id = tfe_workspace.workspace.id + sensitive = false +} + +resource "tfe_workspace" "sensitive_workspace" { + name = "workspace-${tfe_variable.sensitive_var.value}" // this will be redacted from plan outputs + organization = "organization name" +} + +resource "tfe_workspace" "visible_workspace" { + name = "workspace-${tfe_variable.visible_var.readable_value}" // this will not be redacted from plan outputs + organization = "organization name" } ``` @@ -198,4 +185,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/variable_set.html.markdown b/website/docs/cdktf/typescript/r/variable_set.html.markdown index f4e66379a..79b9e8037 100644 --- a/website/docs/cdktf/typescript/r/variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/variable_set.html.markdown @@ -16,75 +16,68 @@ Creates, updates and destroys variable sets. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Project } from "./.gen/providers/tfe/project"; -import { ProjectVariableSet } from "./.gen/providers/tfe/project-variable-set"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeProjectTest = new Project(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { name: "projectname", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectTest.overrideLogicalId("test"); - const tfeVariableSetTest = new VariableSet(this, "test_2", { + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_2", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_3", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_3", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_4", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_4", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); - const tfeProjectVariableSetTest = new ProjectVariableSet(this, "test_5", { - projectId: Token.asString(tfeProjectTest.id), - variableSetId: Token.asString(tfeVariableSetTest.id), - }); + const tfeProjectVariableSetTest = + new tfe.projectVariableSet.ProjectVariableSet(this, "test_5", { + projectId: cdktf.Token.asString(tfeProjectTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeProjectVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -94,44 +87,89 @@ class MyConvertedCode extends TerraformStack { Creating a global variable set: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Variable } from "./.gen/providers/tfe/variable"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Variable set applied to all workspaces.", global: true, name: "Global Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - new Variable(this, "test-a", { + new tfe.variable.Variable(this, "test-a", { category: "terraform", description: "a useful description", key: "seperate_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); - new Variable(this, "test-b", { + new tfe.variable.Variable(this, "test-b", { category: "env", description: "an environment variable", key: "another_variable", value: "my_value_name", - variableSetId: Token.asString(tfeVariableSetTest.id), + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); + } +} + +``` + +Create a priority variable set: + +```typescript +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { + super(scope, name); + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { + description: "Variable set applied to all workspaces.", + name: "Global Varset", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + priority: true, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeVariableSetTest.overrideLogicalId("test"); + new tfe.variable.Variable(this, "test-a", { + category: "terraform", + description: "a useful description", + key: "seperate_variable", + value: "my_value_name", + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + }); + new tfe.variable.Variable(this, "test-b", { + category: "env", + description: "an environment variable", + key: "another_variable", + value: "my_value_name", + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), }); } } @@ -211,4 +249,4 @@ Variable sets can be imported; use `` as the import ID. For exa terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index 4630dc0ce..dd11c8fb7 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -20,25 +20,25 @@ Provides a workspace resource. Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), tagNames: ["test", "app"], }); } @@ -49,39 +49,37 @@ class MyConvertedCode extends TerraformStack { Usage with vcs_repo: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "oauth_token_id", - organization: testOrganization, - serviceProvider: "github", - }); - new Workspace(this, "parent", { - name: "parent-ws", - organization: testOrganization, - queueAllRuns: false, - vcsRepo: { - branch: "main", - identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, - }, + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + this, + "test-agent-pool", + { + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + } + ); + new tfe.workspace.Workspace(this, "test", { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + executionMode: "agent", + name: "my-workspace-name", + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); } } @@ -197,4 +195,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index eb29e7b08..de0fbd2d8 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown @@ -18,41 +18,40 @@ Adds and removes policy sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySet } from "./.gen/providers/tfe/workspace-policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetTest = new WorkspacePolicySet(this, "test_3", { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - }); + const tfeWorkspacePolicySetTest = + new tfe.workspacePolicySet.WorkspacePolicySet(this, "test_3", { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetTest.overrideLogicalId("test"); } @@ -79,4 +78,4 @@ Workspace Policy Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown index e76d7a91a..67c51eaac 100644 --- a/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_policy_set_exclusion.html.markdown @@ -18,45 +18,44 @@ Adds and removes policy sets from an excluded workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspacePolicySetExclusion } from "./.gen/providers/tfe/workspace-policy-set-exclusion"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfePolicySetTest = new PolicySet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfePolicySetTest = new tfe.policySet.PolicySet(this, "test_1", { description: "Some description.", name: "my-policy-set", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfePolicySetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspacePolicySetExclusionTest = new WorkspacePolicySetExclusion( - this, - "test_3", - { - policySetId: Token.asString(tfePolicySetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspacePolicySetExclusionTest = + new tfe.workspacePolicySetExclusion.WorkspacePolicySetExclusion( + this, + "test_3", + { + policySetId: cdktf.Token.asString(tfePolicySetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspacePolicySetExclusionTest.overrideLogicalId("test"); } @@ -83,4 +82,4 @@ Excluded Workspace Policy Sets can be imported; use `/ \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index fabcce29e..5d7f547bb 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -24,80 +24,82 @@ The `tfe_workspace_run` expects to own exactly one apply during a creation and/o Basic usage with multiple workspaces: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const child = new Workspace(this, "child", { + const tfeWorkspaceChild = new tfe.workspace.Workspace(this, "child", { name: "child-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, - }, - }); - const wsRunParent = new WorkspaceRun(this, "ws_run_parent", { - apply: { - manualConfirm: false, - retryAttempts: 5, - retryBackoffMin: 5, - waitForRun: true, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, - destroy: { - manualConfirm: false, - retryAttempts: 3, - retryBackoffMin: 10, - waitForRun: true, - }, - workspaceId: parent.id, }); - new WorkspaceRun(this, "ws_run_child", { + const tfeWorkspaceRunWsRunParent = new tfe.workspaceRun.WorkspaceRun( + this, + "ws_run_parent", + { + apply: { + manualConfirm: false, + retryAttempts: 5, + retryBackoffMin: 5, + waitForRun: true, + }, + destroy: { + manualConfirm: false, + retryAttempts: 3, + retryBackoffMin: 10, + waitForRun: true, + }, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), + } + ); + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_child", { apply: { manualConfirm: false, retryAttempts: 5, retryBackoffMin: 5, }, - dependsOn: [wsRunParent], + dependsOn: [tfeWorkspaceRunWsRunParent], destroy: { manualConfirm: false, retryAttempts: 3, retryBackoffMin: 10, waitForRun: true, }, - workspaceId: child.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceChild.id), }); } } @@ -107,42 +109,40 @@ class MyConvertedCode extends TerraformStack { With manual confirmation: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: true, }, @@ -150,7 +150,7 @@ class MyConvertedCode extends TerraformStack { manualConfirm: true, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -160,42 +160,40 @@ class MyConvertedCode extends TerraformStack { With no retries: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceRun } from "./.gen/providers/tfe/workspace-run"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new OauthClient(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, serviceProvider: "github", }); - const parent = new Workspace(this, "parent", { + const tfeWorkspaceParent = new tfe.workspace.Workspace(this, "parent", { name: "parent-ws", - organization: testOrganization, + organization: tfeOrganizationTestOrganization, queueAllRuns: false, vcsRepo: { branch: "main", identifier: "my-org-name/vcs-repository", - oauthTokenId: test.oauthTokenId, + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), }, }); - new WorkspaceRun(this, "ws_run_parent", { + new tfe.workspaceRun.WorkspaceRun(this, "ws_run_parent", { apply: { manualConfirm: false, retry: false, @@ -205,7 +203,7 @@ class MyConvertedCode extends TerraformStack { retry: false, waitForRun: true, }, - workspaceId: parent.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceParent.id), }); } } @@ -237,4 +235,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index f4c7001e4..459eaab6e 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,26 +17,12 @@ The tfe_workspace_run_task resource associates, updates and removes [Workspace R Basic usage: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { WorkspaceRunTask } from "./.gen/providers/tfe/workspace-run-task"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new WorkspaceRunTask(this, "example", { - enforcementLevel: "advisory", - taskId: tfeOrganizationRunTask.example.id, - workspaceId: tfeWorkspace.example.id, - }); - } +```hcl +resource "tfe_workspace_run_task" "example" { + workspace_id = resource.tfe_workspace.example.id + task_id = resource.tfe_organization_run_task.example.id + enforcement_level = "advisory" } - ``` ## Argument Reference @@ -61,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + diff --git a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown index 89747f9cf..3ddea3720 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -18,45 +18,40 @@ Adds and removes variable sets from a workspace Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { VariableSet } from "./.gen/providers/tfe/variable-set"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceVariableSet } from "./.gen/providers/tfe/workspace-variable-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeVariableSetTest = new VariableSet(this, "test_1", { + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeVariableSetTest = new tfe.variableSet.VariableSet(this, "test_1", { description: "Some description.", name: "Test Varset", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeVariableSetTest.overrideLogicalId("test"); - const tfeWorkspaceTest = new Workspace(this, "test_2", { + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test_2", { name: "my-workspace-name", - organization: test.name, + organization: cdktf.Token.asString(tfeOrganizationTest.name), }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceTest.overrideLogicalId("test"); - const tfeWorkspaceVariableSetTest = new WorkspaceVariableSet( - this, - "test_3", - { - variableSetId: Token.asString(tfeVariableSetTest.id), - workspaceId: Token.asString(tfeWorkspaceTest.id), - } - ); + const tfeWorkspaceVariableSetTest = + new tfe.workspaceVariableSet.WorkspaceVariableSet(this, "test_3", { + variableSetId: cdktf.Token.asString(tfeVariableSetTest.id), + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceVariableSetTest.overrideLogicalId("test"); } @@ -83,4 +78,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 90fc05815..4b6933127 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.53.0" + version = "~> 0.54.0" } } } From 2fcd72b724520270577752adc7390c2b1a517e95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:26:15 -0400 Subject: [PATCH 350/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.49.0 to 1.51.0 (#1334) Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.49.0 to 1.51.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.49.0...v1.51.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be30a5156..6caaa17d8 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.15.0 - github.com/hashicorp/go-tfe v1.49.0 + github.com/hashicorp/go-tfe v1.51.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect diff --git a/go.sum b/go.sum index c5a424e19..bc65260ce 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMmZhI= github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.49.0 h1:HIxG/fwjXoZ5M4EQZcZkgYFCJkWtbsT9T/x71HQr5kw= -github.com/hashicorp/go-tfe v1.49.0/go.mod h1:5nP2G4S/uD8JIm3JEcM+1oLElOUgQtiXUhRQ5+DGaNg= +github.com/hashicorp/go-tfe v1.51.0 h1:nZIIMOGxzKJvL6fNO3wS/wpTdLVGHUMT6up82H9eJCE= +github.com/hashicorp/go-tfe v1.51.0/go.mod h1:yZ/FCqBsOZ/e75kL29JYqAsKctL1Tti2zYcIoQh69Ck= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From 82b30355ccd11ac06c15dceaeb3f3b47b3b876fe Mon Sep 17 00:00:00 2001 From: Zain Hasan Date: Wed, 24 Apr 2024 15:59:44 -0700 Subject: [PATCH 351/420] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c387afd3..a0913d3d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## UNRELEASED ### Enhancements * Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) +* `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) ### Features * `d/tfe_oauth_client`: Add `project_ids` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) From fae399b7b9e263589ac5c7b3cddc8c384a44ce7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:15:28 -0400 Subject: [PATCH 352/420] Build(deps): Bump peter-evans/create-pull-request from 6.0.4 to 6.0.5 (#1337) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6.0.4 to 6.0.5. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/9153d834b60caba6d51c9b9510b087acf9f33f83...6d6857d36972b65feb161a90e484f2984215f83e) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 5db16f5a5..bb8a5fe1f 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -102,7 +102,7 @@ jobs: TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins - name: Create Pull Request - uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83 # v6.0.4 + uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 with: commit-message: "cdktf: update documentation" title: "release: ${{ github.event.inputs.version }}" From c842c973181a241e732f7dfa97c5263389cf9fc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:57:16 -0400 Subject: [PATCH 353/420] Build(deps): Bump actions/download-artifact from 4.1.6 to 4.1.7 (#1338) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395...65a9edc5881444af0b9093a5e628f2fe47ea3b2e) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 321167ce2..5b5f4a6de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: node-version: 20 - name: Download artifacts - uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 - name: Install junit-report-merger run: npm install -g junit-report-merger diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index bb8a5fe1f..e4e9a36fa 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -89,7 +89,7 @@ jobs: run: npm install -g cdktf-registry-docs@1.10.1 - name: Download artifacts - uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: terraform-provider-tfe From c2d6492d0f1bd0d840c3050ce148a3ece6dafa4c Mon Sep 17 00:00:00 2001 From: Mark DeCrane Date: Mon, 6 May 2024 11:29:29 -0400 Subject: [PATCH 354/420] Adding LICENSE File to TF Provider Release Archives --- .goreleaser.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 091624871..591c8e6ad 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,8 +3,9 @@ archives: - files: - # Ensure only built binary is archived - - 'none*' + # Ensure only built binary and license file are archived + - src: 'LICENSE' + dst: 'LICENSE.txt' format: zip name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' before: From b8bf38536960497604952789effe5702ad13e634 Mon Sep 17 00:00:00 2001 From: emlanctot Date: Tue, 7 May 2024 12:59:04 -0700 Subject: [PATCH 355/420] chore: ignore linter complaints for deprecated policy.Enforce (cherry picked from commit 32c3d86dce16e5d38f7bb6f39d5820d5b2ed4733) --- internal/provider/resource_tfe_policy.go | 6 ++++-- internal/provider/resource_tfe_policy_test.go | 7 +++++++ internal/provider/resource_tfe_sentinel_policy.go | 2 ++ internal/provider/resource_tfe_sentinel_policy_test.go | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_policy.go b/internal/provider/resource_tfe_policy.go index ff0cd9c3f..15bd7eee1 100644 --- a/internal/provider/resource_tfe_policy.go +++ b/internal/provider/resource_tfe_policy.go @@ -194,7 +194,7 @@ func createOPAPolicyOptions(options *tfe.PolicyCreateOptions, d *schema.Resource enforceOpts.Mode = tfe.EnforcementMode(tfe.EnforcementLevel(v.(string))) } - options.Enforce = []*tfe.EnforcementOptions{enforceOpts} + options.Enforce = []*tfe.EnforcementOptions{enforceOpts} //nolint:staticcheck // this is still used by TFE versions older than 202306-1 vQuery, ok := d.GetOk("query") if !ok { @@ -218,7 +218,7 @@ func createSentinelPolicyOptions(options *tfe.PolicyCreateOptions, d *schema.Res enforceOpts.Mode = tfe.EnforcementMode(tfe.EnforcementLevel(v.(string))) } - options.Enforce = []*tfe.EnforcementOptions{enforceOpts} + options.Enforce = []*tfe.EnforcementOptions{enforceOpts} //nolint:staticcheck // this is still used by TFE versions older than 202306-1 return options } @@ -254,6 +254,7 @@ func resourceTFEPolicyRead(d *schema.ResourceData, meta interface{}) error { d.Set("description", policy.Description) d.Set("kind", policy.Kind) + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if len(policy.Enforce) == 1 { d.Set("enforce_mode", string(policy.Enforce[0].Mode)) } @@ -287,6 +288,7 @@ func resourceTFEPolicyUpdate(d *schema.ResourceData, meta interface{}) error { } } if d.HasChange("enforce_mode") { + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 options.Enforce = []*tfe.EnforcementOptions{ { Path: tfe.String(path), diff --git a/internal/provider/resource_tfe_policy_test.go b/internal/provider/resource_tfe_policy_test.go index f0def6962..e8fdfbaca 100644 --- a/internal/provider/resource_tfe_policy_test.go +++ b/internal/provider/resource_tfe_policy_test.go @@ -404,6 +404,7 @@ func testAccCheckTFEPolicyAttributes( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "hard-mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } @@ -419,6 +420,7 @@ func testAccCheckTFEOPAPolicyAttributes( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } @@ -438,10 +440,12 @@ func testAccCheckTFEDefaultPolicyAttributes(policy *tfe.Policy) resource.TestChe } switch policy.Kind { + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 case tfe.Sentinel: if policy.Enforce[0].Mode != "soft-mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 case tfe.OPA: if policy.Enforce[0].Mode != "advisory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) @@ -458,6 +462,7 @@ func testAccCheckTFEPolicyAttributesUpdated( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "soft-mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } @@ -473,6 +478,7 @@ func testAccCheckTFEOPAPolicyAttributesUpdatedQuery( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } @@ -492,6 +498,7 @@ func testAccCheckTFEOPAPolicyAttributesUpdatedAll( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "advisory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } diff --git a/internal/provider/resource_tfe_sentinel_policy.go b/internal/provider/resource_tfe_sentinel_policy.go index 644f78729..df81c7b35 100644 --- a/internal/provider/resource_tfe_sentinel_policy.go +++ b/internal/provider/resource_tfe_sentinel_policy.go @@ -136,6 +136,7 @@ func resourceTFESentinelPolicyRead(d *schema.ResourceData, meta interface{}) err d.Set("name", policy.Name) d.Set("description", policy.Description) + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if len(policy.Enforce) == 1 { d.Set("enforce_mode", string(policy.Enforce[0].Mode)) } @@ -161,6 +162,7 @@ func resourceTFESentinelPolicyUpdate(d *schema.ResourceData, meta interface{}) e } if d.HasChange("enforce_mode") { + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 options.Enforce = []*tfe.EnforcementOptions{ { Path: tfe.String(d.Get("name").(string) + ".sentinel"), diff --git a/internal/provider/resource_tfe_sentinel_policy_test.go b/internal/provider/resource_tfe_sentinel_policy_test.go index 075233967..d951e7016 100644 --- a/internal/provider/resource_tfe_sentinel_policy_test.go +++ b/internal/provider/resource_tfe_sentinel_policy_test.go @@ -147,6 +147,7 @@ func testAccCheckTFESentinelPolicyAttributes( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "hard-mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } @@ -162,6 +163,7 @@ func testAccCheckTFESentinelPolicyAttributesUpdated( return fmt.Errorf("Bad name: %s", policy.Name) } + //nolint:staticcheck // this is still used by TFE versions older than 202306-1 if policy.Enforce[0].Mode != "soft-mandatory" { return fmt.Errorf("Bad enforce mode: %s", policy.Enforce[0].Mode) } From 7d1430628347d2f62bbccb0f5b36231b160b59b6 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Wed, 8 May 2024 13:56:25 -0400 Subject: [PATCH 356/420] Disable parallelism for CI --- .github/actions/test-provider-tfe/action.yml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/nightly-tfe-test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 70ccd2bae..04567e3fe 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -112,7 +112,7 @@ runs: MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version run: | - gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -run "${{ steps.test_split.outputs.run }}" + gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -parallel=1 -run "${{ steps.test_split.outputs.run }}" - name: Upload test artifacts uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b5f4a6de..afa2d9dda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,8 @@ jobs: fail-fast: false matrix: # If you adjust these parameters, also adjust the jrm input files on the "Merge reports" step below - total: [ 5 ] - index: [ 0, 1, 2, 3, 4 ] + total: [ 1 ] + index: [ 0 ] steps: - name: Fetch Outputs id: tflocal @@ -73,7 +73,7 @@ jobs: run: npm install -g junit-report-merger - name: Merge reports - run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" + run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" - name: Upload test artifacts uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 26b3c7a26..ecc9d0285 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -25,8 +25,8 @@ jobs: strategy: fail-fast: false matrix: - total: [ 5 ] - index: [ 0, 1, 2, 3, 4 ] + total: [ 1 ] + index: [ 0 ] steps: - name: Fetch Outputs id: tflocal From eec4f41ce1162d0c7392cdf8a8c2039bb6e25fe4 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Wed, 8 May 2024 16:13:35 -0400 Subject: [PATCH 357/420] Bump go test timeout to 40m --- .github/actions/test-provider-tfe/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 04567e3fe..7c3a9bf23 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -112,7 +112,7 @@ runs: MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version run: | - gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -parallel=1 -run "${{ steps.test_split.outputs.run }}" + gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=40m -parallel=1 -run "${{ steps.test_split.outputs.run }}" - name: Upload test artifacts uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 From 3b38a4c6a9e5640b66b10d42765fa50980972425 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 9 May 2024 09:18:42 -0600 Subject: [PATCH 358/420] temporarily disable testing in CI --- .github/actions/test-provider-tfe/action.yml | 130 ++++++++++--------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 7c3a9bf23..76170836d 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: MPL-2.0 -name: Test +name: TESTS ARE TEMPOARILY DISABLED description: Tests terraform-provider-tfe within a matrix inputs: admin_configuration_token: @@ -51,72 +51,76 @@ inputs: runs: using: composite steps: - - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - with: - go-version-file: go.mod - cache: true - - - name: Sync dependencies + - name: NO-OP shell: bash run: | - go mod download - go mod tidy + echo "Tests are skipped. Please test manually." + # - name: Set up Go + # uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + # with: + # go-version-file: go.mod + # cache: true - - name: Install gotestsum - shell: bash - run: go install gotest.tools/gotestsum@latest + # - name: Sync dependencies + # shell: bash + # run: | + # go mod download + # go mod tidy - - name: Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0 - with: - workflow_conclusion: success - name: junit-test-summary - if_no_artifact_found: warn - branch: main + # - name: Install gotestsum + # shell: bash + # run: go install gotest.tools/gotestsum@latest - - name: Split acceptance tests - id: test_split - uses: hashicorp-forge/go-test-split-action@796beedbdb3d1bea14cad2d3057bab5c5cf15fe5 # v1.0.2 - with: - index: ${{ inputs.matrix_index }} - total: ${{ inputs.matrix_total }} - junit-summary: ./ci-summary-provider.xml - # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite - list: ${{ inputs.list_tests }} + # - name: Download artifact + # id: download-artifact + # uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0 + # with: + # workflow_conclusion: success + # name: junit-test-summary + # if_no_artifact_found: warn + # branch: main - - name: Run Tests - shell: bash - env: - TFE_HOSTNAME: "${{ inputs.hostname }}" - TFE_TOKEN: "${{ inputs.token }}" - TFE_ADMIN_CONFIGURATION_TOKEN: ${{ inputs.admin_configuration_token }} - TFE_ADMIN_PROVISION_LICENSES_TOKEN: ${{ inputs.admin_provision_licenses_token }} - TFE_ADMIN_SECURITY_MAINTENANCE_TOKEN: ${{ inputs.admin_security_maintenance_token }} - TFE_ADMIN_SITE_ADMIN_TOKEN: ${{ inputs.admin_site_admin_token }} - TFE_ADMIN_SUBSCRIPTION_TOKEN: ${{ inputs.admin_subscription_token }} - TFE_ADMIN_SUPPORT_TOKEN: ${{ inputs.admin_support_token }} - TFE_ADMIN_VERSION_MAINTENANCE_TOKEN: ${{ inputs.admin_version_maintenance_token }} - TFE_USER1: tfe-provider-user1 - TFE_USER2: tfe-provider-user2 - TF_ACC: "1" - ENABLE_TFE: "${{ inputs.enterprise }}" - RUN_TASKS_URL: "http://testing-mocks.tfe:22180/runtasks/pass" - GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" - GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" - GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" - GITHUB_WORKSPACE_BRANCH: "main" - GITHUB_TOKEN: "${{ inputs.testing-github-token }}" - MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe - MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider - MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version - run: | - gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=40m -parallel=1 -run "${{ steps.test_split.outputs.run }}" + # - name: Split acceptance tests + # id: test_split + # uses: hashicorp-forge/go-test-split-action@796beedbdb3d1bea14cad2d3057bab5c5cf15fe5 # v1.0.2 + # with: + # index: ${{ inputs.matrix_index }} + # total: ${{ inputs.matrix_total }} + # junit-summary: ./ci-summary-provider.xml + # # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite + # list: ${{ inputs.list_tests }} + + # - name: Run Tests + # shell: bash + # env: + # TFE_HOSTNAME: "${{ inputs.hostname }}" + # TFE_TOKEN: "${{ inputs.token }}" + # TFE_ADMIN_CONFIGURATION_TOKEN: ${{ inputs.admin_configuration_token }} + # TFE_ADMIN_PROVISION_LICENSES_TOKEN: ${{ inputs.admin_provision_licenses_token }} + # TFE_ADMIN_SECURITY_MAINTENANCE_TOKEN: ${{ inputs.admin_security_maintenance_token }} + # TFE_ADMIN_SITE_ADMIN_TOKEN: ${{ inputs.admin_site_admin_token }} + # TFE_ADMIN_SUBSCRIPTION_TOKEN: ${{ inputs.admin_subscription_token }} + # TFE_ADMIN_SUPPORT_TOKEN: ${{ inputs.admin_support_token }} + # TFE_ADMIN_VERSION_MAINTENANCE_TOKEN: ${{ inputs.admin_version_maintenance_token }} + # TFE_USER1: tfe-provider-user1 + # TFE_USER2: tfe-provider-user2 + # TF_ACC: "1" + # ENABLE_TFE: "${{ inputs.enterprise }}" + # RUN_TASKS_URL: "http://testing-mocks.tfe:22180/runtasks/pass" + # GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" + # GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" + # GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" + # GITHUB_WORKSPACE_BRANCH: "main" + # GITHUB_TOKEN: "${{ inputs.testing-github-token }}" + # MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe + # MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider + # MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version + # run: | + # gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -run "${{ steps.test_split.outputs.run }}" - - name: Upload test artifacts - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: junit-test-summary-${{ matrix.index }} - path: summary.xml - retention-days: 1 + # - name: Upload test artifacts + # uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + # with: + # name: junit-test-summary-${{ matrix.index }} + # path: summary.xml + # retention-days: 1 From 6dbf30d53b1e1a4a102f61661a7af2099ad1a6fe Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 9 May 2024 09:24:25 -0600 Subject: [PATCH 359/420] adds notice job as a separate check --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afa2d9dda..294c8fc09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,13 @@ concurrency: cancel-in-progress: true jobs: + notice: + name: TESTS ARE TEMPORARILY DISABLED- RUN CHANGED RESOURCE TESTS LOCALLY + runs-on: ubuntu-latest + steps: + - name: NO-OP + run: | + echo "Tests are skipped. Please test manually." lint: name: lint runs-on: ubuntu-latest From 03138451f28c89d90c918935b98ccf7394e75e83 Mon Sep 17 00:00:00 2001 From: Julianna Tetreault Date: Wed, 17 Apr 2024 08:30:16 -0500 Subject: [PATCH 360/420] Add manage permissions to team org access --- CHANGELOG.md | 1 + internal/provider/resource_tfe_team.go | 90 +++++++++++++-------- internal/provider/resource_tfe_team_test.go | 49 +++++++++++ website/docs/r/team.html.markdown | 3 + 4 files changed, 110 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b831d24..ae76b5c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ FEATURES: * `d/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) * **New Resource**: `r/tfe_test_variable` is a new resource for creating environment variables used by registry modules for terraform test, by @aaabdelgany [1285](https://github.com/hashicorp/terraform-provider-tfe/pull/1285) +* `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) BUG FIXES: * `r/tfe_organization_default_settings`: Fix import resource address documentation by @Uk1288 [#1324](https://github.com/hashicorp/terraform-provider-tfe/pull/1324) diff --git a/internal/provider/resource_tfe_team.go b/internal/provider/resource_tfe_team.go index e85916563..e871d07e7 100644 --- a/internal/provider/resource_tfe_team.go +++ b/internal/provider/resource_tfe_team.go @@ -105,6 +105,21 @@ func resourceTFETeam() *schema.Resource { Optional: true, Default: false, }, + "manage_teams": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "manage_organization_access": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "access_secret_teams": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -144,17 +159,20 @@ func resourceTFETeamCreate(d *schema.ResourceData, meta interface{}) error { organizationAccess := v.([]interface{})[0].(map[string]interface{}) options.OrganizationAccess = &tfe.OrganizationAccessOptions{ - ManagePolicies: tfe.Bool(organizationAccess["manage_policies"].(bool)), - ManagePolicyOverrides: tfe.Bool(organizationAccess["manage_policy_overrides"].(bool)), - ManageWorkspaces: tfe.Bool(organizationAccess["manage_workspaces"].(bool)), - ManageVCSSettings: tfe.Bool(organizationAccess["manage_vcs_settings"].(bool)), - ManageProviders: tfe.Bool(organizationAccess["manage_providers"].(bool)), - ManageModules: tfe.Bool(organizationAccess["manage_modules"].(bool)), - ManageRunTasks: tfe.Bool(organizationAccess["manage_run_tasks"].(bool)), - ManageProjects: tfe.Bool(organizationAccess["manage_projects"].(bool)), - ReadWorkspaces: tfe.Bool(organizationAccess["read_workspaces"].(bool)), - ReadProjects: tfe.Bool(organizationAccess["read_projects"].(bool)), - ManageMembership: tfe.Bool(organizationAccess["manage_membership"].(bool)), + ManagePolicies: tfe.Bool(organizationAccess["manage_policies"].(bool)), + ManagePolicyOverrides: tfe.Bool(organizationAccess["manage_policy_overrides"].(bool)), + ManageWorkspaces: tfe.Bool(organizationAccess["manage_workspaces"].(bool)), + ManageVCSSettings: tfe.Bool(organizationAccess["manage_vcs_settings"].(bool)), + ManageProviders: tfe.Bool(organizationAccess["manage_providers"].(bool)), + ManageModules: tfe.Bool(organizationAccess["manage_modules"].(bool)), + ManageRunTasks: tfe.Bool(organizationAccess["manage_run_tasks"].(bool)), + ManageProjects: tfe.Bool(organizationAccess["manage_projects"].(bool)), + ReadWorkspaces: tfe.Bool(organizationAccess["read_workspaces"].(bool)), + ReadProjects: tfe.Bool(organizationAccess["read_projects"].(bool)), + ManageMembership: tfe.Bool(organizationAccess["manage_membership"].(bool)), + ManageTeams: tfe.Bool(organizationAccess["manage_teams"].(bool)), + ManageOrganizationAccess: tfe.Bool(organizationAccess["manage_organization_access"].(bool)), + AccessSecretTeams: tfe.Bool(organizationAccess["access_secret_teams"].(bool)), } } @@ -204,17 +222,20 @@ func resourceTFETeamRead(d *schema.ResourceData, meta interface{}) error { d.Set("name", team.Name) if team.OrganizationAccess != nil { organizationAccess := []map[string]bool{{ - "manage_policies": team.OrganizationAccess.ManagePolicies, - "manage_policy_overrides": team.OrganizationAccess.ManagePolicyOverrides, - "manage_workspaces": team.OrganizationAccess.ManageWorkspaces, - "manage_vcs_settings": team.OrganizationAccess.ManageVCSSettings, - "manage_providers": team.OrganizationAccess.ManageProviders, - "manage_modules": team.OrganizationAccess.ManageModules, - "manage_run_tasks": team.OrganizationAccess.ManageRunTasks, - "manage_projects": team.OrganizationAccess.ManageProjects, - "read_projects": team.OrganizationAccess.ReadProjects, - "read_workspaces": team.OrganizationAccess.ReadWorkspaces, - "manage_membership": team.OrganizationAccess.ManageMembership, + "manage_policies": team.OrganizationAccess.ManagePolicies, + "manage_policy_overrides": team.OrganizationAccess.ManagePolicyOverrides, + "manage_workspaces": team.OrganizationAccess.ManageWorkspaces, + "manage_vcs_settings": team.OrganizationAccess.ManageVCSSettings, + "manage_providers": team.OrganizationAccess.ManageProviders, + "manage_modules": team.OrganizationAccess.ManageModules, + "manage_run_tasks": team.OrganizationAccess.ManageRunTasks, + "manage_projects": team.OrganizationAccess.ManageProjects, + "read_projects": team.OrganizationAccess.ReadProjects, + "read_workspaces": team.OrganizationAccess.ReadWorkspaces, + "manage_membership": team.OrganizationAccess.ManageMembership, + "manage_teams": team.OrganizationAccess.ManageTeams, + "manage_organization_access": team.OrganizationAccess.ManageOrganizationAccess, + "access_secret_teams": team.OrganizationAccess.AccessSecretTeams, }} if err := d.Set("organization_access", organizationAccess); err != nil { return fmt.Errorf("error setting organization access for team %s: %w", d.Id(), err) @@ -241,17 +262,20 @@ func resourceTFETeamUpdate(d *schema.ResourceData, meta interface{}) error { organizationAccess := v.([]interface{})[0].(map[string]interface{}) options.OrganizationAccess = &tfe.OrganizationAccessOptions{ - ManagePolicies: tfe.Bool(organizationAccess["manage_policies"].(bool)), - ManagePolicyOverrides: tfe.Bool(organizationAccess["manage_policy_overrides"].(bool)), - ManageWorkspaces: tfe.Bool(organizationAccess["manage_workspaces"].(bool)), - ManageVCSSettings: tfe.Bool(organizationAccess["manage_vcs_settings"].(bool)), - ManageProviders: tfe.Bool(organizationAccess["manage_providers"].(bool)), - ManageModules: tfe.Bool(organizationAccess["manage_modules"].(bool)), - ManageRunTasks: tfe.Bool(organizationAccess["manage_run_tasks"].(bool)), - ManageProjects: tfe.Bool(organizationAccess["manage_projects"].(bool)), - ReadProjects: tfe.Bool(organizationAccess["read_projects"].(bool)), - ReadWorkspaces: tfe.Bool(organizationAccess["read_workspaces"].(bool)), - ManageMembership: tfe.Bool(organizationAccess["manage_membership"].(bool)), + ManagePolicies: tfe.Bool(organizationAccess["manage_policies"].(bool)), + ManagePolicyOverrides: tfe.Bool(organizationAccess["manage_policy_overrides"].(bool)), + ManageWorkspaces: tfe.Bool(organizationAccess["manage_workspaces"].(bool)), + ManageVCSSettings: tfe.Bool(organizationAccess["manage_vcs_settings"].(bool)), + ManageProviders: tfe.Bool(organizationAccess["manage_providers"].(bool)), + ManageModules: tfe.Bool(organizationAccess["manage_modules"].(bool)), + ManageRunTasks: tfe.Bool(organizationAccess["manage_run_tasks"].(bool)), + ManageProjects: tfe.Bool(organizationAccess["manage_projects"].(bool)), + ReadProjects: tfe.Bool(organizationAccess["read_projects"].(bool)), + ReadWorkspaces: tfe.Bool(organizationAccess["read_workspaces"].(bool)), + ManageMembership: tfe.Bool(organizationAccess["manage_membership"].(bool)), + ManageTeams: tfe.Bool(organizationAccess["manage_teams"].(bool)), + ManageOrganizationAccess: tfe.Bool(organizationAccess["manage_organization_access"].(bool)), + AccessSecretTeams: tfe.Bool(organizationAccess["access_secret_teams"].(bool)), } } diff --git a/internal/provider/resource_tfe_team_test.go b/internal/provider/resource_tfe_team_test.go index d90be75a5..22f79c60d 100644 --- a/internal/provider/resource_tfe_team_test.go +++ b/internal/provider/resource_tfe_team_test.go @@ -79,6 +79,12 @@ func TestAccTFETeam_full(t *testing.T) { "tfe_team.foobar", "organization_access.0.read_workspaces", "true"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.manage_membership", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_teams", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_organization_access", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.access_secret_teams", "true"), ), }, }, @@ -126,6 +132,12 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "organization_access.0.read_workspaces", "true"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.manage_membership", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_teams", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_organization_access", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.access_secret_teams", "true"), ), }, { @@ -160,6 +172,12 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "sso_team_id", "changed-sso-id"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.manage_membership", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_teams", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_organization_access", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.access_secret_teams", "false"), ), }, { @@ -195,6 +213,12 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "sso_team_id", ""), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.manage_membership", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_teams", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_organization_access", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.access_secret_teams", "false"), ), }, }, @@ -447,6 +471,16 @@ func testAccCheckTFETeamAttributes_full( if !team.OrganizationAccess.ManageMembership { return fmt.Errorf("OrganizationAccess.ManageMembership should be true") } + if !team.OrganizationAccess.ManageTeams { + return fmt.Errorf("OrganizationAccess.ManageTeams should be true") + } + if !team.OrganizationAccess.ManageOrganizationAccess { + return fmt.Errorf("OrganizationAccess.ManageOrganizationAccess should be true") + } + if !team.OrganizationAccess.AccessSecretTeams { + return fmt.Errorf("OrganizationAccess.AccessSecretTeams should be true") + } + if team.SSOTeamID != "team-test-sso-id" { return fmt.Errorf("Bad SSO Team ID: %s", team.SSOTeamID) } @@ -484,6 +518,15 @@ func testAccCheckTFETeamAttributes_full_update( if team.OrganizationAccess.ManageMembership { return fmt.Errorf("OrganizationAccess.ManageMembership should be false") } + if team.OrganizationAccess.ManageTeams { + return fmt.Errorf("OrganizationAccess.ManageTeams should be false") + } + if team.OrganizationAccess.ManageOrganizationAccess { + return fmt.Errorf("OrganizationAccess.ManageOrganizationAccess should be false") + } + if team.OrganizationAccess.AccessSecretTeams { + return fmt.Errorf("OrganizationAccess.AccessSecretTeams should be false") + } if team.SSOTeamID != "changed-sso-id" { return fmt.Errorf("Bad SSO Team ID: %s", team.SSOTeamID) @@ -552,6 +595,9 @@ resource "tfe_team" "foobar" { read_workspaces = true read_projects = true manage_membership = true + manage_teams = true + manage_organization_access = true + access_secret_teams = true } sso_team_id = "team-test-sso-id" }`, rInt) @@ -582,6 +628,9 @@ resource "tfe_team" "foobar" { read_projects = false read_workspaces = false manage_membership = false + manage_teams = false + manage_organization_access = false + access_secret_teams = false } sso_team_id = "changed-sso-id" diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown index 6886b2b9d..4a2e76d49 100644 --- a/website/docs/r/team.html.markdown +++ b/website/docs/r/team.html.markdown @@ -55,6 +55,9 @@ The `organization_access` block supports: * `manage_run_tasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `manage_projects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manage_workspaces` to be set to `true`. * `manage_membership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `manage_teams` - (Optional) Allow members to create, update, and delete teams. +* `manage_organization_access` - (Optional) Allow members to update the organization access settings of teams. +* `access_secret_teams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference From a4207a0f2de26d7897ac951aae5cb945f5823043 Mon Sep 17 00:00:00 2001 From: Julianna Tetreault Date: Wed, 8 May 2024 08:19:51 -0500 Subject: [PATCH 361/420] Updates go-tfe version --- go.mod | 6 +++--- go.sum | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6caaa17d8..fd16a454f 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.15.0 - github.com/hashicorp/go-tfe v1.51.0 + github.com/hashicorp/go-tfe v1.53.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect @@ -28,7 +28,7 @@ require ( golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.33.0 // indirect @@ -76,7 +76,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/sync v0.6.0 // indirect + golang.org/x/sync v0.7.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index bc65260ce..2a22c87d0 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMm github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= github.com/hashicorp/go-tfe v1.51.0 h1:nZIIMOGxzKJvL6fNO3wS/wpTdLVGHUMT6up82H9eJCE= github.com/hashicorp/go-tfe v1.51.0/go.mod h1:yZ/FCqBsOZ/e75kL29JYqAsKctL1Tti2zYcIoQh69Ck= +github.com/hashicorp/go-tfe v1.53.0 h1:FlmR+45MB9rTosra2ZGPp0XtdxiRTmdTAJAgX94WK9k= +github.com/hashicorp/go-tfe v1.53.0/go.mod h1:XnTtBj3tVQ4uFkcFsv8Grn+O1CVcIcceL1uc2AgUcaU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -194,6 +196,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -211,6 +215,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 9bf93004e665a4d766dff6e3d0c475ce8bd78746 Mon Sep 17 00:00:00 2001 From: Jarrett Spiker Date: Wed, 8 May 2024 12:43:27 -0400 Subject: [PATCH 362/420] Switch to go uber mock to be compatible with go-tfe 1.53.0 --- go.mod | 2 +- go.sum | 21 ++----------------- .../organization_members_helpers_test.go | 2 +- internal/provider/run_task_helpers_test.go | 2 +- .../provider/workspace_run_helpers_test.go | 2 +- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index fd16a454f..77e20ccf1 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,6 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -62,6 +61,7 @@ require ( require ( github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/stretchr/testify v1.9.0 + go.uber.org/mock v0.4.0 ) require ( diff --git a/go.sum b/go.sum index 2a22c87d0..2e04030ca 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,6 @@ github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -69,8 +67,6 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMmZhI= github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.51.0 h1:nZIIMOGxzKJvL6fNO3wS/wpTdLVGHUMT6up82H9eJCE= -github.com/hashicorp/go-tfe v1.51.0/go.mod h1:yZ/FCqBsOZ/e75kL29JYqAsKctL1Tti2zYcIoQh69Ck= github.com/hashicorp/go-tfe v1.53.0 h1:FlmR+45MB9rTosra2ZGPp0XtdxiRTmdTAJAgX94WK9k= github.com/hashicorp/go-tfe v1.53.0/go.mod h1:XnTtBj3tVQ4uFkcFsv8Grn+O1CVcIcceL1uc2AgUcaU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -168,23 +164,21 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= @@ -192,19 +186,13 @@ golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -213,8 +201,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -230,14 +216,11 @@ golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= diff --git a/internal/provider/organization_members_helpers_test.go b/internal/provider/organization_members_helpers_test.go index 839c19361..e01fb699f 100644 --- a/internal/provider/organization_members_helpers_test.go +++ b/internal/provider/organization_members_helpers_test.go @@ -6,9 +6,9 @@ package provider import ( "testing" - "github.com/golang/mock/gomock" tfe "github.com/hashicorp/go-tfe" tfemocks "github.com/hashicorp/go-tfe/mocks" + "go.uber.org/mock/gomock" ) func MockOrganizationMemberships(t *testing.T, client *tfe.Client, orgName string, organizationMemberships []*tfe.OrganizationMembership) { diff --git a/internal/provider/run_task_helpers_test.go b/internal/provider/run_task_helpers_test.go index de7781d87..464e35795 100644 --- a/internal/provider/run_task_helpers_test.go +++ b/internal/provider/run_task_helpers_test.go @@ -7,9 +7,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" "github.com/hashicorp/go-tfe" tfemocks "github.com/hashicorp/go-tfe/mocks" + "go.uber.org/mock/gomock" ) func MockASingleOrgRunTask(t *testing.T, client *tfe.Client, task tfe.RunTask) { diff --git a/internal/provider/workspace_run_helpers_test.go b/internal/provider/workspace_run_helpers_test.go index dbdd8e98f..5574251fa 100644 --- a/internal/provider/workspace_run_helpers_test.go +++ b/internal/provider/workspace_run_helpers_test.go @@ -6,9 +6,9 @@ package provider import ( "testing" - "github.com/golang/mock/gomock" tfe "github.com/hashicorp/go-tfe" tfemocks "github.com/hashicorp/go-tfe/mocks" + "go.uber.org/mock/gomock" ) func MockRunsListForWorkspaceQueue(t *testing.T, client *tfe.Client, workspaceIDWithExpectedRun string, workspaceIDWithUnexpectedRun string) { From 78b1e3564f802611e774a5677a4d28ba651ddb8a Mon Sep 17 00:00:00 2001 From: Julianna Tetreault Date: Thu, 9 May 2024 11:07:21 -0500 Subject: [PATCH 363/420] Updates the changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae76b5c4f..9e3f06793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -## UNRELEASED +## v0.55.0 +FEATURES: +* `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) ## v0.54.0 @@ -11,7 +13,6 @@ FEATURES: * `d/tfe_oauth_client`: Add `organization_scoped` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) * **New Resource**: `r/tfe_project_oauth_client` attaches/detaches an existing `project` to an existing `oauth client`, by @Netra2104 [1144](https://github.com/hashicorp/terraform-provider-tfe/pull/1144) * **New Resource**: `r/tfe_test_variable` is a new resource for creating environment variables used by registry modules for terraform test, by @aaabdelgany [1285](https://github.com/hashicorp/terraform-provider-tfe/pull/1285) -* `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) BUG FIXES: * `r/tfe_organization_default_settings`: Fix import resource address documentation by @Uk1288 [#1324](https://github.com/hashicorp/terraform-provider-tfe/pull/1324) From 155ebe19cfd5b5c6c923d3896b54b2433aaa11e2 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 9 May 2024 11:06:34 -0600 Subject: [PATCH 364/420] Prep 0.55.0 for release --- CHANGELOG.md | 1 + README.md | 2 +- website/docs/cdktf/csharp/index.html.markdown | 6 +++--- website/docs/cdktf/go/index.html.markdown | 6 +++--- website/docs/cdktf/java/index.html.markdown | 6 +++--- website/docs/cdktf/python/index.html.markdown | 6 +++--- website/docs/cdktf/typescript/index.html.markdown | 4 ++-- website/docs/index.html.markdown | 2 +- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e3f06793..bc73d7ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## v0.55.0 + FEATURES: * `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) diff --git a/README.md b/README.md index de048ce59..dd66eaa1e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index d9f3e9b69..070fd2e93 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.54.0" + version = "~> 0.55.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.54.0" + version = "~> 0.55.0" } # Create an organization diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index d9f3e9b69..070fd2e93 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.54.0" + version = "~> 0.55.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.54.0" + version = "~> 0.55.0" } # Create an organization diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index 5f6c5117d..9b5606874 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.54.0" + version = "~> 0.55.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `appTerraformIo` token = var.token - version = "~> 0.54.0" + version = "~> 0.55.0" } # Create an organization diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index 4fb4ecf50..fa8b69331 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } @@ -90,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.54.0" + version = "~> 0.55.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` token = var.token - version = "~> 0.54.0" + version = "~> 0.55.0" } # Create an organization diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 427420b16..151cc7d81 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -90,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.54.0" + version = "~> 0.55.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` token = var.token - version = "~> 0.54.0" + version = "~> 0.55.0" } # Create an organization diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 4b6933127..282c4cbb5 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.54.0" + version = "~> 0.55.0" } } } From e10907570727f9bbf923f1eb6b69849cfc714c0f Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 May 2024 18:12:15 -0400 Subject: [PATCH 365/420] Dont skip TFE tests on org upgrade --- internal/provider/helper_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index 56a46e4f0..d8bd7a609 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -52,6 +52,10 @@ func testTfeClient(t *testing.T, options testClientOptions) *tfe.Client { // Attempts to upgrade an organization to the business plan. Requires a user token with admin access. // DEPRECATED : Please use the newSubscriptionUpdater instead. func upgradeOrganizationSubscription(t *testing.T, _ *tfe.Client, organization *tfe.Organization) { + if enterpriseEnabled() { + return + } + newSubscriptionUpdater(organization).WithBusinessPlan().Update(t) } @@ -61,7 +65,9 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), }) - newSubscriptionUpdater(org).WithBusinessPlan().Update(t) + if !enterpriseEnabled() { + newSubscriptionUpdater(org).WithBusinessPlan().Update(t) + } return org, orgCleanup } From a18e0226466d1a48c3bf4eeeed48b96dc5abe184 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 May 2024 18:20:03 -0400 Subject: [PATCH 366/420] Re-enable test concurrency --- .github/actions/test-provider-tfe/action.yml | 128 +++++++++---------- .github/workflows/ci.yml | 4 +- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 76170836d..f79de2cd2 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -51,76 +51,72 @@ inputs: runs: using: composite steps: - - name: NO-OP + - name: Set up Go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + with: + go-version-file: go.mod + cache: true + + - name: Sync dependencies shell: bash run: | - echo "Tests are skipped. Please test manually." - # - name: Set up Go - # uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 - # with: - # go-version-file: go.mod - # cache: true - - # - name: Sync dependencies - # shell: bash - # run: | - # go mod download - # go mod tidy + go mod download + go mod tidy - # - name: Install gotestsum - # shell: bash - # run: go install gotest.tools/gotestsum@latest + - name: Install gotestsum + shell: bash + run: go install gotest.tools/gotestsum@latest - # - name: Download artifact - # id: download-artifact - # uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0 - # with: - # workflow_conclusion: success - # name: junit-test-summary - # if_no_artifact_found: warn - # branch: main + - name: Download artifact + id: download-artifact + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0 + with: + workflow_conclusion: success + name: junit-test-summary + if_no_artifact_found: warn + branch: main - # - name: Split acceptance tests - # id: test_split - # uses: hashicorp-forge/go-test-split-action@796beedbdb3d1bea14cad2d3057bab5c5cf15fe5 # v1.0.2 - # with: - # index: ${{ inputs.matrix_index }} - # total: ${{ inputs.matrix_total }} - # junit-summary: ./ci-summary-provider.xml - # # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite - # list: ${{ inputs.list_tests }} + - name: Split acceptance tests + id: test_split + uses: hashicorp-forge/go-test-split-action@796beedbdb3d1bea14cad2d3057bab5c5cf15fe5 # v1.0.2 + with: + index: ${{ inputs.matrix_index }} + total: ${{ inputs.matrix_total }} + junit-summary: ./ci-summary-provider.xml + # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite + list: ${{ inputs.list_tests }} - # - name: Run Tests - # shell: bash - # env: - # TFE_HOSTNAME: "${{ inputs.hostname }}" - # TFE_TOKEN: "${{ inputs.token }}" - # TFE_ADMIN_CONFIGURATION_TOKEN: ${{ inputs.admin_configuration_token }} - # TFE_ADMIN_PROVISION_LICENSES_TOKEN: ${{ inputs.admin_provision_licenses_token }} - # TFE_ADMIN_SECURITY_MAINTENANCE_TOKEN: ${{ inputs.admin_security_maintenance_token }} - # TFE_ADMIN_SITE_ADMIN_TOKEN: ${{ inputs.admin_site_admin_token }} - # TFE_ADMIN_SUBSCRIPTION_TOKEN: ${{ inputs.admin_subscription_token }} - # TFE_ADMIN_SUPPORT_TOKEN: ${{ inputs.admin_support_token }} - # TFE_ADMIN_VERSION_MAINTENANCE_TOKEN: ${{ inputs.admin_version_maintenance_token }} - # TFE_USER1: tfe-provider-user1 - # TFE_USER2: tfe-provider-user2 - # TF_ACC: "1" - # ENABLE_TFE: "${{ inputs.enterprise }}" - # RUN_TASKS_URL: "http://testing-mocks.tfe:22180/runtasks/pass" - # GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" - # GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" - # GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" - # GITHUB_WORKSPACE_BRANCH: "main" - # GITHUB_TOKEN: "${{ inputs.testing-github-token }}" - # MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe - # MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider - # MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version - # run: | - # gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -run "${{ steps.test_split.outputs.run }}" + - name: Run Tests + shell: bash + env: + TFE_HOSTNAME: "${{ inputs.hostname }}" + TFE_TOKEN: "${{ inputs.token }}" + TFE_ADMIN_CONFIGURATION_TOKEN: ${{ inputs.admin_configuration_token }} + TFE_ADMIN_PROVISION_LICENSES_TOKEN: ${{ inputs.admin_provision_licenses_token }} + TFE_ADMIN_SECURITY_MAINTENANCE_TOKEN: ${{ inputs.admin_security_maintenance_token }} + TFE_ADMIN_SITE_ADMIN_TOKEN: ${{ inputs.admin_site_admin_token }} + TFE_ADMIN_SUBSCRIPTION_TOKEN: ${{ inputs.admin_subscription_token }} + TFE_ADMIN_SUPPORT_TOKEN: ${{ inputs.admin_support_token }} + TFE_ADMIN_VERSION_MAINTENANCE_TOKEN: ${{ inputs.admin_version_maintenance_token }} + TFE_USER1: tfe-provider-user1 + TFE_USER2: tfe-provider-user2 + TF_ACC: "1" + ENABLE_TFE: "${{ inputs.enterprise }}" + RUN_TASKS_URL: "http://testing-mocks.tfe:22180/runtasks/pass" + GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" + GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" + GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-module" + GITHUB_WORKSPACE_BRANCH: "main" + GITHUB_TOKEN: "${{ inputs.testing-github-token }}" + MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe + MOD_TFE: github.com/hashicorp/terraform-provider-tfe/internal/provider + MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version + run: | + gotestsum --junitfile summary.xml --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -v -timeout=30m -run "${{ steps.test_split.outputs.run }}" - # - name: Upload test artifacts - # uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - # with: - # name: junit-test-summary-${{ matrix.index }} - # path: summary.xml - # retention-days: 1 + - name: Upload test artifacts + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: junit-test-summary-${{ matrix.index }} + path: summary.xml + retention-days: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 294c8fc09..19a71cdb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,8 @@ jobs: fail-fast: false matrix: # If you adjust these parameters, also adjust the jrm input files on the "Merge reports" step below - total: [ 1 ] - index: [ 0 ] + total: [ 5 ] + index: [ 0, 1, 2, 3, 4 ] steps: - name: Fetch Outputs id: tflocal From 96b1b2fcd815c97c1c402320c75883bceb92c5e0 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 9 May 2024 18:21:21 -0400 Subject: [PATCH 367/420] Enable enterprise for regular CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19a71cdb8..e402e6a38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }} admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }} admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }} + enterprise: "1" # Run terminal cmd 'go help testflag' to learn more about -list flag # action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests # which runs against all tests using the list arg From f3977d18365fafa85a9503f4526d81c447fe9a00 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Fri, 10 May 2024 12:51:46 -0400 Subject: [PATCH 368/420] Temporarily skip VCS related tests --- internal/provider/helper_test.go | 12 ++++++++++++ internal/provider/provider_test.go | 2 ++ 2 files changed, 14 insertions(+) diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index d8bd7a609..e2daee63c 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -206,6 +206,18 @@ func skipUnlessBeta(t *testing.T) { } } +// Temporarily skip a test that may be experiencing API errors. This method +// purposefully errors after the set date to remind contributors to remove this check +// and verify that the API errors are no longer occurring. +func skipUnlessAfterDate(t *testing.T, d time.Time) { + today := time.Now() + if today.After(d) { + t.Fatalf("This test was temporarily skipped and has now expired. Remove this check to run this test.") + } else { + t.Skipf("Temporarily skipping test due to external issues: %s", t.Name()) + } +} + func enterpriseEnabled() bool { return os.Getenv("ENABLE_TFE") == "1" } diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index d758d37e2..1e1cc0f29 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -213,6 +213,8 @@ func TestConfigureEnvOrganization(t *testing.T) { // The TFE Provider tests use these environment variables, which are set in the // GitHub Action workflow file .github/workflows/ci.yml. func testAccGithubPreCheck(t *testing.T) { + skipUnlessAfterDate(t, time.Date(2024, 5, 24, 0, 0, 0, 0, time.UTC)) + if envGithubToken == "" { t.Skip("Please set GITHUB_TOKEN to run this test") } From 355a477949a905f51df04e3cf015d22787ad76a0 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Fri, 10 May 2024 14:26:27 -0400 Subject: [PATCH 369/420] Temporarily skip registry tests due to token --- .../provider/resource_tfe_registry_module_test.go | 2 ++ internal/provider/resource_tfe_test_variable_test.go | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index 0a0d02515..a3196e001 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -942,6 +942,8 @@ func testAccCheckTFERegistryModuleDestroy(s *terraform.State) error { } func testAccPreCheckTFERegistryModule(t *testing.T) { + skipUnlessAfterDate(t, time.Date(2024, 5, 24, 0, 0, 0, 0, time.UTC)) + if envGithubToken == "" { t.Skip("Please set GITHUB_TOKEN to run this test") } diff --git a/internal/provider/resource_tfe_test_variable_test.go b/internal/provider/resource_tfe_test_variable_test.go index e66478cee..ecf5e4395 100644 --- a/internal/provider/resource_tfe_test_variable_test.go +++ b/internal/provider/resource_tfe_test_variable_test.go @@ -19,7 +19,10 @@ func TestAccTFETestVariable_basic(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccGithubPreCheck(t) + }, ProtoV5ProviderFactories: testAccMuxedProviders, CheckDestroy: testAccCheckTFETestVariableDestroy, Steps: []resource.TestStep{ @@ -52,7 +55,10 @@ func TestAccTFETestVariable_update(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccGithubPreCheck(t) + }, ProtoV5ProviderFactories: testAccMuxedProviders, CheckDestroy: testAccCheckTFETestVariableDestroy, Steps: []resource.TestStep{ @@ -199,7 +205,7 @@ resource "tfe_organization" "foobar" { name = "tst-terraform-%d" email = "admin@company.com" } - + resource "tfe_oauth_client" "foobar" { organization = tfe_organization.foobar.name api_url = "https://api.github.com" From 31e33a45845d73101cf139b8cbe9ccf41402f6d2 Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Fri, 10 May 2024 15:32:10 -0400 Subject: [PATCH 370/420] Remove test notice --- .github/actions/test-provider-tfe/action.yml | 2 +- .github/workflows/ci.yml | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index f79de2cd2..70ccd2bae 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: MPL-2.0 -name: TESTS ARE TEMPOARILY DISABLED +name: Test description: Tests terraform-provider-tfe within a matrix inputs: admin_configuration_token: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e402e6a38..37afd479e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,6 @@ concurrency: cancel-in-progress: true jobs: - notice: - name: TESTS ARE TEMPORARILY DISABLED- RUN CHANGED RESOURCE TESTS LOCALLY - runs-on: ubuntu-latest - steps: - - name: NO-OP - run: | - echo "Tests are skipped. Please test manually." lint: name: lint runs-on: ubuntu-latest From 4d43a5f9f84c6797f415eee167670dd2a1ac0e4f Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 16:12:46 +0000 Subject: [PATCH 371/420] [COMPLIANCE] Add Copyright and License Headers --- META.d/_summary.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/META.d/_summary.yaml b/META.d/_summary.yaml index 4bdec6a9d..63e8ef1ba 100644 --- a/META.d/_summary.yaml +++ b/META.d/_summary.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + --- schema: 1.1 From 04983f91f152ad2cbaf3176205c39324fe4b1270 Mon Sep 17 00:00:00 2001 From: Zain Hasan Date: Tue, 14 May 2024 06:42:54 -0700 Subject: [PATCH 372/420] update change log --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0bb2db9..ac7b31c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## Unreleased + +ENHANCEMENTS: +* `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) + ## v0.55.0 FEATURES: @@ -8,7 +13,6 @@ FEATURES: ENHANCEMENTS: * Rebrand Terraform Cloud to HCP Terraform by @sebasslash [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1328) * Adds `post_apply` to list of possible `stages` for Run Tasks by @carolinaborim [#1307](https://github.com/hashicorp/terraform-provider-tfe/pull/1307) -* `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) FEATURES: * `d/tfe_oauth_client`: Add `project_ids` attribute, by @Netra2104 [1148](https://github.com/hashicorp/terraform-provider-tfe/pull/1148) From f090e7278874ab04ab2aabfef49567d4d5d2c236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 14:02:41 +0000 Subject: [PATCH 373/420] Build(deps): Bump actions/checkout from 4.1.4 to 4.1.6 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/0ad4b8fadaa221de15dcec353f45205ec38ea70b...a5ac7e51b41094c92402da3b24376905380afc29) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 294c8fc09..38c84a302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: ./.github/actions/lint-provider-tfe tests: @@ -42,7 +42,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index e4e9a36fa..510d30ce1 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 3cca9f677..2565ca1e4 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index ecc9d0285..1c46a5d0f 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 398c6a6ab..8df9b1df6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - name: Generate Release Notes From 3fc4603baca73af57b8c6dabf62210e205d19725 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Fri, 17 May 2024 16:59:58 -0600 Subject: [PATCH 374/420] Update resource_tfe_workspace_run_test.go --- internal/provider/resource_tfe_workspace_run_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resource_tfe_workspace_run_test.go b/internal/provider/resource_tfe_workspace_run_test.go index c076987cd..251e6da2e 100644 --- a/internal/provider/resource_tfe_workspace_run_test.go +++ b/internal/provider/resource_tfe_workspace_run_test.go @@ -260,7 +260,6 @@ func testAccCheckTFEWorkspaceRunDestroy(workspaceID string, expectedDestroyCount runList, err := config.Client.Runs.List(ctx, workspaceID, &tfe.RunListOptions{ Operation: "destroy", - Status: string(tfe.RunApplied), }) if err != nil { return fmt.Errorf("Unable to find destroy run, %w", err) From e49069cb4bb0c22e3cf3bb6bf5c7121568b35569 Mon Sep 17 00:00:00 2001 From: Harkanwal Gill Date: Wed, 8 May 2024 12:26:05 -0400 Subject: [PATCH 375/420] Updated project name limit from 36 to 40 characters --- internal/provider/resource_tfe_project.go | 2 +- internal/provider/resource_tfe_project_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_project.go b/internal/provider/resource_tfe_project.go index 5bc155c8d..a7b1b6abe 100644 --- a/internal/provider/resource_tfe_project.go +++ b/internal/provider/resource_tfe_project.go @@ -40,7 +40,7 @@ func resourceTFEProject() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.All( - validation.StringLenBetween(3, 36), + validation.StringLenBetween(3, 40), validation.StringMatch(regexp.MustCompile(`\A[\w\-][\w\- ]+[\w\-]\z`), "can only include letters, numbers, spaces, -, and _."), ), diff --git a/internal/provider/resource_tfe_project_test.go b/internal/provider/resource_tfe_project_test.go index e77f03ea7..a2070d885 100644 --- a/internal/provider/resource_tfe_project_test.go +++ b/internal/provider/resource_tfe_project_test.go @@ -57,7 +57,7 @@ func TestAccTFEProject_invalidName(t *testing.T) { }, { Config: testAccTFEProject_invalidNameLen(rInt), - ExpectError: regexp.MustCompile(`expected length of name to be in the range \(3 - 36\),`), + ExpectError: regexp.MustCompile(`expected length of name to be in the range \(3 - 40\),`), }, }, }) From b5d0aff05b75c640dd6ce0f89b7f11ad78e22262 Mon Sep 17 00:00:00 2001 From: Harkanwal Gill Date: Wed, 8 May 2024 12:39:33 -0400 Subject: [PATCH 376/420] updated the changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7b31c29..f63a35b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ ENHANCEMENTS: FEATURES: * `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) +ENHANCEMENTS: +* `r/tfe_project`: Increase the Project name length from 36 to 40 characters @hs26gill [#1351](https://github.com/hashicorp/terraform-provider-tfe/pull/1351) + ## v0.54.0 ENHANCEMENTS: From 12867f6cb4efcf51849b85e34e5190a5183049a5 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 21 May 2024 14:49:58 -0600 Subject: [PATCH 377/420] Retry check destroy result workspace_run --- .../resource_tfe_workspace_run_test.go | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/provider/resource_tfe_workspace_run_test.go b/internal/provider/resource_tfe_workspace_run_test.go index 251e6da2e..c4a5f7e72 100644 --- a/internal/provider/resource_tfe_workspace_run_test.go +++ b/internal/provider/resource_tfe_workspace_run_test.go @@ -258,18 +258,22 @@ func testAccCheckTFEWorkspaceRunDestroy(workspaceID string, expectedDestroyCount return func(s *terraform.State) error { config := testAccProvider.Meta().(ConfiguredClient) - runList, err := config.Client.Runs.List(ctx, workspaceID, &tfe.RunListOptions{ - Operation: "destroy", + _, err := retryFn(10, 1, func() (interface{}, error) { + runList, err := config.Client.Runs.List(ctx, workspaceID, &tfe.RunListOptions{ + Operation: "destroy", + }) + if err != nil { + return nil, fmt.Errorf("Unable to find destroy run, %w", err) + } + + if len(runList.Items) != expectedDestroyCount { + return nil, fmt.Errorf("Expected %d destroy runs but found %d", expectedDestroyCount, len(runList.Items)) + } + + return nil, nil }) - if err != nil { - return fmt.Errorf("Unable to find destroy run, %w", err) - } - if len(runList.Items) != expectedDestroyCount { - return fmt.Errorf("Expected %d destroy runs but found %d", expectedDestroyCount, len(runList.Items)) - } - - return nil + return err } } From 83505d71c5460a9f60ae797f061ccee7618efeb7 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 21 May 2024 15:02:07 -0600 Subject: [PATCH 378/420] linter fix --- internal/provider/helper_test.go | 4 ++-- internal/provider/resource_tfe_workspace_run_test.go | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index e2daee63c..fab46cc78 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -273,9 +273,9 @@ func randomString(t *testing.T) string { return v } -type retryableFn func() (interface{}, error) +type retryableFn func() (any, error) -func retryFn(maxRetries, secondsBetween int, f retryableFn) (interface{}, error) { +func retryFn(maxRetries, secondsBetween int, f retryableFn) (any, error) { tick := time.NewTicker(time.Duration(secondsBetween) * time.Second) retries := 0 diff --git a/internal/provider/resource_tfe_workspace_run_test.go b/internal/provider/resource_tfe_workspace_run_test.go index c4a5f7e72..8f463160b 100644 --- a/internal/provider/resource_tfe_workspace_run_test.go +++ b/internal/provider/resource_tfe_workspace_run_test.go @@ -258,7 +258,7 @@ func testAccCheckTFEWorkspaceRunDestroy(workspaceID string, expectedDestroyCount return func(s *terraform.State) error { config := testAccProvider.Meta().(ConfiguredClient) - _, err := retryFn(10, 1, func() (interface{}, error) { + mustBeNil, err := retryFn(10, 1, func() (any, error) { runList, err := config.Client.Runs.List(ctx, workspaceID, &tfe.RunListOptions{ Operation: "destroy", }) @@ -273,6 +273,11 @@ func testAccCheckTFEWorkspaceRunDestroy(workspaceID string, expectedDestroyCount return nil, nil }) + // This just makes the unparam linter happy and will always be nil + if mustBeNil != nil { + return fmt.Errorf("expected mustBeNil to be nil, but was %v", mustBeNil) + } + return err } } From 65b781968a631a546f01eb59cf2bc2b5a5ee9a3f Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 21 May 2024 15:02:21 -0600 Subject: [PATCH 379/420] pin setup-go action to v5.0.1 --- .github/actions/lint-provider-tfe/action.yml | 2 +- .github/actions/test-provider-tfe/action.yml | 2 +- .github/workflows/create-release-pr.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/lint-provider-tfe/action.yml b/.github/actions/lint-provider-tfe/action.yml index 041b1f99f..55c252fa8 100644 --- a/.github/actions/lint-provider-tfe/action.yml +++ b/.github/actions/lint-provider-tfe/action.yml @@ -7,7 +7,7 @@ runs: using: composite steps: - name: Setup Go Environment - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version-file: "go.mod" cache: true diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 70ccd2bae..5f83de881 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -52,7 +52,7 @@ runs: using: composite steps: - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version-file: go.mod cache: true diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index e4e9a36fa..f420d24ff 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -35,7 +35,7 @@ jobs: steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version-file: go.mod cache: true diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index ecc9d0285..f2b495b06 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -99,7 +99,7 @@ jobs: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version-file: go.mod check-latest: true From 3ed67ab7bbb229ce7ae462a81b13767a256526c2 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 22 May 2024 10:16:55 -0600 Subject: [PATCH 380/420] skip workspace_run tests for 1 year --- .github/workflows/ci.yml | 1 - internal/provider/helper_test.go | 8 +------- internal/provider/resource_tfe_workspace_run_test.go | 8 ++++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37afd479e..45acb537e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,6 @@ jobs: admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }} admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }} admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }} - enterprise: "1" # Run terminal cmd 'go help testflag' to learn more about -list flag # action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests # which runs against all tests using the list arg diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index fab46cc78..407d6d56b 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -52,10 +52,6 @@ func testTfeClient(t *testing.T, options testClientOptions) *tfe.Client { // Attempts to upgrade an organization to the business plan. Requires a user token with admin access. // DEPRECATED : Please use the newSubscriptionUpdater instead. func upgradeOrganizationSubscription(t *testing.T, _ *tfe.Client, organization *tfe.Organization) { - if enterpriseEnabled() { - return - } - newSubscriptionUpdater(organization).WithBusinessPlan().Update(t) } @@ -65,9 +61,7 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), }) - if !enterpriseEnabled() { - newSubscriptionUpdater(org).WithBusinessPlan().Update(t) - } + newSubscriptionUpdater(org).WithBusinessPlan().Update(t) return org, orgCleanup } diff --git a/internal/provider/resource_tfe_workspace_run_test.go b/internal/provider/resource_tfe_workspace_run_test.go index 8f463160b..23bd7e7ef 100644 --- a/internal/provider/resource_tfe_workspace_run_test.go +++ b/internal/provider/resource_tfe_workspace_run_test.go @@ -16,6 +16,10 @@ import ( ) func TestAccTFEWorkspaceRun_withApplyOnlyBlock(t *testing.T) { + // Currently, tflocal cloud box is incapable of running terraform more than once at a time + // due to the use of the raw_exec nomad driver. + skipUnlessAfterDate(t, time.Date(2025, 5, 1, 0, 0, 0, 0, time.UTC)) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() @@ -65,6 +69,10 @@ func TestAccTFEWorkspaceRun_withApplyOnlyBlock(t *testing.T) { } func TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks(t *testing.T) { + // Currently, tflocal cloud box is incapable of running terraform more than once at a time + // due to the use of the raw_exec nomad driver. + skipUnlessAfterDate(t, time.Date(2025, 5, 1, 0, 0, 0, 0, time.UTC)) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() tfeClient, err := getClientUsingEnv() From 65bf671e1e2cbc0694272eb1ee1c804ebb714821 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 22 May 2024 10:28:00 -0600 Subject: [PATCH 381/420] Re-enable concurrency --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45acb537e..5b5f4a6de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: run: npm install -g junit-report-merger - name: Merge reports - run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" + run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" - name: Upload test artifacts uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index f2b495b06..0188e9903 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -25,8 +25,8 @@ jobs: strategy: fail-fast: false matrix: - total: [ 1 ] - index: [ 0 ] + total: [ 5 ] + index: [ 0, 1, 2, 3, 4 ] steps: - name: Fetch Outputs id: tflocal From 5219dbf16148fdd29bd6ff801c8451580b3f9459 Mon Sep 17 00:00:00 2001 From: Taylor Chaparro <33099255+notchairmk@users.noreply.github.com> Date: Wed, 22 May 2024 11:30:25 -0700 Subject: [PATCH 382/420] feat(workspace): add auto destroy attribute to resource and data source (#1354) * feat(workspace): add auto destroy attribute to resource and data source This change adds `auto_destroy_at` to Workspace resource and data source schemas. The Workspaces API accepts three possible types of values for auto_destroy_at: - a set value - e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace", "auto-destroy-at": "2006-01-02T15:04:05Z" }}}` - an ignored value - e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace" }}}` - and an unset value - e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace", "auto-destroy-at": null }}}` * standardize auto destroy error messages * fix changelog * add docs note for `auto_destroy_at` attribute * update docs * call out ignore_changes for workspace auto destroy docs --- CHANGELOG.md | 2 + internal/provider/data_source_workspace.go | 11 ++++ .../provider/data_source_workspace_test.go | 57 +++++++++++++++++ internal/provider/resource_tfe_workspace.go | 59 +++++++++++++++++- .../provider/resource_tfe_workspace_test.go | 62 +++++++++++++++++++ website/docs/d/workspace.html.markdown | 1 + website/docs/r/workspace.html.markdown | 4 ++ 7 files changed, 195 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f63a35b0c..6102db6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ENHANCEMENTS: * `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) +* `r/tfe_workspace`: Add an `auto_destroy_at` attribute for scheduling an auto-destroy run in the future, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) +* `d/tfe_workspace`: Add an `auto_destroy_at` attribute for reading a scheduled auto-destroy, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) ## v0.55.0 diff --git a/internal/provider/data_source_workspace.go b/internal/provider/data_source_workspace.go index 7b7cb3210..40f3c330e 100644 --- a/internal/provider/data_source_workspace.go +++ b/internal/provider/data_source_workspace.go @@ -52,6 +52,11 @@ func dataSourceTFEWorkspace() *schema.Resource { Computed: true, }, + "auto_destroy_at": { + Type: schema.TypeString, + Computed: true, + }, + "file_triggers_enabled": { Type: schema.TypeBool, Computed: true, @@ -240,6 +245,12 @@ func dataSourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error d.Set("operations", workspace.Operations) d.Set("policy_check_failures", workspace.PolicyCheckFailures) + autoDestroyAt, err := flattenAutoDestroyAt(workspace.AutoDestroyAt) + if err != nil { + return fmt.Errorf("Error flattening auto destroy during read: %w", err) + } + d.Set("auto_destroy_at", autoDestroyAt) + // If target tfe instance predates projects, then workspace.Project will be nil if workspace.Project != nil { d.Set("project_id", workspace.Project.ID) diff --git a/internal/provider/data_source_workspace_test.go b/internal/provider/data_source_workspace_test.go index 2f3a2c158..57d096653 100644 --- a/internal/provider/data_source_workspace_test.go +++ b/internal/provider/data_source_workspace_test.go @@ -171,6 +171,25 @@ func TestAccTFEWorkspaceDataSourceWithTriggerPatterns(t *testing.T) { }) } +func TestAccTFEWorkspaceDataSource_readAutoDestroyAt(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspaceDataSourceConfig_basic(rInt), + Check: resource.TestCheckResourceAttr("data.tfe_workspace.foobar", "auto_destroy_at", ""), + }, + { + Config: testAccTFEWorkspaceDataSourceConfig_basicWithAutoDestroy(rInt), + Check: resource.TestCheckResourceAttr("data.tfe_workspace.foobar", "auto_destroy_at", "2100-01-01T00:00:00Z"), + }, + }, + }) +} + func TestAccTFEWorkspaceDataSource_readProjectIDDefault(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -243,6 +262,44 @@ data "tfe_workspace" "foobar" { }`, rInt, rInt, aart) } +func testAccTFEWorkspaceDataSourceConfig_basic(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test-%d" + organization = tfe_organization.foobar.id + description = "provider-testing" +} + +data "tfe_workspace" "foobar" { + name = tfe_workspace.foobar.name + organization = tfe_workspace.foobar.organization +}`, rInt, rInt) +} + +func testAccTFEWorkspaceDataSourceConfig_basicWithAutoDestroy(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test-%d" + organization = tfe_organization.foobar.id + description = "provider-testing" + auto_destroy_at = "2100-01-01T00:00:00Z" +} + +data "tfe_workspace" "foobar" { + name = tfe_workspace.foobar.name + organization = tfe_workspace.foobar.organization +}`, rInt, rInt) +} func testAccTFEWorkspaceDataSourceConfigWithTriggerPatterns(workspaceName string, organizationName string) string { return fmt.Sprintf(` data "tfe_workspace" "foobar" { diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index f72155e9a..c9d1100d6 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -19,6 +19,7 @@ import ( "time" tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/jsonapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -109,6 +110,11 @@ func resourceTFEWorkspace() *schema.Resource { Default: false, }, + "auto_destroy_at": { + Type: schema.TypeString, + Optional: true, + }, + "execution_mode": { Type: schema.TypeString, Optional: true, @@ -340,6 +346,14 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error } } + if _, ok := d.GetOk("auto_destroy_at"); ok { + autoDestroyAt, err := expandAutoDestroyAt(d) + if err != nil { + return fmt.Errorf("Error expanding auto destroy during create: %w", err) + } + options.AutoDestroyAt = autoDestroyAt + } + if v, ok := d.GetOk("execution_mode"); ok { executionMode := tfe.String(v.(string)) options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ @@ -533,6 +547,12 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { } d.Set("agent_pool_id", agentPoolID) + autoDestroyAt, err := flattenAutoDestroyAt(workspace.AutoDestroyAt) + if err != nil { + return fmt.Errorf("Error flattening auto destroy during read: %w", err) + } + d.Set("auto_destroy_at", autoDestroyAt) + var tagNames []interface{} managedTags := d.Get("tag_names").(*schema.Set) for _, tagName := range workspace.TagNames { @@ -585,7 +605,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error d.HasChange("operations") || d.HasChange("execution_mode") || d.HasChange("description") || d.HasChange("agent_pool_id") || d.HasChange("global_remote_state") || d.HasChange("structured_run_output_enabled") || - d.HasChange("assessments_enabled") || d.HasChange("project_id") { + d.HasChange("assessments_enabled") || d.HasChange("project_id") || d.HasChange("auto_destroy_at") { // Create a new options struct. options := tfe.WorkspaceUpdateOptions{ Name: tfe.String(d.Get("name").(string)), @@ -638,6 +658,14 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } + if d.HasChange("auto_destroy_at") { + autoDestroyAt, err := expandAutoDestroyAt(d) + if err != nil { + return fmt.Errorf("Error expanding auto destroy during update: %w", err) + } + options.AutoDestroyAt = autoDestroyAt + } + if d.HasChange("execution_mode") { if v, ok := d.GetOk("execution_mode"); ok { options.ExecutionMode = tfe.String(v.(string)) @@ -933,6 +961,35 @@ func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { return nil } +func expandAutoDestroyAt(d *schema.ResourceData) (jsonapi.NullableAttr[time.Time], error) { + v, ok := d.GetOk("auto_destroy_at") + + if !ok { + return jsonapi.NewNullNullableAttr[time.Time](), nil + } + + autoDestroyAt, err := time.Parse(time.RFC3339, v.(string)) + if err != nil { + return nil, err + } + + return jsonapi.NewNullableAttrWithValue(autoDestroyAt), nil +} + +func flattenAutoDestroyAt(a jsonapi.NullableAttr[time.Time]) (*string, error) { + if !a.IsSpecified() { + return nil, nil + } + + autoDestroyTime, err := a.Get() + if err != nil { + return nil, err + } + + autoDestroyAt := autoDestroyTime.Format(time.RFC3339) + return &autoDestroyAt, nil +} + func validTagName(tag string) bool { // Tags are re-validated here because the API will accept uppercase letters and automatically // downcase them, causing resource drift. It's better to catch this issue during the plan phase diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 59c6afaec..3f24cf199 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2648,6 +2648,52 @@ func TestAccTFEWorkspace_basicAssessmentsEnabled(t *testing.T) { }) } +func TestAccTFEWorkspace_createWithAutoDestroyAt(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_basicWithAutoDestroyAt(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists("tfe_workspace.foobar", &tfe.Workspace{}, testAccProvider), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", "2100-01-01T00:00:00Z"), + ), + }, + }, + }) +} + +func TestAccTFEWorkspace_updateWithAutoDestroyAt(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists("tfe_workspace.foobar", &tfe.Workspace{}, testAccProvider), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", ""), + ), + }, + { + Config: testAccTFEWorkspace_basicWithAutoDestroyAt(rInt), + Check: resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", "2100-01-01T00:00:00Z"), + }, + { + Config: testAccTFEWorkspace_basic(rInt), + Check: resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", ""), + }, + }, + }) +} + func TestAccTFEWorkspace_createWithSourceURL(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -2924,6 +2970,22 @@ resource "tfe_workspace" "foobar" { }`, rInt) } +func testAccTFEWorkspace_basicWithAutoDestroyAt(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test" + organization = tfe_organization.foobar.id + auto_apply = true + file_triggers_enabled = false + auto_destroy_at = "2100-01-01T00:00:00Z" +}`, rInt) +} + func testAccTFEWorkspace_operationsTrue(organization string) string { return fmt.Sprintf(` resource "tfe_workspace" "foobar" { diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index da6018846..f44e8aa67 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -35,6 +35,7 @@ In addition to all arguments above, the following attributes are exported: * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `auto_destroy_at` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 879e9f43a..9688c0d06 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -68,6 +68,10 @@ The following arguments are supported: * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. +* `auto_destroy_at` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `auto_destroy_at` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignore_changes` for this attribute may be preferred. + * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files From eba7bddc7615e31a683f1d5af743d18a50ff78a3 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 22 May 2024 13:43:20 -0600 Subject: [PATCH 383/420] fix permissions for local testing TestAccTFEPolicySet --- .../provider/resource_tfe_policy_set_test.go | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/internal/provider/resource_tfe_policy_set_test.go b/internal/provider/resource_tfe_policy_set_test.go index 9f26b0bd6..dc5a5da29 100644 --- a/internal/provider/resource_tfe_policy_set_test.go +++ b/internal/provider/resource_tfe_policy_set_test.go @@ -4,6 +4,7 @@ package provider import ( + "context" "fmt" "os" "regexp" @@ -60,6 +61,19 @@ func TestAccTFEPolicySet_pinnedPolicyRuntimeVersion(t *testing.T) { sha := genSentinelSha(t, "secret", "data") version := genSafeRandomSentinelVersion() + adminClient := testAdminClient(t, versionMaintenanceAdmin) + + opts := tfe.AdminSentinelVersionCreateOptions{ + Version: version, + SHA: sha, + URL: "https://hashicorp.com", + } + + tool, err := adminClient.Admin.SentinelVersions.Create(context.Background(), opts) + if err != nil { + t.Fatal(err) + } + org, orgCleanup := createBusinessOrganization(t, tfeClient) t.Cleanup(orgCleanup) @@ -71,7 +85,7 @@ func TestAccTFEPolicySet_pinnedPolicyRuntimeVersion(t *testing.T) { CheckDestroy: testAccCheckTFEPolicySetDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEPolicySet_pinnedPolicyRuntimeVersion(org.Name, version, sha), + Config: testAccTFEPolicySet_pinnedPolicyRuntimeVersion(org.Name, tool.Version), Check: resource.ComposeTestCheckFunc( testAccCheckTFEPolicySetExists("tfe_policy_set.foobar", policySet), testAccCheckTFEPolicySetAttributes(policySet), @@ -1034,14 +1048,8 @@ resource "tfe_policy_set" "foobar" { }`, organization, organization) } -func testAccTFEPolicySet_pinnedPolicyRuntimeVersion(organization string, version string, sha string) string { +func testAccTFEPolicySet_pinnedPolicyRuntimeVersion(organization string, version string) string { return fmt.Sprintf(` -resource "tfe_sentinel_version" "foobar" { - version = "%s" - url = "https://www.hashicorp.com" - sha = "%s" -} - resource "tfe_sentinel_policy" "foo" { name = "policy-foo" policy = "main = rule { true }" @@ -1055,7 +1063,7 @@ resource "tfe_policy_set" "foobar" { agent_enabled = true policy_tool_version = "%s" policy_ids = [tfe_sentinel_policy.foo.id] -}`, version, sha, organization, organization, version) +}`, organization, organization, version) } func testAccTFEPolicySetOPA_basic(organization string, version string, sha string) string { From 8985e0f1fd6bb58d6248d62777f88b44b163d20f Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 22 May 2024 14:47:33 -0600 Subject: [PATCH 384/420] bump github actions for node16 deprecation --- .github/actions/test-provider-tfe/action.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index 5f83de881..d4cdbaf94 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -69,7 +69,7 @@ runs: - name: Download artifact id: download-artifact - uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0 + uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4 with: workflow_conclusion: success name: junit-test-summary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 353bfe5c7..03f3da4ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Fetch Outputs id: tflocal - uses: hashicorp-forge/terraform-cloud-action/outputs@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main + uses: hashicorp-forge/terraform-cloud-action/outputs@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0 with: token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}" organization: hashicorp-v2 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 980d3eb55..438653bf5 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -11,7 +11,7 @@ jobs: timeout-minutes: 20 steps: - name: Build nightly tflocal instance - uses: hashicorp-forge/terraform-cloud-action/apply@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main + uses: hashicorp-forge/terraform-cloud-action/apply@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0 with: token: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }} organization: "hashicorp-v2" @@ -30,7 +30,7 @@ jobs: steps: - name: Fetch Outputs id: tflocal - uses: hashicorp-forge/terraform-cloud-action/outputs@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main + uses: hashicorp-forge/terraform-cloud-action/outputs@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0 with: token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}" organization: hashicorp-v2 @@ -106,10 +106,9 @@ jobs: cache: true - name: Destroy nightly tflocal instance - uses: hashicorp-forge/terraform-cloud-action/destroy@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main + uses: hashicorp-forge/terraform-cloud-action/destroy@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0 with: token: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }} organization: "hashicorp-v2" workspace: tflocal-terraform-provider-tfe-nightly wait: true - is-destroy: true From 9d49212f9a199af51359f0596236d2f49b6e2c36 Mon Sep 17 00:00:00 2001 From: Abdurahman Abdelgany <42511430+aaabdelgany@users.noreply.github.com> Date: Wed, 22 May 2024 16:50:25 -0400 Subject: [PATCH 385/420] Support initial_version for creating branch based modules (#1363) --- CHANGELOG.md | 1 + .../provider/resource_tfe_registry_module.go | 8 ++++++++ .../resource_tfe_registry_module_test.go | 18 ++++++++++-------- website/docs/r/registry_module.html.markdown | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6102db6b8..437e91e3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ENHANCEMENTS: * `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) * `r/tfe_workspace`: Add an `auto_destroy_at` attribute for scheduling an auto-destroy run in the future, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) * `d/tfe_workspace`: Add an `auto_destroy_at` attribute for reading a scheduled auto-destroy, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) +* `r/tfe_registry_module`: Add `initial_version` support for Branch Based Modules by @aaabdelgany [#1363](https://github.com/hashicorp/terraform-provider-tfe/pull/1363) ## v0.55.0 diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 8c85b64be..f9b7c1db2 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -134,6 +134,10 @@ func resourceTFERegistryModule() *schema.Resource { }, }, }, + "initial_version": { + Type: schema.TypeString, + Optional: true, + }, }, } } @@ -167,6 +171,7 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * tags, tagsOk := vcsRepo["tags"].(bool) branch, branchOk := vcsRepo["branch"].(string) + initialVersion, initialVersionOk := d.GetOk("initial_version") if tagsOk && tags && branchOk && branch != "" { return nil, fmt.Errorf("tags must be set to false when a branch is provided") @@ -174,6 +179,9 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * if branchOk && branch != "" { options.VCSRepo.Branch = tfe.String(branch) + if initialVersionOk && initialVersion.(string) != "" { + options.InitialVersion = tfe.String(initialVersion.(string)) + } } if vcsRepo["oauth_token_id"] != nil && vcsRepo["oauth_token_id"].(string) != "" { diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index a3196e001..c6edd527d 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -403,7 +403,6 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T) } func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -463,7 +462,6 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t } func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWithTests(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -505,7 +503,6 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWi } func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -556,7 +553,6 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags(t * } func TestAccTFERegistryModule_invalidTestConfigOnCreate(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -575,7 +571,6 @@ func TestAccTFERegistryModule_invalidTestConfigOnCreate(t *testing.T) { } func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -603,7 +598,6 @@ func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) { } func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -622,7 +616,6 @@ func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) { } func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -641,7 +634,6 @@ func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) { } func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) { - skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() resource.Test(t, resource.TestCase{ @@ -1027,6 +1019,8 @@ resource "tfe_registry_module" "foobar" { tags = false } + initial_version = "1.0.0" + test_config { tests_enabled = false } @@ -1061,6 +1055,8 @@ resource "tfe_registry_module" "foobar" { tags = false } + initial_version = "1.0.0" + test_config { } }`, @@ -1094,6 +1090,8 @@ resource "tfe_registry_module" "foobar" { tags = false } + initial_version = "1.0.0" + test_config { tests_enabled = true } @@ -1129,6 +1127,8 @@ resource "tfe_registry_module" "foobar" { tags = false } + initial_version = "1.0.0" + test_config { } }`, @@ -1163,6 +1163,8 @@ resource "tfe_registry_module" "foobar" { tags = true } + initial_version = "1.0.0" + test_config { tests_enabled = true } diff --git a/website/docs/r/registry_module.html.markdown b/website/docs/r/registry_module.html.markdown index 94a58d576..32a365ed1 100644 --- a/website/docs/r/registry_module.html.markdown +++ b/website/docs/r/registry_module.html.markdown @@ -154,6 +154,7 @@ The following arguments are supported: * `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `module_provider` is used, or if `vcs_repo` is used via a GitHub App. * `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. * `registry_name` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +* `initial_version` - (Optional) This specifies the initial version for a branch based module. It can be used if `vcs_repo.branch` is set. If it is omitted, the initial modules version will default to `0.0.0`. The `test_config` block supports * `tests_enabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. From a689f172e56578a2c327c723dc4c9080aaaaf99f Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Mon, 22 Apr 2024 11:40:41 -0400 Subject: [PATCH 386/420] fix constant diff even after a successful apply --- internal/provider/resource_tfe_registry_module.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index f9b7c1db2..9d321a051 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -95,6 +95,7 @@ func resourceTFERegistryModule() *schema.Resource { "tags": { Type: schema.TypeBool, Optional: true, + Computed: true, }, }, }, @@ -125,11 +126,13 @@ func resourceTFERegistryModule() *schema.Resource { "test_config": { Type: schema.TypeList, Optional: true, + Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "tests_enabled": { Type: schema.TypeBool, Optional: true, + Computed: true, }, }, }, From 0b5c1f349cde74492629722412ba01a8ad14caf8 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Mon, 13 May 2024 13:59:38 -0400 Subject: [PATCH 387/420] add changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 437e91e3e..2285c951c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ ENHANCEMENTS: * `d/tfe_workspace`: Add an `auto_destroy_at` attribute for reading a scheduled auto-destroy, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) * `r/tfe_registry_module`: Add `initial_version` support for Branch Based Modules by @aaabdelgany [#1363](https://github.com/hashicorp/terraform-provider-tfe/pull/1363) +BUG FIXES: +* `r/tfe_registry_module`: Prevents constant diff after a successful apply when `tags` and `tests_enabled` is not set by @Uk1288 [#1357](https://github.com/hashicorp/terraform-provider-tfe/pull/1357) + ## v0.55.0 FEATURES: From 938707a5f8e25792d459430b27a976cd114f5706 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Mon, 20 May 2024 21:22:58 -0400 Subject: [PATCH 388/420] add test and fix for more branch and tags combo --- .../provider/resource_tfe_registry_module.go | 30 +++- .../resource_tfe_registry_module_test.go | 132 ++++++++++++++++++ 2 files changed, 155 insertions(+), 7 deletions(-) diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index 9d321a051..a816aefd2 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -132,7 +132,6 @@ func resourceTFERegistryModule() *schema.Resource { "tests_enabled": { Type: schema.TypeBool, Optional: true, - Computed: true, }, }, }, @@ -176,8 +175,13 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * branch, branchOk := vcsRepo["branch"].(string) initialVersion, initialVersionOk := d.GetOk("initial_version") - if tagsOk && tags && branchOk && branch != "" { - return nil, fmt.Errorf("tags must be set to false when a branch is provided") + err = validateVcsRepo(tagsOk, tags, branchOk, branch) + if err != nil { + return nil, err + } + + if tagsOk { + options.VCSRepo.Tags = tfe.Bool(tags) } if branchOk && branch != "" { @@ -315,8 +319,9 @@ func resourceTFERegistryModuleUpdate(d *schema.ResourceData, meta interface{}) e tags, tagsOk := vcsRepo["tags"].(bool) branch, branchOk := vcsRepo["branch"].(string) - if tagsOk && tags && branchOk && branch != "" { - return fmt.Errorf("tags must be set to false when a branch is provided") + err = validateVcsRepo(tagsOk, tags, branchOk, branch) + if err != nil { + return err } if tagsOk { @@ -416,10 +421,10 @@ func resourceTFERegistryModuleRead(d *schema.ResourceData, meta interface{}) err } testConfig = append(testConfig, testConfigValues) - - d.Set("test_config", testConfig) } + d.Set("test_config", testConfig) + return nil } @@ -484,3 +489,14 @@ func resourceTFERegistryModuleImporter(ctx context.Context, d *schema.ResourceDa d.Id(), ) } + +func validateVcsRepo(tagsOk bool, tags bool, branchOk bool, branch string) error { + // tags must be set to true or branch provided but not both + if tagsOk && tags && branchOk && branch != "" { + return fmt.Errorf("tags must be set to false when a branch is provided") + } else if tagsOk && !tags && branchOk && branch == "" { + return fmt.Errorf("tags must be set to true when no branch is provided") + } + + return nil +} diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index c6edd527d..afa9425a5 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -300,6 +300,30 @@ func TestAccTFERegistryModule_publicRegistryModule(t *testing.T) { }) } +func TestAccTFERegistryModule_vcsRepoWithTagField(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsRepoWithFalseTagField(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + }, + }) +} + func TestAccTFERegistryModule_noCodeModule(t *testing.T) { skipIfEnterprise(t) @@ -633,6 +657,25 @@ func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) { }) } +func TestAccTFERegistryModule_branchAndTagsDisabledOnCreate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsWithBranchAndTagsDisabled(rInt), + ExpectError: regexp.MustCompile(`tags must be set to true when no branch is provided`), + }, + }, + }) +} + func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -660,6 +703,34 @@ func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) { }) } +func TestAccTFERegistryModule_branchAndTagsDisabledOnUpdate(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsTags(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + { + Config: testAccTFERegistryModule_vcsWithBranchAndTagsDisabled(rInt), + ExpectError: regexp.MustCompile(`tags must be set to true when no branch is provided`), + }, + }, + }) +} + func TestAccTFERegistryModuleImport_nonVCSPrivateRM(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -1175,6 +1246,37 @@ resource "tfe_registry_module" "foobar" { envGithubRegistryModuleIdentifer) } +func testAccTFERegistryModule_vcsWithBranchAndTagsDisabled(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "" + tags = false + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + func testAccTFERegistryModule_vcsTags(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { @@ -1205,6 +1307,36 @@ resource "tfe_registry_module" "foobar" { envGithubRegistryModuleIdentifer, envGithubRegistryModuleIdentifer) } +func testAccTFERegistryModule_vcsRepoWithFalseTagField(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + tags = false + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} func testAccTFERegistryModule_GitHubApp(rInt int) string { return fmt.Sprintf(` From 4ef15dd1ef8bb23085bc38584b82d845ef415c73 Mon Sep 17 00:00:00 2001 From: UKEME BASSEY Date: Wed, 22 May 2024 17:58:50 -0400 Subject: [PATCH 389/420] fix tags and branch validations --- .../provider/resource_tfe_registry_module.go | 43 ++-- .../resource_tfe_registry_module_test.go | 202 +++++++++++++++++- 2 files changed, 220 insertions(+), 25 deletions(-) diff --git a/internal/provider/resource_tfe_registry_module.go b/internal/provider/resource_tfe_registry_module.go index a816aefd2..7a1f3805f 100644 --- a/internal/provider/resource_tfe_registry_module.go +++ b/internal/provider/resource_tfe_registry_module.go @@ -32,6 +32,9 @@ func resourceTFERegistryModule() *schema.Resource { StateContext: resourceTFERegistryModuleImporter, }, + CustomizeDiff: func(c context.Context, d *schema.ResourceDiff, meta interface{}) error { + return validateVcsRepo(d) + }, Schema: map[string]*schema.Schema{ "organization": { Type: schema.TypeString, @@ -175,11 +178,6 @@ func resourceTFERegistryModuleCreateWithVCS(v interface{}, meta interface{}, d * branch, branchOk := vcsRepo["branch"].(string) initialVersion, initialVersionOk := d.GetOk("initial_version") - err = validateVcsRepo(tagsOk, tags, branchOk, branch) - if err != nil { - return nil, err - } - if tagsOk { options.VCSRepo.Tags = tfe.Bool(tags) } @@ -319,11 +317,6 @@ func resourceTFERegistryModuleUpdate(d *schema.ResourceData, meta interface{}) e tags, tagsOk := vcsRepo["tags"].(bool) branch, branchOk := vcsRepo["branch"].(string) - err = validateVcsRepo(tagsOk, tags, branchOk, branch) - if err != nil { - return err - } - if tagsOk { options.VCSRepo.Tags = tfe.Bool(tags) } @@ -356,7 +349,7 @@ func resourceTFERegistryModuleUpdate(d *schema.ResourceData, meta interface{}) e }) if err != nil { - return fmt.Errorf("Error while waiting for module %s/%s to be updated: %w", registryModule.Organization.Name, registryModule.Name, err) + return fmt.Errorf("Error while waiting for module %s/%s to be updated: %w", rmID.Organization, rmID.Name, err) } d.SetId(registryModule.ID) @@ -490,12 +483,28 @@ func resourceTFERegistryModuleImporter(ctx context.Context, d *schema.ResourceDa ) } -func validateVcsRepo(tagsOk bool, tags bool, branchOk bool, branch string) error { - // tags must be set to true or branch provided but not both - if tagsOk && tags && branchOk && branch != "" { - return fmt.Errorf("tags must be set to false when a branch is provided") - } else if tagsOk && !tags && branchOk && branch == "" { - return fmt.Errorf("tags must be set to true when no branch is provided") +func validateVcsRepo(d *schema.ResourceDiff) error { + vcsRepo, ok := d.GetRawConfig().AsValueMap()["vcs_repo"] + if !ok || vcsRepo.LengthInt() == 0 { + return nil + } + + branchValue := vcsRepo.AsValueSlice()[0].GetAttr("branch") + tagsValue := vcsRepo.AsValueSlice()[0].GetAttr("tags") + + if !tagsValue.IsNull() && tagsValue.False() && branchValue.IsNull() { + return fmt.Errorf("branch must be provided when tags is set to false") + } + + if !tagsValue.IsNull() && !branchValue.IsNull() { + tags := tagsValue.True() + branch := branchValue.AsString() + // tags must be set to true or branch provided but not both + if tags && branch != "" { + return fmt.Errorf("tags must be set to false when a branch is provided") + } else if !tags && branch == "" { + return fmt.Errorf("tags must be set to true when no branch is provided") + } } return nil diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index afa9425a5..8fdf0c49c 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccTFERegistryModule_vcs(t *testing.T) { +func TestAccTFERegistryModule_vcsBasic(t *testing.T) { registryModule := &tfe.RegistryModule{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() orgName := fmt.Sprintf("tst-terraform-%d", rInt) @@ -38,7 +38,7 @@ func TestAccTFERegistryModule_vcs(t *testing.T) { CheckDestroy: testAccCheckTFERegistryModuleDestroy, Steps: []resource.TestStep{ { - Config: testAccTFERegistryModule_vcs(rInt), + Config: testAccTFERegistryModule_vcsBasic(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckTFERegistryModuleExists( "tfe_registry_module.foobar", @@ -300,7 +300,7 @@ func TestAccTFERegistryModule_publicRegistryModule(t *testing.T) { }) } -func TestAccTFERegistryModule_vcsRepoWithTagField(t *testing.T) { +func TestAccTFERegistryModule_branchOnly(t *testing.T) { skipUnlessBeta(t) rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -312,7 +312,31 @@ func TestAccTFERegistryModule_vcsRepoWithTagField(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccTFERegistryModule_vcsRepoWithFalseTagField(rInt), + Config: testAccTFERegistryModule_branchOnly(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(false)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", "main"), + ), + }, + }, + }) +} + +func TestAccTFERegistryModule_vcsRepoWithTags(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsRepoWithFalseTags(rInt), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "branch"), resource.TestCheckResourceAttr("tfe_registry_module.foobar", "test_config.0.tests_enabled", strconv.FormatBool(false)), @@ -390,7 +414,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMDeprecatedFormat(t *testing.T) { CheckDestroy: testAccCheckTFERegistryModuleDestroy, Steps: []resource.TestStep{ { - Config: testAccTFERegistryModule_vcs(rInt), + Config: testAccTFERegistryModule_vcsWithTagsTrue(rInt), }, { ResourceName: "tfe_registry_module.foobar", @@ -414,7 +438,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T) CheckDestroy: testAccCheckTFERegistryModuleDestroy, Steps: []resource.TestStep{ { - Config: testAccTFERegistryModule_vcs(rInt), + Config: testAccTFERegistryModule_vcsWithTagsTrue(rInt), }, { ResourceName: "tfe_registry_module.foobar", @@ -485,6 +509,30 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t }) } +func TestAccTFERegistryModule_branchOnlyEmpty(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_branchOnlyEmpty(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "publishing_mechanism", "git_tag"), + resource.TestCheckNoResourceAttr("tfe_registry_module.foobar", "test_config.0"), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.tags", strconv.FormatBool(true)), + resource.TestCheckResourceAttr("tfe_registry_module.foobar", "vcs_repo.0.branch", ""), + ), + }, + }, + }) +} + func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWithTests(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -621,6 +669,25 @@ func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) { }) } +func TestAccTFERegistryModule_vcsTagsOnlyFalse(t *testing.T) { + skipUnlessBeta(t) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckTFERegistryModule(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFERegistryModule_vcsTagsOnlyFalse(rInt), + ExpectError: regexp.MustCompile(`branch must be provided when tags is set to false`), + }, + }, + }) +} + func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -1035,7 +1102,7 @@ func getRegistryModuleProvider() string { return strings.SplitN(getRegistryModuleRepository(), "-", 3)[1] } -func testAccTFERegistryModule_vcs(rInt int) string { +func testAccTFERegistryModule_vcsWithTagsTrue(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -1277,6 +1344,125 @@ resource "tfe_registry_module" "foobar" { envGithubRegistryModuleIdentifer) } +func testAccTFERegistryModule_vcsBasic(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_vcsTagsOnlyFalse(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + tags = false + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_branchOnly(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "main" + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + +func testAccTFERegistryModule_branchOnlyEmpty(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "foobar" { + organization = tfe_organization.foobar.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "%s" + service_provider = "github" +} + +resource "tfe_registry_module" "foobar" { + organization = tfe_organization.foobar.name + vcs_repo { + display_identifier = "%s" + identifier = "%s" + oauth_token_id = tfe_oauth_client.foobar.oauth_token_id + branch = "" + } +}`, + rInt, + envGithubToken, + envGithubRegistryModuleIdentifer, + envGithubRegistryModuleIdentifer) +} + func testAccTFERegistryModule_vcsTags(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { @@ -1307,7 +1493,7 @@ resource "tfe_registry_module" "foobar" { envGithubRegistryModuleIdentifer, envGithubRegistryModuleIdentifer) } -func testAccTFERegistryModule_vcsRepoWithFalseTagField(rInt int) string { +func testAccTFERegistryModule_vcsRepoWithFalseTags(rInt int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" From 5d98a7942ed743aa4315129961fbc86fc5e5013b Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Wed, 22 May 2024 16:52:56 -0600 Subject: [PATCH 390/420] Fixes TestAccTFEPolicySet_pinnedPolicyRuntimeVersion for TFE tests --- internal/provider/resource_tfe_policy_set_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_policy_set_test.go b/internal/provider/resource_tfe_policy_set_test.go index dc5a5da29..54dea9dbb 100644 --- a/internal/provider/resource_tfe_policy_set_test.go +++ b/internal/provider/resource_tfe_policy_set_test.go @@ -61,7 +61,10 @@ func TestAccTFEPolicySet_pinnedPolicyRuntimeVersion(t *testing.T) { sha := genSentinelSha(t, "secret", "data") version := genSafeRandomSentinelVersion() - adminClient := testAdminClient(t, versionMaintenanceAdmin) + adminClient := tfeClient + if !enterpriseEnabled() { + adminClient = testAdminClient(t, versionMaintenanceAdmin) + } opts := tfe.AdminSentinelVersionCreateOptions{ Version: version, From 0cc8babb5eac6fc2eddd12ec8637e0f81abc5cce Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Tue, 28 May 2024 13:44:57 -0600 Subject: [PATCH 391/420] Bump github-dependency test skip expiration --- internal/provider/provider_test.go | 2 +- internal/provider/resource_tfe_registry_module_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 1e1cc0f29..6da6fa08b 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -213,7 +213,7 @@ func TestConfigureEnvOrganization(t *testing.T) { // The TFE Provider tests use these environment variables, which are set in the // GitHub Action workflow file .github/workflows/ci.yml. func testAccGithubPreCheck(t *testing.T) { - skipUnlessAfterDate(t, time.Date(2024, 5, 24, 0, 0, 0, 0, time.UTC)) + skipUnlessAfterDate(t, time.Date(2024, 7, 1, 0, 0, 0, 0, time.UTC)) if envGithubToken == "" { t.Skip("Please set GITHUB_TOKEN to run this test") diff --git a/internal/provider/resource_tfe_registry_module_test.go b/internal/provider/resource_tfe_registry_module_test.go index c6edd527d..b5aa7babe 100644 --- a/internal/provider/resource_tfe_registry_module_test.go +++ b/internal/provider/resource_tfe_registry_module_test.go @@ -934,7 +934,7 @@ func testAccCheckTFERegistryModuleDestroy(s *terraform.State) error { } func testAccPreCheckTFERegistryModule(t *testing.T) { - skipUnlessAfterDate(t, time.Date(2024, 5, 24, 0, 0, 0, 0, time.UTC)) + skipUnlessAfterDate(t, time.Date(2024, 7, 1, 0, 0, 0, 0, time.UTC)) if envGithubToken == "" { t.Skip("Please set GITHUB_TOKEN to run this test") From 348544e824f4ba2af0feaee9766db59cccaeb0ef Mon Sep 17 00:00:00 2001 From: Zain Hasan Date: Wed, 29 May 2024 14:48:23 -0700 Subject: [PATCH 392/420] formatting --- internal/provider/resource_tfe_oauth_client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/provider/resource_tfe_oauth_client.go b/internal/provider/resource_tfe_oauth_client.go index fe0d9246c..2842f4bcd 100644 --- a/internal/provider/resource_tfe_oauth_client.go +++ b/internal/provider/resource_tfe_oauth_client.go @@ -108,7 +108,6 @@ func resourceTFEOAuthClient() *schema.Resource { false, ), }, - "oauth_token_id": { Type: schema.TypeString, Computed: true, @@ -117,7 +116,7 @@ func resourceTFEOAuthClient() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - }, + }, "organization_scoped": { Type: schema.TypeBool, Optional: true, From deb29533a7fc9790d0cf5c58018853747b347242 Mon Sep 17 00:00:00 2001 From: Paul Anunda Date: Fri, 31 May 2024 08:55:48 -0400 Subject: [PATCH 393/420] Update oauth_client.html.markdown --- website/docs/r/oauth_client.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index ab70e15c3..b362c5058 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -90,7 +90,7 @@ Link. * `service_provider` - (Required) The VCS provider being connected with. Valid options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. -* `agent_pool_id` - (Optional) An existing Agent pool id within the organization which has Private VCS support enabled via Premium SKU. +* `agent_pool_id` - (Optional) An existing agent pool id within the organization that has Private VCS support enabled. * `organization_scoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference From ed2fedab5ab39e7baa1fb0098644724d637c36b2 Mon Sep 17 00:00:00 2001 From: Paul Anunda Date: Fri, 31 May 2024 09:46:34 -0400 Subject: [PATCH 394/420] Replaced id with ID --- website/docs/r/oauth_client.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/oauth_client.html.markdown b/website/docs/r/oauth_client.html.markdown index b362c5058..0ca4f4348 100644 --- a/website/docs/r/oauth_client.html.markdown +++ b/website/docs/r/oauth_client.html.markdown @@ -90,7 +90,7 @@ Link. * `service_provider` - (Required) The VCS provider being connected with. Valid options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. -* `agent_pool_id` - (Optional) An existing agent pool id within the organization that has Private VCS support enabled. +* `agent_pool_id` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. * `organization_scoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference From 94a6760009a16ffab7b51a234aac54835613cd89 Mon Sep 17 00:00:00 2001 From: Paul Boekschoten Date: Wed, 5 Jun 2024 16:20:35 +0200 Subject: [PATCH 395/420] removed TFE agent comment from execution_mode attribute on tfe_workspace_settings --- website/docs/r/workspace_settings.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/workspace_settings.markdown b/website/docs/r/workspace_settings.markdown index 8caeea24a..d161ffafe 100644 --- a/website/docs/r/workspace_settings.markdown +++ b/website/docs/r/workspace_settings.markdown @@ -88,7 +88,7 @@ The following arguments are supported: * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference From e58bb23ac6957ffbdf9b8581329f989e51bbce19 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Wed, 12 Jun 2024 15:01:08 -0700 Subject: [PATCH 396/420] implement create and read for tfe_data_retention_policies --- internal/provider/data_retention_policy.go | 71 +++++ internal/provider/provider_next.go | 1 + .../resource_tfe_data_retention_policy.go | 290 ++++++++++++++++++ ...resource_tfe_data_retention_policy_test.go | 130 ++++++++ 4 files changed, 492 insertions(+) create mode 100644 internal/provider/data_retention_policy.go create mode 100644 internal/provider/resource_tfe_data_retention_policy.go create mode 100644 internal/provider/resource_tfe_data_retention_policy_test.go diff --git a/internal/provider/data_retention_policy.go b/internal/provider/data_retention_policy.go new file mode 100644 index 000000000..c3b124521 --- /dev/null +++ b/internal/provider/data_retention_policy.go @@ -0,0 +1,71 @@ +package provider + +import ( + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/types" + "context" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "math/big" +) + +type modelTFEDataRetentionPolicy struct { + ID types.String `tfsdk:"id"` + Organization types.String `tfsdk:"organization"` + WorkspaceId types.String `tfsdk:"workspace_id"` + DeleteOlderThan types.Object `tfsdk:"delete_older_than"` + DontDelete types.Object `tfsdk:"dont_delete"` +} + +type modelTFEDeleteOlderThan struct { + Days types.Number `tfsdk:"days"` +} + +func (m modelTFEDeleteOlderThan) AttributeTypes() map[string]attr.Type { + return map[string]attr.Type{ + "days": types.NumberType, + } +} + +func DontDeleteEmptyObject() basetypes.ObjectValue { + object, diags := types.ObjectValue(map[string]attr.Type{}, map[string]attr.Value{}) + if diags.HasError() { + panic(diags.Errors()) + } + return object +} + +func modelFromTFEDataRetentionPolicyDeleteOlder(ctx context.Context, model modelTFEDataRetentionPolicy, deleteOlder *tfe.DataRetentionPolicyDeleteOlder) (modelTFEDataRetentionPolicy, diag.Diagnostics) { + deleteOlderThan := modelTFEDeleteOlderThan{ + Days: types.NumberValue(big.NewFloat(float64(deleteOlder.DeleteOlderThanNDays))), + } + deleteOlderThanObject, diags := types.ObjectValueFrom(ctx, deleteOlderThan.AttributeTypes(), deleteOlderThan) + + return modelTFEDataRetentionPolicy{ + ID: types.StringValue(deleteOlder.ID), + Organization: model.Organization, + WorkspaceId: model.WorkspaceId, + DeleteOlderThan: deleteOlderThanObject, + DontDelete: types.ObjectNull(map[string]attr.Type{}), + }, diags +} + +func modelFromTFEDataRetentionPolicyDontDelete(model modelTFEDataRetentionPolicy, dontDelete *tfe.DataRetentionPolicyDontDelete) modelTFEDataRetentionPolicy { + return modelTFEDataRetentionPolicy{ + ID: types.StringValue(dontDelete.ID), + Organization: model.Organization, + WorkspaceId: model.WorkspaceId, + DeleteOlderThan: types.ObjectNull(modelTFEDeleteOlderThan{}.AttributeTypes()), + DontDelete: DontDeleteEmptyObject(), + } +} + +func modelFromTFEDataRetentionPolicyChoice(ctx context.Context, model modelTFEDataRetentionPolicy, choice *tfe.DataRetentionPolicyChoice) (modelTFEDataRetentionPolicy, diag.Diagnostics) { + if choice.DataRetentionPolicyDeleteOlder != nil { + return modelFromTFEDataRetentionPolicyDeleteOlder(ctx, model, choice.DataRetentionPolicyDeleteOlder) + } + + var emptyDiag []diag.Diagnostic + return modelFromTFEDataRetentionPolicyDontDelete(model, choice.DataRetentionPolicyDontDelete), emptyDiag +} diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index 443e66823..feed894e9 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -140,6 +140,7 @@ func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Res NewRegistryGPGKeyResource, NewRegistryProviderResource, NewResourceVariable, + NewDataRetentionPolicyResource, NewResourceWorkspaceSettings, NewSAMLSettingsResource, NewTestVariableResource, diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go new file mode 100644 index 000000000..8675ce8e2 --- /dev/null +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -0,0 +1,290 @@ +package provider + +import ( + "context" + "fmt" + "strings" + + "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ resource.Resource = &resourceTFEDataRetentionPolicy{} +var _ resource.ResourceWithConfigure = &resourceTFEDataRetentionPolicy{} +var _ resource.ResourceWithImportState = &resourceTFEDataRetentionPolicy{} +var _ resource.ResourceWithModifyPlan = &resourceTFEDataRetentionPolicy{} + +func NewDataRetentionPolicyResource() resource.Resource { + return &resourceTFEDataRetentionPolicy{} +} + +// resourceTFEDataRetentionPolicy implements the tfe_data_retention_policy resource type +type resourceTFEDataRetentionPolicy struct { + config ConfiguredClient +} + +func (r *resourceTFEDataRetentionPolicy) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_data_retention_policy" +} + +func (r *resourceTFEDataRetentionPolicy) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req.State, req.Config, req.Plan, resp) +} + +func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Manages the data retention policies for a specific workspace or an the entire organization.", + Version: 1, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "ID of the Data Retention Policy.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "organization": schema.StringAttribute{ + Description: "Name of the organization. If omitted, organization must be defined in the provider config.", + Optional: true, + }, + "workspace_id": schema.StringAttribute{ + Description: "ID of the workspace that the data retention policy should apply to. If omitted, the data retention policy will apply to the entire organization.", + Optional: true, + }, + }, + Blocks: map[string]schema.Block{ + "delete_older_than": schema.SingleNestedBlock{ + Description: "Sets the maximum number of days, months, years data is allowed to exist before it is scheduled for deletion. Cannot be configured if the dont_delete attribute is also configured.", + Attributes: map[string]schema.Attribute{ + "days": schema.NumberAttribute{ + Description: "Number of days", + Required: true, + }, + }, + Validators: []validator.Object{ + objectvalidator.ExactlyOneOf( + path.MatchRelative().AtParent().AtName("dont_delete"), + ), + }, + }, + "dont_delete": schema.SingleNestedBlock{ + Attributes: map[string]schema.Attribute{}, + Validators: []validator.Object{ + objectvalidator.ExactlyOneOf( + path.MatchRelative().AtParent().AtName("delete_older_than"), + ), + }, + }, + }, + } +} + +// Configure implements resource.ResourceWithConfigure +func (r *resourceTFEDataRetentionPolicy) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected resource Configure type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + } + r.config = client +} + +func (r *resourceTFEDataRetentionPolicy) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan modelTFEDataRetentionPolicy + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + + if resp.Diagnostics.HasError() { + return + } + + var organization string + if plan.WorkspaceId.IsNull() { + resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.Plan, &organization)...) + plan.Organization = types.StringValue(organization) + } + + if resp.Diagnostics.HasError() { + return + } + + if !plan.DeleteOlderThan.IsNull() { + r.createDeleteOlderThanRetentionPolicy(ctx, plan, resp) + return + } + + if !plan.DontDelete.IsNull() { + r.createDontDeleteRetentionPolicy(ctx, plan, resp) + return + } + +} + +func (r *resourceTFEDataRetentionPolicy) createDeleteOlderThanRetentionPolicy(ctx context.Context, plan modelTFEDataRetentionPolicy, resp *resource.CreateResponse) { + deleteOlderThan := &modelTFEDeleteOlderThan{} + + diags := plan.DeleteOlderThan.As(ctx, &deleteOlderThan, basetypes.ObjectAsOptions{}) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + + deleteOlderThanDays, _ := deleteOlderThan.Days.ValueBigFloat().Int64() + options := tfe.DataRetentionPolicyDeleteOlderSetOptions{ + DeleteOlderThanNDays: int(deleteOlderThanDays), + } + + tflog.Debug(ctx, "Creating data retention policy") + var dataRetentionPolicy *tfe.DataRetentionPolicyDeleteOlder + var err error + if plan.WorkspaceId.IsNull() { + dataRetentionPolicy, err = r.config.Client.Organizations.SetDataRetentionPolicyDeleteOlder(ctx, plan.Organization.ValueString(), options) + } else { + dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDeleteOlder(ctx, plan.WorkspaceId.ValueString(), options) + } + if err != nil { + resp.Diagnostics.AddError("Unable to create data retention policy", err.Error()) + return + } + + result, diags := modelFromTFEDataRetentionPolicyDeleteOlder(ctx, plan, dataRetentionPolicy) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx context.Context, plan modelTFEDataRetentionPolicy, resp *resource.CreateResponse) { + deleteOlderThan := &modelTFEDeleteOlderThan{} + + diags := plan.DeleteOlderThan.As(ctx, &deleteOlderThan, basetypes.ObjectAsOptions{}) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + + options := tfe.DataRetentionPolicyDontDeleteSetOptions{} + + tflog.Debug(ctx, "Creating data retention policy") + var dataRetentionPolicy *tfe.DataRetentionPolicyDontDelete + var err error + if plan.WorkspaceId.IsNull() { + dataRetentionPolicy, err = r.config.Client.Organizations.SetDataRetentionPolicyDontDelete(ctx, plan.Organization.ValueString(), options) + } else { + dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDontDelete(ctx, plan.WorkspaceId.ValueString(), options) + } + if err != nil { + resp.Diagnostics.AddError("Unable to create data retention policy", err.Error()) + return + } + + result := modelFromTFEDataRetentionPolicyDontDelete(plan, dataRetentionPolicy) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFEDataRetentionPolicy) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelTFEDataRetentionPolicy + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + var policy *tfe.DataRetentionPolicyChoice + var err error + if state.WorkspaceId.IsNull() { + policy, err = r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, state.Organization.ValueString()) + if err != nil { + resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) + return + } + } else { + policy, err = r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, state.WorkspaceId.ValueString()) + if err != nil { + resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) + return + } + } + result, diags := modelFromTFEDataRetentionPolicyChoice(ctx, state, policy) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceTFEDataRetentionPolicy) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // If the resource does not support modification and should always be recreated on + // configuration value updates, the Update logic can be left empty and ensure all + // configurable schema attributes implement the resource.RequiresReplace() + // attribute plan modifier. + resp.Diagnostics.AddError("Update not supported", "The update operation is not supported on this resource. This is a bug in the provider.") +} + +func (r *resourceTFEDataRetentionPolicy) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + //var state modelTFERegistryGPGKey + // + //// Read Terraform prior state data into the model + //resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + // + //if resp.Diagnostics.HasError() { + // return + //} + // + //keyID := tfe.GPGKeyID{ + // RegistryName: "private", + // Namespace: state.Organization.ValueString(), + // KeyID: state.ID.ValueString(), + //} + // + //tflog.Debug(ctx, "Deleting private registry GPG key") + //err := r.config.Client.GPGKeys.Delete(ctx, keyID) + //if err != nil { + // resp.Diagnostics.AddError("Unable to delete private registry GPG key", err.Error()) + // return + //} +} + +func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 2) + if len(s) != 2 { + resp.Diagnostics.AddError( + "Error importing variable", + fmt.Sprintf("Invalid variable import format: %s (expected /)", req.ID), + ) + return + } + org := s[0] + id := s[1] + + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), org)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), id)...) +} diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go new file mode 100644 index 000000000..44e5b9022 --- /dev/null +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -0,0 +1,130 @@ +package provider + +import ( + "math/rand" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "fmt" +) + +func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { + policy := &tfe.DataRetentionPolicyChoice{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + testAccCheckTFEDataRetentionPolicyAttributes(policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), + ), + }, + }, + }) +} + +func testAccTFEDataRetentionPolicy_basic(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test" + organization = tfe_organization.foobar.id +} + +resource "tfe_data_retention_policy" "foobar" { + workspace_id = tfe_workspace.foobar.id + + delete_older_than { + days = 42 + } +}`, rInt) +} + +func testAccCheckTFEDataRetentionPolicyExists( + n string, policy *tfe.DataRetentionPolicyChoice) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + wsID := rs.Primary.Attributes["workspace_id"] + ws, err := config.Client.Workspaces.ReadByID(ctx, wsID) + if err != nil { + return fmt.Errorf( + "Error retrieving workspace %s: %w", wsID, err) + } + + drp, err := config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, ws.ID) + if err != nil { + return fmt.Errorf( + "Error retrieving data retention policy for workspace %s: %w", ws.ID, err) + } + + *policy = *drp + + return nil + } +} + +func testAccCheckTFEDataRetentionPolicyAttributes( + policy *tfe.DataRetentionPolicyChoice) resource.TestCheckFunc { + return func(s *terraform.State) error { + if policy.DataRetentionPolicyDeleteOlder == nil { + return fmt.Errorf("policy wasn't of type 'delete_older'") + } + + if policy.DataRetentionPolicyDeleteOlder.DeleteOlderThanNDays != 42 { + return fmt.Errorf("bad delete_older_than_n_days: %d", policy.DataRetentionPolicyDeleteOlder.DeleteOlderThanNDays) + } + + return nil + } +} + +func testAccCheckTFEDataRetentionPolicyDestroy(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "tfe_data_retention_policy" { + continue + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + + dataRetentionPolicy, err := config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, rs.Primary.Attributes["workspace_id"]) + if err == nil { + if dataRetentionPolicy.DataRetentionPolicyDeleteOlder != nil { + return fmt.Errorf("data retention policy %s still exists", dataRetentionPolicy.DataRetentionPolicyDeleteOlder.ID) + } + if dataRetentionPolicy.DataRetentionPolicyDontDelete != nil { + return fmt.Errorf("data retention policy %s still exists", dataRetentionPolicy.DataRetentionPolicyDontDelete.ID) + } + return fmt.Errorf("data retention policy likely exists but couldn't be serialized") + } + } + + return nil +} From 5d90736262d295ca533f5cd433c7a296b89d4beb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:30:27 +0000 Subject: [PATCH 397/420] Build(deps): Bump actions/checkout from 4.1.6 to 4.1.7 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/a5ac7e51b41094c92402da3b24376905380afc29...692973e3d937129bcbf40652eb9f2f61becf3332) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-release-pr.yml | 6 +++--- .github/workflows/mkdocs.yml | 2 +- .github/workflows/nightly-tfe-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03f3da4ed..9de95ce0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: ./.github/actions/lint-provider-tfe tests: @@ -35,7 +35,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: ./.github/actions/test-provider-tfe with: diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 6b4a58c11..8376cd541 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -17,7 +17,7 @@ jobs: outputs: version: ${{ steps.remove-leading-v.outputs.version }} steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 id: get-latest-tag @@ -33,7 +33,7 @@ jobs: buildBinary: runs-on: ubuntu-latest steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: @@ -68,7 +68,7 @@ jobs: CHECKPOINT_DISABLE: "1" timeout-minutes: 120 steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - run: git config --global user.email "bcroft@hashicorp.com" - run: git config --global user.name "Brandon Croft" - name: Get yarn cache directory path diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 2565ca1e4..0cfb75b0c 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@d77dd03172e96abbcdb081d8c948224762033653 # 1.26 diff --git a/.github/workflows/nightly-tfe-test.yml b/.github/workflows/nightly-tfe-test.yml index 438653bf5..deb173184 100644 --- a/.github/workflows/nightly-tfe-test.yml +++ b/.github/workflows/nightly-tfe-test.yml @@ -36,7 +36,7 @@ jobs: organization: hashicorp-v2 workspace: tflocal-terraform-provider-tfe-nightly - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: ./.github/actions/test-provider-tfe with: @@ -96,7 +96,7 @@ jobs: needs: [tests-summarize] if: "${{ always() }}" steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8df9b1df6..580f6cf45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - name: Generate Release Notes From 89d70db39e5729f54440089c265e759e3ff2ac28 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Thu, 13 Jun 2024 09:59:49 -0700 Subject: [PATCH 398/420] add additional tests and implement update for data retention policy resource --- .../resource_tfe_data_retention_policy.go | 66 ++++++---- ...resource_tfe_data_retention_policy_test.go | 122 ++++++++++++++---- 2 files changed, 136 insertions(+), 52 deletions(-) diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 8675ce8e2..4f363318c 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/numberplanmodifier" ) // Ensure provider defined types fully satisfy framework interfaces. @@ -57,10 +58,17 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc "organization": schema.StringAttribute{ Description: "Name of the organization. If omitted, organization must be defined in the provider config.", Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, "workspace_id": schema.StringAttribute{ Description: "ID of the workspace that the data retention policy should apply to. If omitted, the data retention policy will apply to the entire organization.", Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, }, Blocks: map[string]schema.Block{ @@ -70,6 +78,9 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc "days": schema.NumberAttribute{ Description: "Number of days", Required: true, + PlanModifiers: []planmodifier.Number{ + numberplanmodifier.RequiresReplace(), + }, }, }, Validators: []validator.Object{ @@ -250,41 +261,46 @@ func (r *resourceTFEDataRetentionPolicy) Update(ctx context.Context, req resourc } func (r *resourceTFEDataRetentionPolicy) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - //var state modelTFERegistryGPGKey - // - //// Read Terraform prior state data into the model - //resp.Diagnostics.Append(req.State.Get(ctx, &state)...) - // - //if resp.Diagnostics.HasError() { - // return - //} - // - //keyID := tfe.GPGKeyID{ - // RegistryName: "private", - // Namespace: state.Organization.ValueString(), - // KeyID: state.ID.ValueString(), - //} - // - //tflog.Debug(ctx, "Deleting private registry GPG key") - //err := r.config.Client.GPGKeys.Delete(ctx, keyID) - //if err != nil { - // resp.Diagnostics.AddError("Unable to delete private registry GPG key", err.Error()) - // return - //} + var state modelTFEDataRetentionPolicy + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + if state.WorkspaceId.IsNull() { + tflog.Debug(ctx, fmt.Sprintf("Deleting data retention policy for organization: %s", state.Organization)) + err := r.config.Client.Organizations.DeleteDataRetentionPolicy(ctx, state.Organization.ValueString()) + if err != nil { + resp.Diagnostics.AddError(fmt.Sprintf("Deleting data retention policy for organization: %s", state.Organization), err.Error()) + return + } + } else { + tflog.Debug(ctx, fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceId)) + err := r.config.Client.Workspaces.DeleteDataRetentionPolicy(ctx, state.WorkspaceId.ValueString()) + if err != nil { + resp.Diagnostics.AddError(fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceId), err.Error()) + return + } + } + } func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { s := strings.SplitN(req.ID, "/", 2) - if len(s) != 2 { + + if len(s) != 2 && len(s) != 1 { resp.Diagnostics.AddError( "Error importing variable", - fmt.Sprintf("Invalid variable import format: %s (expected /)", req.ID), + fmt.Sprintf("Invalid variable import format: %s (expected / or )", req.ID), ) return } org := s[0] - id := s[1] + wsId := s[1] resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), org)...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), id)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), wsId)...) } diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go index 44e5b9022..e07529a3c 100644 --- a/internal/provider/resource_tfe_data_retention_policy_test.go +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "fmt" + "os" ) func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { @@ -21,10 +22,9 @@ func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEDataRetentionPolicy_basic(rInt), + Config: testAccTFEDataRetentionPolicy_basic(rInt, 42), Check: resource.ComposeTestCheckFunc( testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), - testAccCheckTFEDataRetentionPolicyAttributes(policy), resource.TestCheckResourceAttr( "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), ), @@ -33,7 +33,68 @@ func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { }) } -func testAccTFEDataRetentionPolicy_basic(rInt int) string { +func TestAccTFEDataRetentionPolicy_update(t *testing.T) { + policy := &tfe.DataRetentionPolicyChoice{} + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_basic(rInt, 42), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), + ), + }, + + { + Config: testAccTFEDataRetentionPolicy_basic(rInt, 1337), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "1337"), + ), + }, + }, + }) +} + +func TestAccTFEDataRetentionPolicy_organization_level(t *testing.T) { + policy := &tfe.DataRetentionPolicyChoice{} + defaultOrgName, _ := setupDefaultOrganization(t) + + os.Setenv("TFE_ORGANIZATION", defaultOrgName) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_implicit_organization(42), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), + ), + }, + { + Config: testAccTFEDataRetentionPolicy_implicit_organization(1337), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "1337"), + ), + }, + }, + }) +} + +func testAccTFEDataRetentionPolicy_basic(rInt int, deleteOlderThan int) string { return fmt.Sprintf(` resource "tfe_organization" "foobar" { name = "tst-terraform-%d" @@ -49,9 +110,18 @@ resource "tfe_data_retention_policy" "foobar" { workspace_id = tfe_workspace.foobar.id delete_older_than { - days = 42 + days = %d } -}`, rInt) +}`, rInt, deleteOlderThan) +} + +func testAccTFEDataRetentionPolicy_implicit_organization(deleteOlderThan int) string { + return fmt.Sprintf(` +resource "tfe_data_retention_policy" "foobar" { + delete_older_than { + days = %d + } +}`, deleteOlderThan) } func testAccCheckTFEDataRetentionPolicyExists( @@ -69,33 +139,31 @@ func testAccCheckTFEDataRetentionPolicyExists( } wsID := rs.Primary.Attributes["workspace_id"] - ws, err := config.Client.Workspaces.ReadByID(ctx, wsID) - if err != nil { - return fmt.Errorf( - "Error retrieving workspace %s: %w", wsID, err) - } - drp, err := config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, ws.ID) - if err != nil { - return fmt.Errorf( - "Error retrieving data retention policy for workspace %s: %w", ws.ID, err) - } + if wsID != "" { + ws, err := config.Client.Workspaces.ReadByID(ctx, wsID) + if err != nil { + return fmt.Errorf( + "Error retrieving workspace %s: %w", wsID, err) + } - *policy = *drp + drp, err := config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, ws.ID) + if err != nil { + return fmt.Errorf( + "Error retrieving data retention policy for workspace %s: %w", ws.ID, err) + } - return nil - } -} + *policy = *drp + } else { + orgName := rs.Primary.Attributes["organization"] -func testAccCheckTFEDataRetentionPolicyAttributes( - policy *tfe.DataRetentionPolicyChoice) resource.TestCheckFunc { - return func(s *terraform.State) error { - if policy.DataRetentionPolicyDeleteOlder == nil { - return fmt.Errorf("policy wasn't of type 'delete_older'") - } + drp, err := config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, orgName) + if err != nil { + return fmt.Errorf( + "Error retrieving data retention policy for organization %s: %w", orgName, err) + } - if policy.DataRetentionPolicyDeleteOlder.DeleteOlderThanNDays != 42 { - return fmt.Errorf("bad delete_older_than_n_days: %d", policy.DataRetentionPolicyDeleteOlder.DeleteOlderThanNDays) + *policy = *drp } return nil From 13ed4e9e581a1eda39fc6fd91180852b8e721c47 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Thu, 13 Jun 2024 13:31:20 -0700 Subject: [PATCH 399/420] fix issues with organization not being set after applies and add support for dont_delete policies --- internal/provider/data_retention_policy.go | 22 ++- .../resource_tfe_data_retention_policy.go | 119 ++++++++++---- ...resource_tfe_data_retention_policy_test.go | 146 +++++++++++++++++- 3 files changed, 249 insertions(+), 38 deletions(-) diff --git a/internal/provider/data_retention_policy.go b/internal/provider/data_retention_policy.go index c3b124521..771c7b106 100644 --- a/internal/provider/data_retention_policy.go +++ b/internal/provider/data_retention_policy.go @@ -61,11 +61,31 @@ func modelFromTFEDataRetentionPolicyDontDelete(model modelTFEDataRetentionPolicy } } +func modelFromTFELegacyDataRetentionPolicy(ctx context.Context, model modelTFEDataRetentionPolicy, legacy *tfe.DataRetentionPolicy) (modelTFEDataRetentionPolicy, diag.Diagnostics) { + deleteOlderThan := modelTFEDeleteOlderThan{ + Days: types.NumberValue(big.NewFloat(float64(legacy.DeleteOlderThanNDays))), + } + deleteOlderThanObject, diags := types.ObjectValueFrom(ctx, deleteOlderThan.AttributeTypes(), deleteOlderThan) + + return modelTFEDataRetentionPolicy{ + ID: types.StringValue(legacy.ID), + Organization: model.Organization, + WorkspaceId: model.WorkspaceId, + DeleteOlderThan: deleteOlderThanObject, + DontDelete: types.ObjectNull(map[string]attr.Type{}), + }, diags +} + func modelFromTFEDataRetentionPolicyChoice(ctx context.Context, model modelTFEDataRetentionPolicy, choice *tfe.DataRetentionPolicyChoice) (modelTFEDataRetentionPolicy, diag.Diagnostics) { if choice.DataRetentionPolicyDeleteOlder != nil { return modelFromTFEDataRetentionPolicyDeleteOlder(ctx, model, choice.DataRetentionPolicyDeleteOlder) } var emptyDiag []diag.Diagnostic - return modelFromTFEDataRetentionPolicyDontDelete(model, choice.DataRetentionPolicyDontDelete), emptyDiag + if choice.DataRetentionPolicyDontDelete != nil { + return modelFromTFEDataRetentionPolicyDontDelete(model, choice.DataRetentionPolicyDontDelete), emptyDiag + } + + legacyPolicy := choice.ConvertToLegacyStruct() + return modelFromTFELegacyDataRetentionPolicy(ctx, model, legacyPolicy) } diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 4f363318c..2e7542fa9 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -3,8 +3,6 @@ package provider import ( "context" "fmt" - "strings" - "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -16,14 +14,16 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/diag" + "strings" "github.com/hashicorp/terraform-plugin-framework/resource/schema/numberplanmodifier" + "github.com/hashicorp/terraform-plugin-framework-validators/numbervalidator" ) // Ensure provider defined types fully satisfy framework interfaces. var _ resource.Resource = &resourceTFEDataRetentionPolicy{} var _ resource.ResourceWithConfigure = &resourceTFEDataRetentionPolicy{} var _ resource.ResourceWithImportState = &resourceTFEDataRetentionPolicy{} -var _ resource.ResourceWithModifyPlan = &resourceTFEDataRetentionPolicy{} func NewDataRetentionPolicyResource() resource.Resource { return &resourceTFEDataRetentionPolicy{} @@ -38,10 +38,6 @@ func (r *resourceTFEDataRetentionPolicy) Metadata(ctx context.Context, req resou resp.TypeName = req.ProviderTypeName + "_data_retention_policy" } -func (r *resourceTFEDataRetentionPolicy) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - modifyPlanForDefaultOrganizationChange(ctx, r.config.Organization, req.State, req.Config, req.Plan, resp) -} - func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ Description: "Manages the data retention policies for a specific workspace or an the entire organization.", @@ -60,6 +56,7 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc Optional: true, Computed: true, PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace(), }, }, @@ -77,17 +74,17 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc Attributes: map[string]schema.Attribute{ "days": schema.NumberAttribute{ Description: "Number of days", - Required: true, + Optional: true, PlanModifiers: []planmodifier.Number{ numberplanmodifier.RequiresReplace(), }, + Validators: []validator.Number{ + numbervalidator.ExactlyOneOf( + path.MatchRelative().AtParent().AtParent().AtName("dont_delete"), + ), + }, }, }, - Validators: []validator.Object{ - objectvalidator.ExactlyOneOf( - path.MatchRelative().AtParent().AtName("dont_delete"), - ), - }, }, "dont_delete": schema.SingleNestedBlock{ Attributes: map[string]schema.Attribute{}, @@ -128,11 +125,7 @@ func (r *resourceTFEDataRetentionPolicy) Create(ctx context.Context, req resourc return } - var organization string - if plan.WorkspaceId.IsNull() { - resp.Diagnostics.Append(r.config.dataOrDefaultOrganization(ctx, req.Plan, &organization)...) - plan.Organization = types.StringValue(organization) - } + r.ensureOrganizationIsSet(ctx, &plan, req.Plan, &resp.Diagnostics) if resp.Diagnostics.HasError() { return @@ -150,6 +143,19 @@ func (r *resourceTFEDataRetentionPolicy) Create(ctx context.Context, req resourc } +func (r *resourceTFEDataRetentionPolicy) ensureOrganizationIsSet(ctx context.Context, model *modelTFEDataRetentionPolicy, data AttrGettable, diags *diag.Diagnostics) { + if !model.Organization.IsUnknown() || model.Organization.ValueString() != "" { + // skip this method if the organization has already been set + return + } + + if model.WorkspaceId.IsNull() { + var organization string + diags.Append(r.config.dataOrDefaultOrganization(ctx, data, &organization)...) + model.Organization = types.StringValue(organization) + } +} + func (r *resourceTFEDataRetentionPolicy) createDeleteOlderThanRetentionPolicy(ctx context.Context, plan modelTFEDataRetentionPolicy, resp *resource.CreateResponse) { deleteOlderThan := &modelTFEDeleteOlderThan{} @@ -183,8 +189,12 @@ func (r *resourceTFEDataRetentionPolicy) createDeleteOlderThanRetentionPolicy(ct return } + // set organization if it is still not known after creating the data retention policy + r.ensureOrganizationSetAfterApply(&result, &resp.Diagnostics) + // Save data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + diags = resp.State.Set(ctx, &result) + resp.Diagnostics.Append(diags...) } func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx context.Context, plan modelTFEDataRetentionPolicy, resp *resource.CreateResponse) { @@ -213,8 +223,23 @@ func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx con result := modelFromTFEDataRetentionPolicyDontDelete(plan, dataRetentionPolicy) + // set organization if it is still not known after creating the data retention policy + r.ensureOrganizationSetAfterApply(&result, &resp.Diagnostics) + // Save data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + diags = resp.State.Set(ctx, &result) + resp.Diagnostics.Append(diags...) +} + +func (r *resourceTFEDataRetentionPolicy) ensureOrganizationSetAfterApply(policy *modelTFEDataRetentionPolicy, diags *diag.Diagnostics) { + if policy.Organization.IsUnknown() { + workspace, err := r.config.Client.Workspaces.ReadByID(ctx, policy.WorkspaceId.ValueString()) + if err != nil { + diags.AddError("Unable to create data retention policy", err.Error()) + return + } + policy.Organization = types.StringValue(workspace.Organization.Name) + } } func (r *resourceTFEDataRetentionPolicy) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -289,18 +314,50 @@ func (r *resourceTFEDataRetentionPolicy) Delete(ctx context.Context, req resourc } func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - s := strings.SplitN(req.ID, "/", 2) + s := strings.Split(req.ID, "/") + if len(s) >= 3 { + resp.Diagnostics.AddError("Error importing workspace settings", fmt.Sprintf( + "invalid workspace input format: %s (expected / or )", + req.ID, + )) + } else if len(s) == 2 { + workspaceID, err := fetchWorkspaceExternalID(s[0]+"/"+s[1], r.config.Client) + if err != nil { + resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( + "error retrieving workspace with name %s from organization %s: %s", s[1], s[0], err.Error(), + )) + } - if len(s) != 2 && len(s) != 1 { - resp.Diagnostics.AddError( - "Error importing variable", - fmt.Sprintf("Invalid variable import format: %s (expected / or )", req.ID), - ) - return + policy, err := r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, workspaceID) + if err != nil { + resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( + "error retrieving data policy for workspace %s from organization %s: %s", s[1], s[0], err.Error(), + )) + } + + req.ID = r.getPolicyID(policy) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), workspaceID)...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) + } else if len(s) == 1 { + policy, err := r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, s[0]) + if err != nil { + resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( + "error retrieving data policy for organization %s: %s", s[0], err.Error(), + )) + } + req.ID = r.getPolicyID(policy) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) + } +} + +func (r *resourceTFEDataRetentionPolicy) getPolicyID(policy *tfe.DataRetentionPolicyChoice) string { + if policy.DataRetentionPolicyDeleteOlder != nil { + return policy.DataRetentionPolicyDeleteOlder.ID + } + + if policy.DataRetentionPolicyDontDelete != nil { + return policy.DataRetentionPolicyDontDelete.ID } - org := s[0] - wsId := s[1] - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), org)...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), wsId)...) + return policy.ConvertToLegacyStruct().ID } diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go index e07529a3c..7d86a3281 100644 --- a/internal/provider/resource_tfe_data_retention_policy_test.go +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -29,11 +29,25 @@ func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), ), }, + { + Config: testAccTFEDataRetentionPolicy_basic(rInt, 1337), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "1337"), + ), + }, + { + ResourceName: "tfe_data_retention_policy.foobar", + ImportState: true, + ImportStateId: fmt.Sprintf("tst-terraform-%d/workspace-test", rInt), + ImportStateVerify: true, + }, }, }) } -func TestAccTFEDataRetentionPolicy_update(t *testing.T) { +func TestAccTFEDataRetentionPolicy_dontdelete_basic(t *testing.T) { policy := &tfe.DataRetentionPolicyChoice{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -43,27 +57,60 @@ func TestAccTFEDataRetentionPolicy_update(t *testing.T) { CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, Steps: []resource.TestStep{ { - Config: testAccTFEDataRetentionPolicy_basic(rInt, 42), + Config: testAccTFEDataRetentionPolicy_dontdelete_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttrSet("tfe_data_retention_policy.foobar", "dont_delete.%"), + ), + }, + { + ResourceName: "tfe_data_retention_policy.foobar", + ImportState: true, + ImportStateId: fmt.Sprintf("tst-terraform-%d/workspace-test", rInt), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFEDataRetentionPolicy_explicit_organization(t *testing.T) { + policy := &tfe.DataRetentionPolicyChoice{} + orgName, _ := setupDefaultOrganization(t) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_explicit_organization(orgName, 42), Check: resource.ComposeTestCheckFunc( testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), resource.TestCheckResourceAttr( "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), ), }, - { - Config: testAccTFEDataRetentionPolicy_basic(rInt, 1337), + Config: testAccTFEDataRetentionPolicy_explicit_organization(orgName, 1337), Check: resource.ComposeTestCheckFunc( testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), resource.TestCheckResourceAttr( "tfe_data_retention_policy.foobar", "delete_older_than.days", "1337"), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "organization", orgName), ), }, + { + ResourceName: "tfe_data_retention_policy.foobar", + ImportState: true, + ImportStateId: orgName, + ImportStateVerify: true, + }, }, }) } -func TestAccTFEDataRetentionPolicy_organization_level(t *testing.T) { +func TestAccTFEDataRetentionPolicy_implicit_organization(t *testing.T) { policy := &tfe.DataRetentionPolicyChoice{} defaultOrgName, _ := setupDefaultOrganization(t) @@ -87,9 +134,52 @@ func TestAccTFEDataRetentionPolicy_organization_level(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), resource.TestCheckResourceAttr( - "tfe_data_retention_policy.foobar", "delete_older_than.days", "1337"), + "tfe_data_retention_policy.foobar", "organization", defaultOrgName), ), }, + { + ResourceName: "tfe_data_retention_policy.foobar", + ImportState: true, + ImportStateId: defaultOrgName, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccTFEDataRetentionPolicy_dontdelete_organization_level(t *testing.T) { + policy := &tfe.DataRetentionPolicyChoice{} + defaultOrgName, _ := setupDefaultOrganization(t) + + os.Setenv("TFE_ORGANIZATION", defaultOrgName) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_dontDelete_implicit_organization(), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr("tfe_data_retention_policy.foobar", "organization", defaultOrgName), + resource.TestCheckResourceAttrSet("tfe_data_retention_policy.foobar", "dont_delete.%"), + ), + }, + { + Config: testAccTFEDataRetentionPolicy_dontDelete_explicit_organization(defaultOrgName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr("tfe_data_retention_policy.foobar", "organization", defaultOrgName), + resource.TestCheckResourceAttrSet("tfe_data_retention_policy.foobar", "dont_delete.%"), + ), + }, + { + ResourceName: "tfe_data_retention_policy.foobar", + ImportState: true, + ImportStateId: defaultOrgName, + ImportStateVerify: true, + }, }, }) } @@ -115,6 +205,35 @@ resource "tfe_data_retention_policy" "foobar" { }`, rInt, deleteOlderThan) } +func testAccTFEDataRetentionPolicy_dontdelete_basic(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test" + organization = tfe_organization.foobar.id +} + +resource "tfe_data_retention_policy" "foobar" { + workspace_id = tfe_workspace.foobar.id + + dont_delete {} +}`, rInt) +} + +func testAccTFEDataRetentionPolicy_explicit_organization(organization string, deleteOlderThan int) string { + return fmt.Sprintf(` +resource "tfe_data_retention_policy" "foobar" { + organization = "%s" + delete_older_than { + days = %d + } +}`, organization, deleteOlderThan) +} + func testAccTFEDataRetentionPolicy_implicit_organization(deleteOlderThan int) string { return fmt.Sprintf(` resource "tfe_data_retention_policy" "foobar" { @@ -124,6 +243,21 @@ resource "tfe_data_retention_policy" "foobar" { }`, deleteOlderThan) } +func testAccTFEDataRetentionPolicy_dontDelete_explicit_organization(orgName string) string { + return fmt.Sprintf(` +resource "tfe_data_retention_policy" "foobar" { + organization = "%s" + dont_delete {} +}`, orgName) +} + +func testAccTFEDataRetentionPolicy_dontDelete_implicit_organization() string { + return ` +resource "tfe_data_retention_policy" "foobar" { + dont_delete {} +}` +} + func testAccCheckTFEDataRetentionPolicyExists( n string, policy *tfe.DataRetentionPolicyChoice) resource.TestCheckFunc { return func(s *terraform.State) error { From a35da83af6afa56326a43d2c20aa778e4b3a5f6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:20:17 +0000 Subject: [PATCH 400/420] Build(deps): Bump github.com/hashicorp/go-tfe from 1.53.0 to 1.56.0 Bumps [github.com/hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) from 1.53.0 to 1.56.0. - [Release notes](https://github.com/hashicorp/go-tfe/releases) - [Changelog](https://github.com/hashicorp/go-tfe/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-tfe/compare/v1.53.0...v1.56.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-tfe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 77e20ccf1..ddb7eda4b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-slug v0.15.0 - github.com/hashicorp/go-tfe v1.53.0 + github.com/hashicorp/go-tfe v1.56.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl/v2 v2.19.1 // indirect @@ -42,7 +42,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 - github.com/hashicorp/jsonapi v1.3.1 // indirect + github.com/hashicorp/jsonapi v1.3.1 github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.20.0 // indirect github.com/hashicorp/terraform-json v0.21.0 // indirect diff --git a/go.sum b/go.sum index 2e04030ca..040e9509f 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-slug v0.15.0 h1:AhMnE6JIyW0KoDJlmRDwv4xd52a5ZK3VdioQ7SMmZhI= github.com/hashicorp/go-slug v0.15.0/go.mod h1:THWVTAXwJEinbsp4/bBRcmbaO5EYNLTqxbG4tZ3gCYQ= -github.com/hashicorp/go-tfe v1.53.0 h1:FlmR+45MB9rTosra2ZGPp0XtdxiRTmdTAJAgX94WK9k= -github.com/hashicorp/go-tfe v1.53.0/go.mod h1:XnTtBj3tVQ4uFkcFsv8Grn+O1CVcIcceL1uc2AgUcaU= +github.com/hashicorp/go-tfe v1.56.0 h1:AjBTo7TmWoz42l4KhH65Q3NvjRD5yD3XZrG1tzFySeI= +github.com/hashicorp/go-tfe v1.56.0/go.mod h1:XnTtBj3tVQ4uFkcFsv8Grn+O1CVcIcceL1uc2AgUcaU= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= From b075a12dcfeec95df72296b6cd0cbad2221bad2d Mon Sep 17 00:00:00 2001 From: Sebastian Rivera Date: Thu, 13 Jun 2024 17:56:39 -0400 Subject: [PATCH 401/420] Rebrand provider meta --- META.d/_summary.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META.d/_summary.yaml b/META.d/_summary.yaml index 63e8ef1ba..491569886 100644 --- a/META.d/_summary.yaml +++ b/META.d/_summary.yaml @@ -9,5 +9,5 @@ category: library summary: owner: team-tf-cli - description: Official Terraform Cloud/Enterprise provider, maintained by HashiCorp. Provision Terraform Cloud or Terraform Enterprise - with Terraform! + description: Official HCP Terraform and Terraform Enterprise provider, maintained by HashiCorp. Provision HCP Terraform or Terraform Enterprise - with Terraform! visibility: external From b4add102e0c0a1a348749642c341fa124b23726c Mon Sep 17 00:00:00 2001 From: Chris Trombley Date: Thu, 13 Jun 2024 12:51:56 -0700 Subject: [PATCH 402/420] chore: update changelog for 0.56 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 672418c61..159c4a780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased +## v0.56.0 + ENHANCEMENTS: * `r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11 [#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304) * `r/tfe_workspace`: Add an `auto_destroy_at` attribute for scheduling an auto-destroy run in the future, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) From ce5b918ed044d2060d5e3967bbd7a70d5a15443f Mon Sep 17 00:00:00 2001 From: Chris Trombley Date: Thu, 13 Jun 2024 14:29:42 -0700 Subject: [PATCH 403/420] chore: bump versions in readme & docs --- README.md | 4 ++-- website/docs/index.html.markdown | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dd66eaa1e..9fe37ec0c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Declare the provider in your configuration and `terraform init` will automatical terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -45,7 +45,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.56.0" ... } ``` diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 282c4cbb5..a69008c85 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -75,7 +75,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -88,7 +88,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.53.0" + version = "~> 0.56.0" ... } ``` @@ -101,7 +101,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `app.terraform.io` token = var.token - version = "~> 0.53.0" + version = "~> 0.56.0" } # Create an organization From 9df5f4b0481a8e7d6f587f6528ce03b4d5c664a2 Mon Sep 17 00:00:00 2001 From: ctrombley <413389+ctrombley@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:59:23 +0000 Subject: [PATCH 404/420] cdktf: update documentation --- CHANGELOG.md | 4 +- .../cdktf/csharp/d/ip_ranges.html.markdown | 4 +- .../cdktf/csharp/d/oauth_client.html.markdown | 9 +- .../cdktf/csharp/d/organization.html.markdown | 2 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 4 +- .../docs/cdktf/csharp/d/slug.html.markdown | 4 +- .../cdktf/csharp/d/workspace.html.markdown | 7 +- .../csharp/d/workspace_run_task.html.markdown | 4 +- website/docs/cdktf/csharp/index.html.markdown | 12 +- ...gent_pool_allowed_workspaces.html.markdown | 61 +++---- .../cdktf/csharp/r/agent_token.html.markdown | 4 +- .../notification_configuration.html.markdown | 2 +- .../cdktf/csharp/r/oauth_client.html.markdown | 23 ++- .../cdktf/csharp/r/opa_version.html.markdown | 4 +- .../cdktf/csharp/r/organization.html.markdown | 2 +- ...rganization_default_settings.html.markdown | 4 +- .../r/organization_membership.html.markdown | 4 +- .../r/organization_run_task.html.markdown | 4 +- .../docs/cdktf/csharp/r/project.html.markdown | 5 +- .../r/project_oauth_client.html.markdown | 77 +++++++++ .../csharp/r/registry_module.html.markdown | 3 +- .../cdktf/csharp/r/run_trigger.html.markdown | 4 +- .../csharp/r/sentinel_version.html.markdown | 2 +- .../docs/cdktf/csharp/r/team.html.markdown | 7 +- .../r/team_organization_member.html.markdown | 4 +- .../r/team_organization_members.html.markdown | 4 +- .../csharp/r/terraform_version.html.markdown | 4 +- .../csharp/r/tfe_test_variable.html.markdown | 55 ++++++ .../cdktf/csharp/r/variable.html.markdown | 4 +- .../cdktf/csharp/r/workspace.html.markdown | 7 +- .../csharp/r/workspace_run.html.markdown | 2 +- .../csharp/r/workspace_run_task.html.markdown | 4 +- .../csharp/r/workspace_settings.markdown | 4 +- .../docs/cdktf/go/d/ip_ranges.html.markdown | 4 +- .../cdktf/go/d/oauth_client.html.markdown | 9 +- .../cdktf/go/d/organization.html.markdown | 2 +- .../d/organization_membership.html.markdown | 2 +- .../go/d/organization_run_task.html.markdown | 4 +- website/docs/cdktf/go/d/slug.html.markdown | 4 +- .../docs/cdktf/go/d/workspace.html.markdown | 3 +- .../go/d/workspace_run_task.html.markdown | 4 +- website/docs/cdktf/go/index.html.markdown | 12 +- ...gent_pool_allowed_workspaces.html.markdown | 65 ++++--- .../docs/cdktf/go/r/agent_token.html.markdown | 4 +- .../notification_configuration.html.markdown | 2 +- .../cdktf/go/r/oauth_client.html.markdown | 17 +- .../docs/cdktf/go/r/opa_version.html.markdown | 2 +- .../cdktf/go/r/organization.html.markdown | 2 +- ...rganization_default_settings.html.markdown | 4 +- .../r/organization_membership.html.markdown | 4 +- .../go/r/organization_run_task.html.markdown | 4 +- website/docs/cdktf/go/r/project.html.markdown | 5 +- .../go/r/project_oauth_client.html.markdown | 83 +++++++++ .../cdktf/go/r/registry_module.html.markdown | 3 +- .../docs/cdktf/go/r/run_trigger.html.markdown | 4 +- .../cdktf/go/r/sentinel_version.html.markdown | 2 +- website/docs/cdktf/go/r/team.html.markdown | 7 +- .../r/team_organization_member.html.markdown | 4 +- .../r/team_organization_members.html.markdown | 12 +- .../go/r/terraform_version.html.markdown | 28 +--- .../go/r/tfe_test_variable.html.markdown | 55 ++++++ .../docs/cdktf/go/r/variable.html.markdown | 4 +- .../docs/cdktf/go/r/workspace.html.markdown | 11 +- .../cdktf/go/r/workspace_run.html.markdown | 18 +- .../go/r/workspace_run_task.html.markdown | 4 +- .../cdktf/go/r/workspace_settings.markdown | 24 +-- .../docs/cdktf/java/d/ip_ranges.html.markdown | 4 +- .../cdktf/java/d/oauth_client.html.markdown | 9 +- .../cdktf/java/d/organization.html.markdown | 2 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 4 +- website/docs/cdktf/java/d/slug.html.markdown | 4 +- .../docs/cdktf/java/d/workspace.html.markdown | 3 +- .../java/d/workspace_run_task.html.markdown | 4 +- website/docs/cdktf/java/index.html.markdown | 12 +- ...gent_pool_allowed_workspaces.html.markdown | 63 ++++--- .../cdktf/java/r/agent_token.html.markdown | 4 +- .../notification_configuration.html.markdown | 2 +- .../cdktf/java/r/oauth_client.html.markdown | 25 +-- .../cdktf/java/r/opa_version.html.markdown | 2 +- .../cdktf/java/r/organization.html.markdown | 2 +- ...rganization_default_settings.html.markdown | 4 +- .../r/organization_membership.html.markdown | 4 +- .../r/organization_run_task.html.markdown | 4 +- .../docs/cdktf/java/r/project.html.markdown | 5 +- .../java/r/project_oauth_client.html.markdown | 79 +++++++++ .../java/r/registry_module.html.markdown | 3 +- .../cdktf/java/r/run_trigger.html.markdown | 4 +- .../java/r/sentinel_version.html.markdown | 2 +- website/docs/cdktf/java/r/team.html.markdown | 7 +- .../r/team_organization_member.html.markdown | 4 +- .../r/team_organization_members.html.markdown | 4 +- .../java/r/terraform_version.html.markdown | 4 +- .../java/r/tfe_test_variable.html.markdown | 55 ++++++ .../docs/cdktf/java/r/variable.html.markdown | 4 +- .../docs/cdktf/java/r/workspace.html.markdown | 7 +- .../cdktf/java/r/workspace_run.html.markdown | 2 +- .../java/r/workspace_run_task.html.markdown | 4 +- .../cdktf/java/r/workspace_settings.markdown | 4 +- .../d/github_installation.html.markdown | 7 +- .../cdktf/python/d/ip_ranges.html.markdown | 2 +- .../python/d/no_code_module.html.markdown | 33 ++-- .../cdktf/python/d/oauth_client.html.markdown | 7 +- .../cdktf/python/d/organization.html.markdown | 3 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../cdktf/python/d/policy_set.html.markdown | 2 +- .../python/d/registry_gpg_key.html.markdown | 17 +- .../python/d/registry_gpg_keys.html.markdown | 17 +- .../python/d/registry_provider.html.markdown | 32 ++-- .../python/d/registry_providers.html.markdown | 47 +++--- .../docs/cdktf/python/d/slug.html.markdown | 2 +- .../cdktf/python/d/workspace.html.markdown | 3 +- .../python/d/workspace_run_task.html.markdown | 2 +- website/docs/cdktf/python/index.html.markdown | 14 +- .../r/admin_organization_settings.markdown | 6 +- ...gent_pool_allowed_workspaces.html.markdown | 62 +++---- .../cdktf/python/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 2 +- .../cdktf/python/r/oauth_client.html.markdown | 14 +- .../cdktf/python/r/opa_version.html.markdown | 17 +- .../cdktf/python/r/organization.html.markdown | 2 +- ...rganization_default_settings.html.markdown | 37 ++-- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../cdktf/python/r/policy_set.html.markdown | 81 ++++----- .../docs/cdktf/python/r/project.html.markdown | 3 +- .../r/project_oauth_client.html.markdown | 74 ++++++++ .../python/r/registry_gpg_key.html.markdown | 23 +-- .../python/r/registry_module.html.markdown | 28 ++-- .../python/r/registry_provider.html.markdown | 44 +++-- .../cdktf/python/r/run_trigger.html.markdown | 2 +- .../python/r/sentinel_version.html.markdown | 17 +- .../docs/cdktf/python/r/team.html.markdown | 5 +- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 2 +- .../r/team_project_access.html.markdown | 114 ++++++------- .../python/r/terraform_version.html.markdown | 2 +- .../python/r/tfe_test_variable.html.markdown | 55 ++++++ .../cdktf/python/r/variable.html.markdown | 2 +- .../cdktf/python/r/workspace.html.markdown | 37 ++-- .../python/r/workspace_run.html.markdown | 2 +- .../python/r/workspace_run_task.html.markdown | 2 +- .../python/r/workspace_settings.markdown | 100 +++++------ .../d/github_installation.html.markdown | 9 +- .../typescript/d/ip_ranges.html.markdown | 2 +- .../typescript/d/no_code_module.html.markdown | 36 +--- .../typescript/d/oauth_client.html.markdown | 11 +- .../typescript/d/organization.html.markdown | 5 +- .../d/organization_membership.html.markdown | 2 +- .../d/organization_run_task.html.markdown | 2 +- .../typescript/d/policy_set.html.markdown | 2 +- .../d/registry_gpg_key.html.markdown | 21 +-- .../d/registry_gpg_keys.html.markdown | 21 +-- .../d/registry_provider.html.markdown | 40 ++--- .../d/registry_providers.html.markdown | 69 ++++---- .../cdktf/typescript/d/slug.html.markdown | 4 +- .../typescript/d/workspace.html.markdown | 5 +- .../d/workspace_run_task.html.markdown | 2 +- .../docs/cdktf/typescript/index.html.markdown | 30 ++-- .../r/admin_organization_settings.markdown | 6 +- ...gent_pool_allowed_workspaces.html.markdown | 85 ++++------ .../typescript/r/agent_token.html.markdown | 2 +- .../notification_configuration.html.markdown | 18 +- .../typescript/r/oauth_client.html.markdown | 29 ++-- .../typescript/r/opa_version.html.markdown | 21 +-- .../typescript/r/organization.html.markdown | 8 +- ...rganization_default_settings.html.markdown | 69 ++++---- .../r/organization_membership.html.markdown | 2 +- .../r/organization_run_task.html.markdown | 2 +- .../typescript/r/policy_set.html.markdown | 83 ++++----- .../cdktf/typescript/r/project.html.markdown | 3 +- .../r/project_oauth_client.html.markdown | 81 +++++++++ .../r/registry_gpg_key.html.markdown | 24 +-- .../r/registry_module.html.markdown | 60 ++++--- .../r/registry_provider.html.markdown | 84 +++++----- .../typescript/r/run_trigger.html.markdown | 2 +- .../r/sentinel_version.html.markdown | 21 +-- .../cdktf/typescript/r/team.html.markdown | 5 +- .../r/team_organization_member.html.markdown | 2 +- .../r/team_organization_members.html.markdown | 6 +- .../r/team_project_access.html.markdown | 76 ++++----- .../r/terraform_version.html.markdown | 2 +- .../r/tfe_test_variable.html.markdown | 55 ++++++ .../cdktf/typescript/r/variable.html.markdown | 2 +- .../typescript/r/workspace.html.markdown | 41 +++-- .../typescript/r/workspace_run.html.markdown | 12 +- .../r/workspace_run_task.html.markdown | 4 +- .../typescript/r/workspace_settings.markdown | 158 +++++++++--------- 190 files changed, 1926 insertions(+), 1331 deletions(-) create mode 100644 website/docs/cdktf/csharp/r/project_oauth_client.html.markdown create mode 100644 website/docs/cdktf/csharp/r/tfe_test_variable.html.markdown create mode 100644 website/docs/cdktf/go/r/project_oauth_client.html.markdown create mode 100644 website/docs/cdktf/go/r/tfe_test_variable.html.markdown create mode 100644 website/docs/cdktf/java/r/project_oauth_client.html.markdown create mode 100644 website/docs/cdktf/java/r/tfe_test_variable.html.markdown create mode 100644 website/docs/cdktf/python/r/project_oauth_client.html.markdown create mode 100644 website/docs/cdktf/python/r/tfe_test_variable.html.markdown create mode 100644 website/docs/cdktf/typescript/r/project_oauth_client.html.markdown create mode 100644 website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 159c4a780..fc436c232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ENHANCEMENTS: * `d/tfe_workspace`: Add an `auto_destroy_at` attribute for reading a scheduled auto-destroy, by @notchairmk [1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354) * `r/tfe_registry_module`: Add `initial_version` support for Branch Based Modules by @aaabdelgany [#1363](https://github.com/hashicorp/terraform-provider-tfe/pull/1363) * `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @roleesinhaHC [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255) +* `r/tfe_project`: Increase the Project name length from 36 to 40 characters @hs26gill [#1351](https://github.com/hashicorp/terraform-provider-tfe/pull/1351) BUG FIXES: * `r/tfe_registry_module`: Prevents constant diff after a successful apply when `tags` and `tests_enabled` is not set by @Uk1288 [#1357](https://github.com/hashicorp/terraform-provider-tfe/pull/1357) @@ -17,9 +18,6 @@ BUG FIXES: FEATURES: * `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) -ENHANCEMENTS: -* `r/tfe_project`: Increase the Project name length from 36 to 40 characters @hs26gill [#1351](https://github.com/hashicorp/terraform-provider-tfe/pull/1351) - ## v0.54.0 ENHANCEMENTS: diff --git a/website/docs/cdktf/csharp/d/ip_ranges.html.markdown b/website/docs/cdktf/csharp/d/ip_ranges.html.markdown index 88e31258f..d176d35f9 100644 --- a/website/docs/cdktf/csharp/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/csharp/d/ip_ranges.html.markdown @@ -5,6 +5,8 @@ description: |- Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- + + # Data Source: tfe_ip_ranges Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). @@ -43,4 +45,4 @@ The following attributes are exported: * `Vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/oauth_client.html.markdown b/website/docs/cdktf/csharp/d/oauth_client.html.markdown index 88facddb5..8278ecadc 100644 --- a/website/docs/cdktf/csharp/d/oauth_client.html.markdown +++ b/website/docs/cdktf/csharp/d/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an OAuth client. --- + + # Data Source: tfe_oauth_client Use this data source to get information about an OAuth client. @@ -81,7 +83,7 @@ be set. * `OauthClientId` - (Optional) ID of the OAuth client. * `Organization` - (Optional) The name of the organization in which to search. * `ServiceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `AdoServer`, `AdoServices`,`BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), + must be one of: `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. @@ -99,5 +101,6 @@ In addition to all arguments above, the following attributes are exported: * `Organization` - The organization in which the OAuth client is registered. * `ServiceProvider` - The API identifier of the OAuth service provider. * `ServiceProviderDisplayName` - The display name of the OAuth service provider. - - \ No newline at end of file +* `OrganizationScoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `ProjectIds` - IDs of the projects that use the oauth client. + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/organization.html.markdown b/website/docs/cdktf/csharp/d/organization.html.markdown index da3f0a42e..caa7ddf97 100644 --- a/website/docs/cdktf/csharp/d/organization.html.markdown +++ b/website/docs/cdktf/csharp/d/organization.html.markdown @@ -49,4 +49,4 @@ In addition to all arguments above, the following attributes are exported: * `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `DefaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/organization_membership.html.markdown b/website/docs/cdktf/csharp/d/organization_membership.html.markdown index 2ee63b153..461260411 100644 --- a/website/docs/cdktf/csharp/d/organization_membership.html.markdown +++ b/website/docs/cdktf/csharp/d/organization_membership.html.markdown @@ -98,4 +98,4 @@ In addition to all arguments above, the following attributes are exported: * `UserId` - The ID of the user associated with the organization membership. * `Username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/organization_run_task.html.markdown b/website/docs/cdktf/csharp/d/organization_run_task.html.markdown index 6d6651039..6511cff64 100644 --- a/website/docs/cdktf/csharp/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/csharp/d/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Run task. --- + + # Data Source: tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -48,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the task. * `Url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/slug.html.markdown b/website/docs/cdktf/csharp/d/slug.html.markdown index 97b8add0b..e458e21ca 100644 --- a/website/docs/cdktf/csharp/d/slug.html.markdown +++ b/website/docs/cdktf/csharp/d/slug.html.markdown @@ -4,6 +4,8 @@ page_title: "Terraform Enterprise: tfe_slug" description: |- Manages files. --- + + # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem @@ -48,4 +50,4 @@ The following arguments are supported: * `SourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/workspace.html.markdown b/website/docs/cdktf/csharp/d/workspace.html.markdown index 3d1c9023a..f3302b5c4 100644 --- a/website/docs/cdktf/csharp/d/workspace.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace.html.markdown @@ -48,11 +48,8 @@ In addition to all arguments above, the following attributes are exported: * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. -<<<<<<< HEAD +* `AutoDestroyAt` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `AssessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. -======= -* `AssessmentsEnabled` - (Available only in Terraform Cloud) Indicates whether health assessments such as drift detection are enabled for the workspace. ->>>>>>> adf61bce (cdktf: update documentation) * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). * `RemoteStateConsumerIds` - (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used if `GlobalRemoteState` is set to `True`. @@ -92,4 +89,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown b/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown index c69ab0109..0161b2f8d 100644 --- a/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/csharp/d/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Workspace Run task. --- + + # Data Source: tfe_workspace_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -46,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the Workspace Run task. * `Stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/index.html.markdown b/website/docs/cdktf/csharp/index.html.markdown index 070fd2e93..232ef7ff2 100644 --- a/website/docs/cdktf/csharp/index.html.markdown +++ b/website/docs/cdktf/csharp/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.55.0" + version = "~> 0.56.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.55.0" + version = "~> 0.56.0" } # Create an organization @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `Hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. +* `Hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TfeHostname` environment variable. -* `Token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. +* `Token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `SslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `False`. Can be overridden setting the `TfeSslSkipVerify` @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown index 89e616d85..fa7a50fd3 100644 --- a/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_pool_allowed_workspaces.html.markdown @@ -19,34 +19,36 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```csharp -using Constructs; -using HashiCorp.Cdktf; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -using Gen.Providers.Tfe; -class MyConvertedCode : TerraformStack -{ - public MyConvertedCode(Construct scope, string name) : base(scope, name) - { - var tfeOrganizationTestOrganization = new Organization.Organization(this, "test-organization", new OrganizationConfig { - Email = "admin@company.com", - Name = "my-org-name" - }); - var tfeWorkspaceTestWorkspace = new Workspace.Workspace(this, "test-workspace", new WorkspaceConfig { - Name = "my-workspace-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name) - }); - var tfeAgentPoolTestAgentPool = new AgentPool.AgentPool(this, "test-agent-pool", new AgentPoolConfig { - Name = "my-agent-pool-name", - Organization = Token.AsString(tfeOrganizationTestOrganization.Name), - OrganizationScoped = false - }); - new AgentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig { - AgentPoolId = Token.AsString(tfeAgentPoolTestAgentPool.Id), - AllowedWorkspaceIds = new [] { Token.AsString(tfeWorkspaceTestWorkspace.Id) } - }); - } +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -66,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/agent_token.html.markdown b/website/docs/cdktf/csharp/r/agent_token.html.markdown index 46388e5e8..c581bdd0c 100644 --- a/website/docs/cdktf/csharp/r/agent_token.html.markdown +++ b/website/docs/cdktf/csharp/r/agent_token.html.markdown @@ -5,6 +5,8 @@ description: |- Manages agent tokens --- + + # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. @@ -53,4 +55,4 @@ The following arguments are supported: * `Description` - The description of agent token. * `Token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/notification_configuration.html.markdown b/website/docs/cdktf/csharp/r/notification_configuration.html.markdown index af6e18b37..95202609e 100644 --- a/website/docs/cdktf/csharp/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/csharp/r/notification_configuration.html.markdown @@ -184,4 +184,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/oauth_client.html.markdown b/website/docs/cdktf/csharp/r/oauth_client.html.markdown index 7af1ab940..ca6f44f31 100644 --- a/website/docs/cdktf/csharp/r/oauth_client.html.markdown +++ b/website/docs/cdktf/csharp/r/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Manages OAuth clients. --- + + # tfe_oauth_client An OAuth Client represents the connection between an organization and a VCS @@ -32,6 +34,7 @@ class MyConvertedCode : TerraformStack Name = "my-github-oauth-client", OauthToken = "my-vcs-provider-token", Organization = "my-org-name", + OrganizationScoped = true, ServiceProvider = "github" }); } @@ -70,11 +73,11 @@ class MyConvertedCode : TerraformStack } ``` -#### BitBucket Data Center Usage +#### Bitbucket Data Center Usage -See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. +When using Bitbucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. ```csharp @@ -121,20 +124,22 @@ The following arguments are supported: * `PrivateKey` - (Required for `AdoServer`) The text of the private key associated with your Azure DevOps Server account * `Key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `Secret` - (Required for `BitbucketDataCenter`) The OAuth Client secret is used for BitBucket Data Center, this secret is the - the text of the SSH private key associated with your BitBucket Data Center +* `Secret` - (Required for `BitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for BitBucket +* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for Bitbucket Data Center in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Data Center Application +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `ServiceProvider` - (Required) The VCS provider being connected with. Valid - options are `AdoServer`, `AdoServices`, `BitbucketHosted`, `BitbucketDataCenter`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, + options are `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. +* `AgentPoolId` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. +* `OrganizationScoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `True`. ## Attributes Reference * `Id` - The ID of the OAuth client. * `OauthTokenId` - The ID of the OAuth token associated with the OAuth client. - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/opa_version.html.markdown b/website/docs/cdktf/csharp/r/opa_version.html.markdown index 73ffd4d52..210bfec54 100644 --- a/website/docs/cdktf/csharp/r/opa_version.html.markdown +++ b/website/docs/cdktf/csharp/r/opa_version.html.markdown @@ -63,6 +63,6 @@ terraform import tfe_opa_version.test tool-L4oe7rNwn7J4E5Yr terraform import tfe_opa_version.test 0.58.0 ``` --> **Note:** You can fetch a OPA version ID from the URL of an existing version in the Terraform Cloud UI. The ID is in the format `tool-` +-> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization.html.markdown b/website/docs/cdktf/csharp/r/organization.html.markdown index 761199855..4cf348fc1 100644 --- a/website/docs/cdktf/csharp/r/organization.html.markdown +++ b/website/docs/cdktf/csharp/r/organization.html.markdown @@ -65,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown b/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown index b3e87d051..48c95b721 100644 --- a/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/csharp/r/organization_default_settings.html.markdown @@ -62,7 +62,7 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization_membership.html.markdown b/website/docs/cdktf/csharp/r/organization_membership.html.markdown index 77ac662b7..299df5162 100644 --- a/website/docs/cdktf/csharp/r/organization_membership.html.markdown +++ b/website/docs/cdktf/csharp/r/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from an organization. --- + + # tfe_organization_membership Add or remove a user from an organization. @@ -67,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/organization_run_task.html.markdown b/website/docs/cdktf/csharp/r/organization_run_task.html.markdown index c8cdf6f7b..abcfc8ab0 100644 --- a/website/docs/cdktf/csharp/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/csharp/r/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Run tasks. --- + + # tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -61,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/project.html.markdown b/website/docs/cdktf/csharp/r/project.html.markdown index 5ac9089b8..9c50dca63 100644 --- a/website/docs/cdktf/csharp/r/project.html.markdown +++ b/website/docs/cdktf/csharp/r/project.html.markdown @@ -5,6 +5,8 @@ description: |- Manages projects. --- + + # tfe_project Provides a project resource. @@ -41,6 +43,7 @@ The following arguments are supported: * `Name` - (Required) Name of the project. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `Description` - (Optional) A description for the project. ## Attributes Reference @@ -56,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/project_oauth_client.html.markdown b/website/docs/cdktf/csharp/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..2f3916804 --- /dev/null +++ b/website/docs/cdktf/csharp/r/project_oauth_client.html.markdown @@ -0,0 +1,77 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + + + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```csharp +using Constructs; +using HashiCorp.Cdktf; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +using Gen.Providers.Tfe; +class MyConvertedCode : TerraformStack +{ + public MyConvertedCode(Construct scope, string name) : base(scope, name) + { + var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { + Email = "admin@company.com", + Name = "my-org-name" + }); + var tfeProjectTest = new Project.Project(this, "test_1", new ProjectConfig { + Name = "my-project-name", + Organization = Token.AsString(tfeOrganizationTest.Name) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.OverrideLogicalId("test"); + var tfeOauthClientTest = new OauthClient.OauthClient(this, "test_2", new OauthClientConfig { + ApiUrl = "https://api.github.com", + HttpUrl = "https://github.com", + OauthToken = "oauth_token_id", + Organization = tfeOrganizationTest, + ServiceProvider = "github" + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeOauthClientTest.OverrideLogicalId("test"); + var tfeProjectOauthClientTest = + new ProjectOauthClient.ProjectOauthClient(this, "test_3", new ProjectOauthClientConfig { + OauthClientId = Token.AsString(tfeOauthClientTest.Id), + ProjectId = Token.AsString(tfeProjectTest.Id) + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectOauthClientTest.OverrideLogicalId("test"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `OauthClientId` - (Required) ID of the oauth client. +* `ProjectId` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `Id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/registry_module.html.markdown b/website/docs/cdktf/csharp/r/registry_module.html.markdown index d80995cfa..a492ff599 100644 --- a/website/docs/cdktf/csharp/r/registry_module.html.markdown +++ b/website/docs/cdktf/csharp/r/registry_module.html.markdown @@ -213,6 +213,7 @@ The following arguments are supported: * `Organization` - (Optional) The name of the organization associated with the registry module. It must be set if `ModuleProvider` is used, or if `VcsRepo` is used via a GitHub App. * `Namespace` - (Optional) The namespace of a public registry module. It can be used if `ModuleProvider` is set and `RegistryName` is public. * `RegistryName` - (Optional) Whether the registry module is private or public. It can be used if `ModuleProvider` is set. +* `InitialVersion` - (Optional) This specifies the initial version for a branch based module. It can be used if `VcsRepoBranch` is set. If it is omitted, the initial modules version will default to `000`. The `TestConfig` block supports * `TestsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -256,4 +257,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/run_trigger.html.markdown b/website/docs/cdktf/csharp/r/run_trigger.html.markdown index 10be6cd02..b772f3fae 100644 --- a/website/docs/cdktf/csharp/r/run_trigger.html.markdown +++ b/website/docs/cdktf/csharp/r/run_trigger.html.markdown @@ -5,6 +5,8 @@ description: |- Manages run triggers --- + + # tfe_run_trigger HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, @@ -66,4 +68,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/sentinel_version.html.markdown b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown index 11d841fd2..5f3d58945 100644 --- a/website/docs/cdktf/csharp/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/csharp/r/sentinel_version.html.markdown @@ -65,4 +65,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team.html.markdown b/website/docs/cdktf/csharp/r/team.html.markdown index 23b676ab4..5c650d064 100644 --- a/website/docs/cdktf/csharp/r/team.html.markdown +++ b/website/docs/cdktf/csharp/r/team.html.markdown @@ -5,6 +5,8 @@ description: |- Manages teams. --- + + # tfe_team Manages teams. @@ -77,6 +79,9 @@ The `OrganizationAccess` block supports: * `ManageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `ManageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `ManageWorkspaces` to be set to `True`. * `ManageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `ManageTeams` - (Optional) Allow members to create, update, and delete teams. +* `ManageOrganizationAccess` - (Optional) Allow members to update the organization access settings of teams. +* `AccessSecretTeams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference @@ -95,4 +100,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team_organization_member.html.markdown b/website/docs/cdktf/csharp/r/team_organization_member.html.markdown index 990182cae..e394e8d6c 100644 --- a/website/docs/cdktf/csharp/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/csharp/r/team_organization_member.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from a team. --- + + # tfe_team_organization_member Add or remove a team member using a @@ -73,4 +75,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/team_organization_members.html.markdown b/website/docs/cdktf/csharp/r/team_organization_members.html.markdown index 248c30f82..3ac78ae43 100644 --- a/website/docs/cdktf/csharp/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/csharp/r/team_organization_members.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove users from a team based on their organization memberships. --- + + # tfe_team_organization_members Add or remove one or more team members using a @@ -112,4 +114,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/terraform_version.html.markdown b/website/docs/cdktf/csharp/r/terraform_version.html.markdown index 171d72745..779a17f2e 100644 --- a/website/docs/cdktf/csharp/r/terraform_version.html.markdown +++ b/website/docs/cdktf/csharp/r/terraform_version.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Terraform versions --- + + # tfe_terraform_version Manage Terraform versions available on HCP Terraform and Terraform Enterprise. @@ -63,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/tfe_test_variable.html.markdown b/website/docs/cdktf/csharp/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..0ea52ed7c --- /dev/null +++ b/website/docs/cdktf/csharp/r/tfe_test_variable.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + + + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/variable.html.markdown b/website/docs/cdktf/csharp/r/variable.html.markdown index 736515ccc..9abe235a1 100644 --- a/website/docs/cdktf/csharp/r/variable.html.markdown +++ b/website/docs/cdktf/csharp/r/variable.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variables. --- + + # tfe_variable Creates, updates and destroys variables. @@ -175,4 +177,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace.html.markdown b/website/docs/cdktf/csharp/r/workspace.html.markdown index 87f303c48..2e201172b 100644 --- a/website/docs/cdktf/csharp/r/workspace.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace.html.markdown @@ -12,6 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -88,6 +89,10 @@ The following arguments are supported: * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. * `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. +* `AutoDestroyAt` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `AutoDestroyAt` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `IgnoreChanges` for this attribute may be preferred. + * `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files @@ -187,4 +192,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_run.html.markdown b/website/docs/cdktf/csharp/r/workspace_run.html.markdown index ee1a71395..46c76e7b9 100644 --- a/website/docs/cdktf/csharp/r/workspace_run.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace_run.html.markdown @@ -219,4 +219,4 @@ Both `Apply` and `Destroy` block supports: In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown b/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown index af04183ce..fa8e28183 100644 --- a/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/csharp/r/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Workspace Run tasks. --- + + # tfe_workspace_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -45,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/csharp/r/workspace_settings.markdown b/website/docs/cdktf/csharp/r/workspace_settings.markdown index d4dbc523c..4f9bb5847 100644 --- a/website/docs/cdktf/csharp/r/workspace_settings.markdown +++ b/website/docs/cdktf/csharp/r/workspace_settings.markdown @@ -118,7 +118,7 @@ The following arguments are supported: * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference @@ -142,4 +142,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/ip_ranges.html.markdown b/website/docs/cdktf/go/d/ip_ranges.html.markdown index 6b0294d06..649843dfc 100644 --- a/website/docs/cdktf/go/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/go/d/ip_ranges.html.markdown @@ -5,6 +5,8 @@ description: |- Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- + + # Data Source: tfe_ip_ranges Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). @@ -47,4 +49,4 @@ The following attributes are exported: * `Vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/oauth_client.html.markdown b/website/docs/cdktf/go/d/oauth_client.html.markdown index 2eab6b217..6fd5616f2 100644 --- a/website/docs/cdktf/go/d/oauth_client.html.markdown +++ b/website/docs/cdktf/go/d/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an OAuth client. --- + + # Data Source: tfe_oauth_client Use this data source to get information about an OAuth client. @@ -90,7 +92,7 @@ be set. * `OauthClientId` - (Optional) ID of the OAuth client. * `Organization` - (Optional) The name of the organization in which to search. * `ServiceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), + must be one of: `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. @@ -108,5 +110,6 @@ In addition to all arguments above, the following attributes are exported: * `Organization` - The organization in which the OAuth client is registered. * `ServiceProvider` - The API identifier of the OAuth service provider. * `ServiceProviderDisplayName` - The display name of the OAuth service provider. - - +* `OrganizationScoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `ProjectIds` - IDs of the projects that use the oauth client. + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/organization.html.markdown b/website/docs/cdktf/go/d/organization.html.markdown index 9c3136c58..413cd8bf7 100644 --- a/website/docs/cdktf/go/d/organization.html.markdown +++ b/website/docs/cdktf/go/d/organization.html.markdown @@ -52,4 +52,4 @@ In addition to all arguments above, the following attributes are exported: * `AggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `DefaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/organization_membership.html.markdown b/website/docs/cdktf/go/d/organization_membership.html.markdown index 66d8edf1a..cb6226338 100644 --- a/website/docs/cdktf/go/d/organization_membership.html.markdown +++ b/website/docs/cdktf/go/d/organization_membership.html.markdown @@ -107,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: * `UserId` - The ID of the user associated with the organization membership. * `Username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/organization_run_task.html.markdown b/website/docs/cdktf/go/d/organization_run_task.html.markdown index 7828a5c2d..e9a8abf43 100644 --- a/website/docs/cdktf/go/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/go/d/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Run task. --- + + # Data Source: tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -51,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the task. * `Url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/slug.html.markdown b/website/docs/cdktf/go/d/slug.html.markdown index 92813d2bd..8fffb8026 100644 --- a/website/docs/cdktf/go/d/slug.html.markdown +++ b/website/docs/cdktf/go/d/slug.html.markdown @@ -4,6 +4,8 @@ page_title: "Terraform Enterprise: tfe_slug" description: |- Manages files. --- + + # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem @@ -52,4 +54,4 @@ The following arguments are supported: * `SourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/workspace.html.markdown b/website/docs/cdktf/go/d/workspace.html.markdown index aafa7b257..7354910ea 100644 --- a/website/docs/cdktf/go/d/workspace.html.markdown +++ b/website/docs/cdktf/go/d/workspace.html.markdown @@ -51,6 +51,7 @@ In addition to all arguments above, the following attributes are exported: * `AllowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `AutoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `AutoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `AutoDestroyAt` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `AssessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `FileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `True`) or always triggered on every push (if `False`). * `GlobalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `RemoteStateConsumerIds` argument). @@ -91,4 +92,4 @@ The `VcsRepo` block contains: * `OauthTokenId` - OAuth token ID of the configured VCS connection. * `TagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - + \ No newline at end of file diff --git a/website/docs/cdktf/go/d/workspace_run_task.html.markdown b/website/docs/cdktf/go/d/workspace_run_task.html.markdown index 36c184ffc..5ab0edf6c 100644 --- a/website/docs/cdktf/go/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/go/d/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Workspace Run task. --- + + # Data Source: tfe_workspace_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -49,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the Workspace Run task. * `Stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/index.html.markdown b/website/docs/cdktf/go/index.html.markdown index 070fd2e93..232ef7ff2 100644 --- a/website/docs/cdktf/go/index.html.markdown +++ b/website/docs/cdktf/go/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.55.0" + version = "~> 0.56.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo` token = var.token - version = "~> 0.55.0" + version = "~> 0.56.0" } # Create an organization @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `Hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. +* `Hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TfeHostname` environment variable. -* `Token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. +* `Token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `SslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `False`. Can be overridden setting the `TfeSslSkipVerify` @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown index 3eb86ba12..fa7a50fd3 100644 --- a/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/go/r/agent_pool_allowed_workspaces.html.markdown @@ -19,42 +19,36 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `TfeWorkspaceSettings` uses the agent pool reference found in `TfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```go -import constructs "github.com/aws/constructs-go/constructs" -import "github.com/hashicorp/terraform-cdk-go/cdktf" -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import "github.com/aws-samples/dummy/gen/providers/tfe/organization" -import "github.com/aws-samples/dummy/gen/providers/tfe/workspace" -import "github.com/aws-samples/dummy/gen/providers/tfe/agentPool" -import "github.com/aws-samples/dummy/gen/providers/tfe/agentPoolAllowedWorkspaces" -type myConvertedCode struct { - terraformStack +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" } -func newMyConvertedCode(scope construct, name *string) *myConvertedCode { - this := &myConvertedCode{} - cdktf.NewTerraformStack_Override(this, scope, name) - tfeOrganizationTestOrganization := organization.NewOrganization(this, jsii.String("test-organization"), &organizationConfig{ - email: jsii.String("admin@company.com"), - name: jsii.String("my-org-name"), - }) - tfeWorkspaceTestWorkspace := workspace.NewWorkspace(this, jsii.String("test-workspace"), &workspaceConfig{ - name: jsii.String("my-workspace-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), - }) - tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ - name: jsii.String("my-agent-pool-name"), - organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), - organizationScoped: jsii.Boolean(false), - }) - agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test-allowed-workspaces"), &agentPoolAllowedWorkspacesConfig{ - agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), - allowedWorkspaceIds: []*string{ - cdktf.Token_*AsString(tfeWorkspaceTestWorkspace.id), - }, - }) - return this +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -74,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/agent_token.html.markdown b/website/docs/cdktf/go/r/agent_token.html.markdown index c4f5ddc9a..e9755c2cc 100644 --- a/website/docs/cdktf/go/r/agent_token.html.markdown +++ b/website/docs/cdktf/go/r/agent_token.html.markdown @@ -5,6 +5,8 @@ description: |- Manages agent tokens --- + + # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. @@ -58,4 +60,4 @@ The following arguments are supported: * `Description` - The description of agent token. * `Token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/notification_configuration.html.markdown b/website/docs/cdktf/go/r/notification_configuration.html.markdown index da58281f4..7064271a5 100644 --- a/website/docs/cdktf/go/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/go/r/notification_configuration.html.markdown @@ -221,4 +221,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/oauth_client.html.markdown b/website/docs/cdktf/go/r/oauth_client.html.markdown index a2385138a..e553ce593 100644 --- a/website/docs/cdktf/go/r/oauth_client.html.markdown +++ b/website/docs/cdktf/go/r/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Manages OAuth clients. --- + + # tfe_oauth_client An OAuth Client represents the connection between an organization and a VCS @@ -35,6 +37,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { name: jsii.String("my-github-oauth-client"), oauthToken: jsii.String("my-vcs-provider-token"), organization: jsii.String("my-org-name"), + organizationScoped: jsii.Boolean(true), serviceProvider: jsii.String("github"), }) return this @@ -73,11 +76,11 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { } ``` -#### BitBucket Data Center Usage +#### Bitbucket Data Center Usage -See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. +When using Bitbucket Data Center, you must use three required fields: `Key`, `Secret`, `RsaPublicKey`. ```go @@ -124,17 +127,19 @@ The following arguments are supported: * `Secret` - (Required for `BitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for Bitbucket Data Center - in conjunction with the secret. Not used for any other providers. The +* `RsaPublicKey` - (Required for `BitbucketDataCenter`) Required for Bitbucket + Data Center in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your Bitbucket Data Center Application Link. * `ServiceProvider` - (Required) The VCS provider being connected with. Valid options are `AdoServer`, `AdoServices`, `BitbucketDataCenter`, `BitbucketHosted`, `BitbucketServer`(deprecated), `Github`, `GithubEnterprise`, `GitlabHosted`, `GitlabCommunityEdition`, or `GitlabEnterpriseEdition`. +* `AgentPoolId` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. +* `OrganizationScoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `True`. ## Attributes Reference * `Id` - The ID of the OAuth client. * `OauthTokenId` - The ID of the OAuth token associated with the OAuth client. - + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/opa_version.html.markdown b/website/docs/cdktf/go/r/opa_version.html.markdown index 787153ae7..c3f21d91c 100644 --- a/website/docs/cdktf/go/r/opa_version.html.markdown +++ b/website/docs/cdktf/go/r/opa_version.html.markdown @@ -68,4 +68,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization.html.markdown b/website/docs/cdktf/go/r/organization.html.markdown index 104e0968f..7943c62fa 100644 --- a/website/docs/cdktf/go/r/organization.html.markdown +++ b/website/docs/cdktf/go/r/organization.html.markdown @@ -68,4 +68,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization_default_settings.html.markdown b/website/docs/cdktf/go/r/organization_default_settings.html.markdown index 4fb9e6bea..4a7900ac9 100644 --- a/website/docs/cdktf/go/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/go/r/organization_default_settings.html.markdown @@ -70,7 +70,7 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization_membership.html.markdown b/website/docs/cdktf/go/r/organization_membership.html.markdown index eb82ce5f7..85b12eb8f 100644 --- a/website/docs/cdktf/go/r/organization_membership.html.markdown +++ b/website/docs/cdktf/go/r/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from an organization. --- + + # tfe_organization_membership Add or remove a user from an organization. @@ -70,4 +72,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/organization_run_task.html.markdown b/website/docs/cdktf/go/r/organization_run_task.html.markdown index 0f1853c50..ad05b2e94 100644 --- a/website/docs/cdktf/go/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/go/r/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Run tasks. --- + + # tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -64,4 +66,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/project.html.markdown b/website/docs/cdktf/go/r/project.html.markdown index a91d42a3e..98bbdcbf3 100644 --- a/website/docs/cdktf/go/r/project.html.markdown +++ b/website/docs/cdktf/go/r/project.html.markdown @@ -5,6 +5,8 @@ description: |- Manages projects. --- + + # tfe_project Provides a project resource. @@ -45,6 +47,7 @@ The following arguments are supported: * `Name` - (Required) Name of the project. * `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `Description` - (Optional) A description for the project. ## Attributes Reference @@ -60,4 +63,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/project_oauth_client.html.markdown b/website/docs/cdktf/go/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..cc3bf57c4 --- /dev/null +++ b/website/docs/cdktf/go/r/project_oauth_client.html.markdown @@ -0,0 +1,83 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + + + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```go +import constructs "github.com/aws/constructs-go/constructs" +import "github.com/hashicorp/terraform-cdk-go/cdktf" +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import "github.com/aws-samples/dummy/gen/providers/tfe/organization" +import "github.com/aws-samples/dummy/gen/providers/tfe/project" +import "github.com/aws-samples/dummy/gen/providers/tfe/oauthClient" +import "github.com/aws-samples/dummy/gen/providers/tfe/projectOauthClient" +type myConvertedCode struct { + terraformStack +} + +func newMyConvertedCode(scope construct, name *string) *myConvertedCode { + this := &myConvertedCode{} + cdktf.NewTerraformStack_Override(this, scope, name) + tfeOrganizationTest := organization.NewOrganization(this, jsii.String("test"), &organizationConfig{ + email: jsii.String("admin@company.com"), + name: jsii.String("my-org-name"), + }) + tfeProjectTest := project.NewProject(this, jsii.String("test_1"), &projectConfig{ + name: jsii.String("my-project-name"), + organization: cdktf.Token_AsString(tfeOrganizationTest.name), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.OverrideLogicalId(jsii.String("test")) + tfeOauthClientTest := oauthClient.NewOauthClient(this, jsii.String("test_2"), &oauthClientConfig{ + apiUrl: jsii.String("https://api.github.com"), + httpUrl: jsii.String("https://github.com"), + oauthToken: jsii.String("oauth_token_id"), + organization: tfeOrganizationTest, + serviceProvider: jsii.String("github"), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeOauthClientTest.OverrideLogicalId(jsii.String("test")) + tfeProjectOauthClientTest := + projectOauthClient.NewProjectOauthClient(this, jsii.String("test_3"), &projectOauthClientConfig{ + oauthClientId: cdktf.Token_*AsString(tfeOauthClientTest.id), + projectId: cdktf.Token_*AsString(tfeProjectTest.id), + }) + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectOauthClientTest.OverrideLogicalId(jsii.String("test")) + return this +} +``` + +## Argument Reference + +The following arguments are supported: + +* `OauthClientId` - (Required) ID of the oauth client. +* `ProjectId` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `Id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/registry_module.html.markdown b/website/docs/cdktf/go/r/registry_module.html.markdown index a147e6820..fbec6d07f 100644 --- a/website/docs/cdktf/go/r/registry_module.html.markdown +++ b/website/docs/cdktf/go/r/registry_module.html.markdown @@ -243,6 +243,7 @@ The following arguments are supported: * `Organization` - (Optional) The name of the organization associated with the registry module. It must be set if `ModuleProvider` is used, or if `VcsRepo` is used via a GitHub App. * `Namespace` - (Optional) The namespace of a public registry module. It can be used if `ModuleProvider` is set and `RegistryName` is public. * `RegistryName` - (Optional) Whether the registry module is private or public. It can be used if `ModuleProvider` is set. +* `InitialVersion` - (Optional) This specifies the initial version for a branch based module. It can be used if `VcsRepoBranch` is set. If it is omitted, the initial modules version will default to `000`. The `TestConfig` block supports * `TestsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -286,4 +287,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/run_trigger.html.markdown b/website/docs/cdktf/go/r/run_trigger.html.markdown index 2e3f1f1b9..635b34659 100644 --- a/website/docs/cdktf/go/r/run_trigger.html.markdown +++ b/website/docs/cdktf/go/r/run_trigger.html.markdown @@ -5,6 +5,8 @@ description: |- Manages run triggers --- + + # tfe_run_trigger HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, @@ -71,4 +73,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/sentinel_version.html.markdown b/website/docs/cdktf/go/r/sentinel_version.html.markdown index f8604a4be..db708c236 100644 --- a/website/docs/cdktf/go/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/go/r/sentinel_version.html.markdown @@ -68,4 +68,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team.html.markdown b/website/docs/cdktf/go/r/team.html.markdown index a522d8074..abfbcca33 100644 --- a/website/docs/cdktf/go/r/team.html.markdown +++ b/website/docs/cdktf/go/r/team.html.markdown @@ -5,6 +5,8 @@ description: |- Manages teams. --- + + # tfe_team Manages teams. @@ -83,6 +85,9 @@ The `OrganizationAccess` block supports: * `ManageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `ManageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `ManageWorkspaces` to be set to `True`. * `ManageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `ManageTeams` - (Optional) Allow members to create, update, and delete teams. +* `ManageOrganizationAccess` - (Optional) Allow members to update the organization access settings of teams. +* `AccessSecretTeams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference @@ -101,4 +106,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team_organization_member.html.markdown b/website/docs/cdktf/go/r/team_organization_member.html.markdown index 3bca2cdf7..7dffc5f3a 100644 --- a/website/docs/cdktf/go/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/go/r/team_organization_member.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from a team. --- + + # tfe_team_organization_member Add or remove a team member using a @@ -78,4 +80,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/team_organization_members.html.markdown b/website/docs/cdktf/go/r/team_organization_members.html.markdown index 1ea1c7c40..2acdcd983 100644 --- a/website/docs/cdktf/go/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/go/r/team_organization_members.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove users from a team based on their organization memberships. --- + + # tfe_team_organization_members Add or remove one or more team members using a @@ -55,10 +57,10 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { tfeTeamOrganizationMembersTest := teamOrganizationMembers.NewTeamOrganizationMembers(this, jsii.String("test_3"), &teamOrganizationMembersConfig{ organizationMembershipIds: []*string{ - cdktf.*token_AsString(tfeOrganizationMembershipTest.id), - cdktf.*token_*AsString(tfeOrganizationMembershipSample.id), + cdktf.Token_AsString(tfeOrganizationMembershipTest.id), + cdktf.Token_*AsString(tfeOrganizationMembershipSample.id), }, - teamId: cdktf.*token_*AsString(tfeTeamTest.id), + teamId: cdktf.Token_*AsString(tfeTeamTest.id), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeTeamOrganizationMembersTest.OverrideLogicalId(jsii.String("test")) @@ -83,7 +85,7 @@ type myConvertedCode struct { func newMyConvertedCode(scope construct, name *string) *myConvertedCode { this := &myConvertedCode{} cdktf.NewTerraformStack_Override(this, scope, name) - allUsers := cdktf.fn_Toset([]interface{}{ + allUsers := cdktf.Fn_Toset([]interface{}{ jsii.String("user1@hashicorp.com"), jsii.String("user2@hashicorp.com"), }) @@ -128,4 +130,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/terraform_version.html.markdown b/website/docs/cdktf/go/r/terraform_version.html.markdown index acdb57ea4..f47102343 100644 --- a/website/docs/cdktf/go/r/terraform_version.html.markdown +++ b/website/docs/cdktf/go/r/terraform_version.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Terraform versions --- + + # tfe_terraform_version Manage Terraform versions available on HCP Terraform and Terraform Enterprise. @@ -13,25 +15,11 @@ Manage Terraform versions available on HCP Terraform and Terraform Enterprise. Basic Usage: -```go -import constructs "github.com/aws/constructs-go/constructs" -import cdktf "github.com/hashicorp/terraform-cdk-go/cdktf" -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import "github.com/aws-samples/dummy/gen/providers/tfe/terraformVersion" -type myConvertedCode struct { - terraformStack -} - -func newMyConvertedCode(scope construct, name *string) *myConvertedCode { - this := &myConvertedCode{} - cdktf.NewTerraformStack_Override(this, scope, name) - terraformVersion.NewTerraformVersion(this, jsii.String("test"), &terraformVersionConfig{ - sha: jsii.String("e75ac73deb69a6b3aa667cb0b8b731aee79e2904"), - url: jsii.String("https://tfe-host.com/path/to/terraform.zip"), - version: jsii.String("1.1.2-custom"), - }) - return this +```hcl +resource "tfe_terraform_version" "test" { + version = "1.1.2-custom" + url = "https://tfe-host.com/path/to/terraform.zip" + sha = "e75ac73deb69a6b3aa667cb0b8b731aee79e2904" } ``` @@ -66,4 +54,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/tfe_test_variable.html.markdown b/website/docs/cdktf/go/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..0ea52ed7c --- /dev/null +++ b/website/docs/cdktf/go/r/tfe_test_variable.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + + + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/variable.html.markdown b/website/docs/cdktf/go/r/variable.html.markdown index 24801da02..721c5e3e4 100644 --- a/website/docs/cdktf/go/r/variable.html.markdown +++ b/website/docs/cdktf/go/r/variable.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variables. --- + + # tfe_variable Creates, updates and destroys variables. @@ -185,4 +187,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace.html.markdown b/website/docs/cdktf/go/r/workspace.html.markdown index c7511d8ab..014239fae 100644 --- a/website/docs/cdktf/go/r/workspace.html.markdown +++ b/website/docs/cdktf/go/r/workspace.html.markdown @@ -12,6 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `ExecutionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `GlobalRemoteState` or `RemoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -38,7 +39,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.*token_AsString(tfeOrganizationTestOrganization.name), tagNames: []*string{ jsii.String("test"), jsii.String("app"), @@ -83,7 +84,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { vcsRepo: &workspaceVcsRepo{ branch: jsii.String("main"), identifier: jsii.String("my-org-name/vcs-repository"), - oauthTokenId: cdktf.Token_AsString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: cdktf.*token_AsString(tfeOauthClientTest.oauthTokenId), }, }) return this @@ -100,6 +101,10 @@ The following arguments are supported: * `AssessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `False`. * `AutoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `False`. * `AutoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `False`. +* `AutoDestroyAt` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `AutoDestroyAt` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `IgnoreChanges` for this attribute may be preferred. + * `Description` - (Optional) A description for the workspace. * `ExecutionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `FileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files @@ -199,4 +204,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_run.html.markdown b/website/docs/cdktf/go/r/workspace_run.html.markdown index 17d31514f..f61f1da07 100644 --- a/website/docs/cdktf/go/r/workspace_run.html.markdown +++ b/website/docs/cdktf/go/r/workspace_run.html.markdown @@ -57,7 +57,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { vcsRepo: &workspaceVcsRepo{ branch: jsii.String("main"), identifier: jsii.String("my-org-name/vcs-repository"), - oauthTokenId: cdktf.Token_AsString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: cdktf.*token_AsString(tfeOauthClientTest.oauthTokenId), }, }) tfeWorkspaceParent := workspace.NewWorkspace(this, jsii.String("parent"), &workspaceConfig{ @@ -67,7 +67,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { vcsRepo: &workspaceVcsRepo{ branch: jsii.String("main"), identifier: jsii.String("my-org-name/vcs-repository"), - oauthTokenId: cdktf.Token_*AsString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: cdktf.*token_*AsString(tfeOauthClientTest.oauthTokenId), }, }) tfeWorkspaceRunWsRunParent := workspaceRun.NewWorkspaceRun(this, jsii.String("ws_run_parent"), &workspaceRunConfig{ @@ -83,7 +83,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { retryBackoffMin: jsii.Number(10), waitForRun: jsii.Boolean(true), }, - workspaceId: cdktf.Token_*AsString(tfeWorkspaceParent.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceParent.id), }) workspaceRun.NewWorkspaceRun(this, jsii.String("ws_run_child"), &workspaceRunConfig{ apply: &workspaceRunApply{ @@ -100,7 +100,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { retryBackoffMin: jsii.Number(10), waitForRun: jsii.Boolean(true), }, - workspaceId: cdktf.Token_*AsString(tfeWorkspaceChild.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceChild.id), }) return this } @@ -142,7 +142,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { vcsRepo: &workspaceVcsRepo{ branch: jsii.String("main"), identifier: jsii.String("my-org-name/vcs-repository"), - oauthTokenId: cdktf.Token_AsString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: cdktf.*token_AsString(tfeOauthClientTest.oauthTokenId), }, }) workspaceRun.NewWorkspaceRun(this, jsii.String("ws_run_parent"), &workspaceRunConfig{ @@ -153,7 +153,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { manualConfirm: jsii.Boolean(true), waitForRun: jsii.Boolean(true), }, - workspaceId: cdktf.Token_*AsString(tfeWorkspaceParent.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceParent.id), }) return this } @@ -195,7 +195,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { vcsRepo: &workspaceVcsRepo{ branch: jsii.String("main"), identifier: jsii.String("my-org-name/vcs-repository"), - oauthTokenId: cdktf.Token_AsString(tfeOauthClientTest.oauthTokenId), + oauthTokenId: cdktf.*token_AsString(tfeOauthClientTest.oauthTokenId), }, }) workspaceRun.NewWorkspaceRun(this, jsii.String("ws_run_parent"), &workspaceRunConfig{ @@ -208,7 +208,7 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { retry: jsii.Boolean(false), waitForRun: jsii.Boolean(true), }, - workspaceId: cdktf.Token_*AsString(tfeWorkspaceParent.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceParent.id), }) return this } @@ -239,4 +239,4 @@ Both `Apply` and `Destroy` block supports: In addition to all arguments above, the following attributes are exported: * `Id` - The ID of the run created by this resource. Note, if the resource was created without an `Apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_run_task.html.markdown b/website/docs/cdktf/go/r/workspace_run_task.html.markdown index af04183ce..fa8e28183 100644 --- a/website/docs/cdktf/go/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/go/r/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Workspace Run tasks. --- + + # tfe_workspace_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -45,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/go/r/workspace_settings.markdown b/website/docs/cdktf/go/r/workspace_settings.markdown index 2ae60b1cf..de2b5da63 100644 --- a/website/docs/cdktf/go/r/workspace_settings.markdown +++ b/website/docs/cdktf/go/r/workspace_settings.markdown @@ -36,11 +36,11 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.*token_AsString(tfeOrganizationTestOrganization.name), }) workspaceSettings.NewWorkspaceSettings(this, jsii.String("test-settings"), &workspaceSettingsConfig{ executionMode: jsii.String("local"), - workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceTest.id), }) return this } @@ -71,25 +71,25 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) tfeWorkspaceTest := workspace.NewWorkspace(this, jsii.String("test"), &workspaceConfig{ name: jsii.String("my-workspace-name"), - organization: cdktf.Token_AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.*token_AsString(tfeOrganizationTestOrganization.name), }) tfeAgentPoolTestAgentPool := agentPool.NewAgentPool(this, jsii.String("test-agent-pool"), &agentPoolConfig{ name: jsii.String("my-agent-pool-name"), - organization: cdktf.Token_*AsString(tfeOrganizationTestOrganization.name), + organization: cdktf.*token_*AsString(tfeOrganizationTestOrganization.name), }) tfeAgentPoolAllowedWorkspacesTest := agentPoolAllowedWorkspaces.NewAgentPoolAllowedWorkspaces(this, jsii.String("test_3"), &agentPoolAllowedWorkspacesConfig{ - agentPoolId: cdktf.Token_*AsString(tfeAgentPoolTestAgentPool.id), + agentPoolId: cdktf.*token_*AsString(tfeAgentPoolTestAgentPool.id), allowedWorkspaceIds: []*string{ - cdktf.Token_*AsString(tfeWorkspaceTest.id), + cdktf.*token_*AsString(tfeWorkspaceTest.id), }, }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeAgentPoolAllowedWorkspacesTest.OverrideLogicalId(jsii.String("test")) workspaceSettings.NewWorkspaceSettings(this, jsii.String("test-settings"), &workspaceSettingsConfig{ - agentPoolId: cdktf.Token_*AsString(tfeAgentPoolAllowedWorkspacesTest.agentPoolId), + agentPoolId: cdktf.*token_*AsString(tfeAgentPoolAllowedWorkspacesTest.agentPoolId), executionMode: jsii.String("agent"), - workspaceId: cdktf.Token_*AsString(tfeWorkspaceTest.id), + workspaceId: cdktf.*token_*AsString(tfeWorkspaceTest.id), }) return this } @@ -117,12 +117,12 @@ func newMyConvertedCode(scope construct, name *string) *myConvertedCode { }) tfeWorkspaceSettingsTest := workspaceSettings.NewWorkspaceSettings(this, jsii.String("test_1"), &workspaceSettingsConfig{ - workspaceId: cdktf.Token_AsString(dataTfeWorkspaceTest.id), + workspaceId: cdktf.*token_AsString(dataTfeWorkspaceTest.id), }) /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceSettingsTest.OverrideLogicalId(jsii.String("test")) cdktf.NewTerraformOutput(this, jsii.String("workspace-explicit-local-execution"), &TerraformOutputConfig{ - Value: cdktf.Fn_Alltrue(cdktf.Token_AsAny([]interface{}{ + Value: cdktf.*fn_Alltrue(cdktf.*token_*AsAny([]interface{}{ cdktf.Op_Eq(tfeWorkspaceSettingsTest.executionMode, jsii.String("local")), cdktf.propertyAccess(tfeWorkspaceSettingsTest.overwrites, []interface{}{ jsii.String("0"), @@ -142,7 +142,7 @@ The following arguments are supported: * `AgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `ExecutionMode` to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value. * `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. Using Terraform Enterprise, only `Remote` and `Local` execution modes are valid. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `Remote`, `Local` or `Agent`. When set to `Local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `Remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference @@ -166,4 +166,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/ip_ranges.html.markdown b/website/docs/cdktf/java/d/ip_ranges.html.markdown index 26c254cb9..cf625dd97 100644 --- a/website/docs/cdktf/java/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/java/d/ip_ranges.html.markdown @@ -5,6 +5,8 @@ description: |- Get HCP Terraform and Terraform Enterprise's IP ranges of its services --- + + # Data Source: tfe_ip_ranges Use this data source to retrieve a list of HCP Terraform's IP ranges. For more information about these IP ranges, view our [documentation about HCP Terraform IP Ranges](https://developer.hashicorp.com/terraform/cloud-docs/architectural-details/ip-ranges). @@ -42,4 +44,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/oauth_client.html.markdown b/website/docs/cdktf/java/d/oauth_client.html.markdown index 571a40b3d..12a04b23b 100644 --- a/website/docs/cdktf/java/d/oauth_client.html.markdown +++ b/website/docs/cdktf/java/d/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on an OAuth client. --- + + # Data Source: tfe_oauth_client Use this data source to get information about an OAuth client. @@ -78,7 +80,7 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), + must be one of: `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. @@ -96,5 +98,6 @@ In addition to all arguments above, the following attributes are exported: * `organization` - The organization in which the OAuth client is registered. * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - - \ No newline at end of file +* `organizationScoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `projectIds` - IDs of the projects that use the oauth client. + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/organization.html.markdown b/website/docs/cdktf/java/d/organization.html.markdown index c0a56628d..80f4a4522 100644 --- a/website/docs/cdktf/java/d/organization.html.markdown +++ b/website/docs/cdktf/java/d/organization.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/organization_membership.html.markdown b/website/docs/cdktf/java/d/organization_membership.html.markdown index 95270a8e3..bffd9db37 100644 --- a/website/docs/cdktf/java/d/organization_membership.html.markdown +++ b/website/docs/cdktf/java/d/organization_membership.html.markdown @@ -95,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/organization_run_task.html.markdown b/website/docs/cdktf/java/d/organization_run_task.html.markdown index 54f03175b..f980f88e1 100644 --- a/website/docs/cdktf/java/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/java/d/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Run task. --- + + # Data Source: tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -47,4 +49,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/slug.html.markdown b/website/docs/cdktf/java/d/slug.html.markdown index 04646bb98..e1a0dd463 100644 --- a/website/docs/cdktf/java/d/slug.html.markdown +++ b/website/docs/cdktf/java/d/slug.html.markdown @@ -4,6 +4,8 @@ page_title: "Terraform Enterprise: tfe_slug" description: |- Manages files. --- + + # Data Source: tfe_slug This data source is used to represent configuration files on a local filesystem @@ -48,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/workspace.html.markdown b/website/docs/cdktf/java/d/workspace.html.markdown index 6e5340ca3..6cfed24c1 100644 --- a/website/docs/cdktf/java/d/workspace.html.markdown +++ b/website/docs/cdktf/java/d/workspace.html.markdown @@ -47,6 +47,7 @@ In addition to all arguments above, the following attributes are exported: * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `autoDestroyAt` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `assessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). @@ -87,4 +88,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - + \ No newline at end of file diff --git a/website/docs/cdktf/java/d/workspace_run_task.html.markdown b/website/docs/cdktf/java/d/workspace_run_task.html.markdown index 648f04556..dff04f382 100644 --- a/website/docs/cdktf/java/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/java/d/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Get information on a Workspace Run task. --- + + # Data Source: tfe_workspace_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -45,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/index.html.markdown b/website/docs/cdktf/java/index.html.markdown index 9b5606874..be83ab0b1 100644 --- a/website/docs/cdktf/java/index.html.markdown +++ b/website/docs/cdktf/java/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -90,7 +90,7 @@ The above snippet using `requiredProviders` is for Terraform 0.13+; if you are u ```hcl provider "tfe" { - version = "~> 0.55.0" + version = "~> 0.56.0" ... } ``` @@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions provider "tfe" { hostname = var.hostname # Optional, defaults to HCP Terraform `appTerraformIo` token = var.token - version = "~> 0.55.0" + version = "~> 0.56.0" } # Create an organization @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `tfeHostname` environment variable. -* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `tfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown index 66bacc0fa..d83bc9dd9 100644 --- a/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/java/r/agent_pool_allowed_workspaces.html.markdown @@ -19,36 +19,36 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. -```java -import software.constructs.*; -import com.hashicorp.cdktf.*; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import gen.providers.tfe.organization.*; -import gen.providers.tfe.workspace.*; -import gen.providers.tfe.agentPool.*; -import gen.providers.tfe.agentPoolAllowedWorkspaces.*; -public class MyConvertedCode extends TerraformStack { - public MyConvertedCode(Construct scope, String name) { - super(scope, name); - Organization tfeOrganizationTestOrganization = new Organization(this, "test-organization", new OrganizationConfig() - .email("admin@company.com") - .name("my-org-name") - ); - Workspace tfeWorkspaceTestWorkspace = new Workspace(this, "test-workspace", new WorkspaceConfig() - .name("my-workspace-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) - ); - AgentPool tfeAgentPoolTestAgentPool = new AgentPool(this, "test-agent-pool", new AgentPoolConfig() - .name("my-agent-pool-name") - .organization(Token.asString(tfeOrganizationTestOrganization.getName())) - .organizationScoped(false) - ); - new AgentPoolAllowedWorkspaces(this, "test-allowed-workspaces", new AgentPoolAllowedWorkspacesConfig() - .agentPoolId(Token.asString(tfeAgentPoolTestAgentPool.getId())) - .allowedWorkspaceIds(List.of(Token.asString(tfeWorkspaceTestWorkspace.getId()))) - ); - } +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id } ``` @@ -68,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/agent_token.html.markdown b/website/docs/cdktf/java/r/agent_token.html.markdown index ee927bb0d..c1478039c 100644 --- a/website/docs/cdktf/java/r/agent_token.html.markdown +++ b/website/docs/cdktf/java/r/agent_token.html.markdown @@ -5,6 +5,8 @@ description: |- Manages agent tokens --- + + # tfe_agent_token Each agent pool has its own set of tokens which are not shared across pools. @@ -54,4 +56,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/notification_configuration.html.markdown b/website/docs/cdktf/java/r/notification_configuration.html.markdown index 1d8226dbf..aba940a88 100644 --- a/website/docs/cdktf/java/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/java/r/notification_configuration.html.markdown @@ -189,4 +189,4 @@ Notification configurations can be imported; use ` \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/oauth_client.html.markdown b/website/docs/cdktf/java/r/oauth_client.html.markdown index 809b05412..090382fa4 100644 --- a/website/docs/cdktf/java/r/oauth_client.html.markdown +++ b/website/docs/cdktf/java/r/oauth_client.html.markdown @@ -5,6 +5,8 @@ description: |- Manages OAuth clients. --- + + # tfe_oauth_client An OAuth Client represents the connection between an organization and a VCS @@ -31,6 +33,7 @@ public class MyConvertedCode extends TerraformStack { .name("my-github-oauth-client") .oauthToken("my-vcs-provider-token") .organization("my-org-name") + .organizationScoped(true) .serviceProvider("github") ); } @@ -65,11 +68,11 @@ public class MyConvertedCode extends TerraformStack { } ``` -#### BitBucket Data Center Usage +#### Bitbucket Data Center Usage -See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. +When using Bitbucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. ```java @@ -109,20 +112,22 @@ The following arguments are supported: * `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. - * `secret` - (Required for `bitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the - the text of the SSH private key associated with your BitBucket Data Center - Application Link. -* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for BitBucket +* `secret` - (Required for `bitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the + the text of the SSH private key associated with your Bitbucket Data Center +Application Link. +* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for Bitbucket Data Center in conjunction with the secret. Not used for any other providers. The -text of the SSH public key associated with your BitBucket Data Center Application +text of the SSH public key associated with your Bitbucket Data Center Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketHosted`, `bitbucketServer`(deprecated), `bitbucketDataCenter`, `github`, `githubEnterprise`, `gitlabHosted`, + options are `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. +* `agentPoolId` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. +* `organizationScoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/opa_version.html.markdown b/website/docs/cdktf/java/r/opa_version.html.markdown index ec06ecbe8..eaa114d2c 100644 --- a/website/docs/cdktf/java/r/opa_version.html.markdown +++ b/website/docs/cdktf/java/r/opa_version.html.markdown @@ -64,4 +64,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization.html.markdown b/website/docs/cdktf/java/r/organization.html.markdown index 31a21048f..36046b8ad 100644 --- a/website/docs/cdktf/java/r/organization.html.markdown +++ b/website/docs/cdktf/java/r/organization.html.markdown @@ -64,4 +64,4 @@ example: terraform import tfe_organization.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization_default_settings.html.markdown b/website/docs/cdktf/java/r/organization_default_settings.html.markdown index b973f6bd3..b23517bc7 100644 --- a/website/docs/cdktf/java/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/java/r/organization_default_settings.html.markdown @@ -64,7 +64,7 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization_membership.html.markdown b/website/docs/cdktf/java/r/organization_membership.html.markdown index d79169891..c39e28566 100644 --- a/website/docs/cdktf/java/r/organization_membership.html.markdown +++ b/website/docs/cdktf/java/r/organization_membership.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from an organization. --- + + # tfe_organization_membership Add or remove a user from an organization. @@ -66,4 +68,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/organization_run_task.html.markdown b/website/docs/cdktf/java/r/organization_run_task.html.markdown index 06e680375..56b8ce966 100644 --- a/website/docs/cdktf/java/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/java/r/organization_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Run tasks. --- + + # tfe_organization_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -60,4 +62,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/project.html.markdown b/website/docs/cdktf/java/r/project.html.markdown index 8c4d0c64f..936742163 100644 --- a/website/docs/cdktf/java/r/project.html.markdown +++ b/website/docs/cdktf/java/r/project.html.markdown @@ -5,6 +5,8 @@ description: |- Manages projects. --- + + # tfe_project Provides a project resource. @@ -41,6 +43,7 @@ The following arguments are supported: * `name` - (Required) Name of the project. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `description` - (Optional) A description for the project. ## Attributes Reference @@ -56,4 +59,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/project_oauth_client.html.markdown b/website/docs/cdktf/java/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..a2413c782 --- /dev/null +++ b/website/docs/cdktf/java/r/project_oauth_client.html.markdown @@ -0,0 +1,79 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + + + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```java +import software.constructs.*; +import com.hashicorp.cdktf.*; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import gen.providers.tfe.organization.*; +import gen.providers.tfe.project.*; +import gen.providers.tfe.oauthClient.*; +import gen.providers.tfe.projectOauthClient.*; +public class MyConvertedCode extends TerraformStack { + public MyConvertedCode(Construct scope, String name) { + super(scope, name); + Organization tfeOrganizationTest = new Organization(this, "test", new OrganizationConfig() + .email("admin@company.com") + .name("my-org-name") + ); + Project tfeProjectTest = new Project(this, "test_1", new ProjectConfig() + .name("my-project-name") + .organization(Token.asString(tfeOrganizationTest.getName())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.overrideLogicalId("test"); + OauthClient tfeOauthClientTest = new OauthClient(this, "test_2", new OauthClientConfig() + .apiUrl("https://api.github.com") + .httpUrl("https://github.com") + .oauthToken("oauth_token_id") + .organization(tfeOrganizationTest) + .serviceProvider("github") + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeOauthClientTest.overrideLogicalId("test"); + ProjectOauthClient tfeProjectOauthClientTest = + new ProjectOauthClient(this, "test_3", new ProjectOauthClientConfig() + .oauthClientId(Token.asString(tfeOauthClientTest.getId())) + .projectId(Token.asString(tfeProjectTest.getId())) + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectOauthClientTest.overrideLogicalId("test"); + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `oauthClientId` - (Required) ID of the oauth client. +* `projectId` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/registry_module.html.markdown b/website/docs/cdktf/java/r/registry_module.html.markdown index f6d681f47..e1e6536e0 100644 --- a/website/docs/cdktf/java/r/registry_module.html.markdown +++ b/website/docs/cdktf/java/r/registry_module.html.markdown @@ -217,6 +217,7 @@ The following arguments are supported: * `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `moduleProvider` is used, or if `vcsRepo` is used via a GitHub App. * `namespace` - (Optional) The namespace of a public registry module. It can be used if `moduleProvider` is set and `registryName` is public. * `registryName` - (Optional) Whether the registry module is private or public. It can be used if `moduleProvider` is set. +* `initialVersion` - (Optional) This specifies the initial version for a branch based module. It can be used if `vcsRepoBranch` is set. If it is omitted, the initial modules version will default to `000`. The `testConfig` block supports * `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -260,4 +261,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/run_trigger.html.markdown b/website/docs/cdktf/java/r/run_trigger.html.markdown index aa1f0d6f3..9927a06eb 100644 --- a/website/docs/cdktf/java/r/run_trigger.html.markdown +++ b/website/docs/cdktf/java/r/run_trigger.html.markdown @@ -5,6 +5,8 @@ description: |- Manages run triggers --- + + # tfe_run_trigger HCP Terraform provides a way to connect your workspace to one or more workspaces within your organization, @@ -67,4 +69,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/sentinel_version.html.markdown b/website/docs/cdktf/java/r/sentinel_version.html.markdown index a3b78d9b4..cc654810c 100644 --- a/website/docs/cdktf/java/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/java/r/sentinel_version.html.markdown @@ -64,4 +64,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team.html.markdown b/website/docs/cdktf/java/r/team.html.markdown index a845bccfc..59fc3bc18 100644 --- a/website/docs/cdktf/java/r/team.html.markdown +++ b/website/docs/cdktf/java/r/team.html.markdown @@ -5,6 +5,8 @@ description: |- Manages teams. --- + + # tfe_team Manages teams. @@ -75,6 +77,9 @@ The `organizationAccess` block supports: * `manageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manageWorkspaces` to be set to `true`. * `manageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `manageTeams` - (Optional) Allow members to create, update, and delete teams. +* `manageOrganizationAccess` - (Optional) Allow members to update the organization access settings of teams. +* `accessSecretTeams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference @@ -93,4 +98,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team_organization_member.html.markdown b/website/docs/cdktf/java/r/team_organization_member.html.markdown index 5eaa5550e..52fde7098 100644 --- a/website/docs/cdktf/java/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/java/r/team_organization_member.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove a user from a team. --- + + # tfe_team_organization_member Add or remove a team member using a @@ -74,4 +76,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/team_organization_members.html.markdown b/website/docs/cdktf/java/r/team_organization_members.html.markdown index bb5fd68a2..cafc86f92 100644 --- a/website/docs/cdktf/java/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/java/r/team_organization_members.html.markdown @@ -5,6 +5,8 @@ description: |- Add or remove users from a team based on their organization memberships. --- + + # tfe_team_organization_members Add or remove one or more team members using a @@ -114,4 +116,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/terraform_version.html.markdown b/website/docs/cdktf/java/r/terraform_version.html.markdown index e35695f98..5097f256a 100644 --- a/website/docs/cdktf/java/r/terraform_version.html.markdown +++ b/website/docs/cdktf/java/r/terraform_version.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Terraform versions --- + + # tfe_terraform_version Manage Terraform versions available on HCP Terraform and Terraform Enterprise. @@ -62,4 +64,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/tfe_test_variable.html.markdown b/website/docs/cdktf/java/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..0ea52ed7c --- /dev/null +++ b/website/docs/cdktf/java/r/tfe_test_variable.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + + + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/variable.html.markdown b/website/docs/cdktf/java/r/variable.html.markdown index 477cd345c..abb112f84 100644 --- a/website/docs/cdktf/java/r/variable.html.markdown +++ b/website/docs/cdktf/java/r/variable.html.markdown @@ -5,6 +5,8 @@ description: |- Manages variables. --- + + # tfe_variable Creates, updates and destroys variables. @@ -177,4 +179,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace.html.markdown b/website/docs/cdktf/java/r/workspace.html.markdown index 0ca2f132a..2202dc699 100644 --- a/website/docs/cdktf/java/r/workspace.html.markdown +++ b/website/docs/cdktf/java/r/workspace.html.markdown @@ -12,6 +12,7 @@ description: |- Provides a workspace resource. ~> **NOTE:** Setting the execution mode and agent pool affinity directly on the workspace is deprecated in favor of using both [tfe_workspace_settings](workspace_settings) and [tfe_organization_default_settings](organization_default_settings), since they allow more precise control and fully support [agent_pool_allowed_workspaces](agent_pool_allowed_workspaces). Use caution when unsetting `executionMode`, as it now leaves any prior value unmanaged instead of reverting to the old default value of `"remote"`. + ~> **NOTE:** Using `globalRemoteState` or `remoteStateConsumerIds` requires using the provider with HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. ## Example Usage @@ -89,6 +90,10 @@ The following arguments are supported: * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. +* `autoDestroyAt` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `autoDestroyAt` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignoreChanges` for this attribute may be preferred. + * `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files @@ -188,4 +193,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_run.html.markdown b/website/docs/cdktf/java/r/workspace_run.html.markdown index cef85d937..954f4de90 100644 --- a/website/docs/cdktf/java/r/workspace_run.html.markdown +++ b/website/docs/cdktf/java/r/workspace_run.html.markdown @@ -225,4 +225,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_run_task.html.markdown b/website/docs/cdktf/java/r/workspace_run_task.html.markdown index 0947c38b7..3ec9bba3e 100644 --- a/website/docs/cdktf/java/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/java/r/workspace_run_task.html.markdown @@ -5,6 +5,8 @@ description: |- Manages Workspace Run tasks. --- + + # tfe_workspace_run_task [Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. @@ -45,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/java/r/workspace_settings.markdown b/website/docs/cdktf/java/r/workspace_settings.markdown index b26d65803..75e92d0d9 100644 --- a/website/docs/cdktf/java/r/workspace_settings.markdown +++ b/website/docs/cdktf/java/r/workspace_settings.markdown @@ -122,7 +122,7 @@ The following arguments are supported: * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference @@ -146,4 +146,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/github_installation.html.markdown b/website/docs/cdktf/python/d/github_installation.html.markdown index 407d3b977..30c40a42b 100644 --- a/website/docs/cdktf/python/d/github_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_installation.html.markdown @@ -25,7 +25,7 @@ class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", - installation_id=12345 + installation_id=12345678 ) ``` @@ -41,7 +41,7 @@ class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) tfe.data_tfe_github_app_installation.DataTfeGithubAppInstallation(self, "gha_installation", - name="installation_name" + name="github_username_or_organization" ) ``` @@ -59,4 +59,5 @@ Must be one of: `installation_id` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installation_id`. - + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ip_ranges.html.markdown b/website/docs/cdktf/python/d/ip_ranges.html.markdown index fd2a980e7..20aa4d148 100644 --- a/website/docs/cdktf/python/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/python/d/ip_ranges.html.markdown @@ -42,4 +42,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/no_code_module.html.markdown b/website/docs/cdktf/python/d/no_code_module.html.markdown index 76a3c8037..72ccc9fb9 100644 --- a/website/docs/cdktf/python/d/no_code_module.html.markdown +++ b/website/docs/cdktf/python/d/no_code_module.html.markdown @@ -13,28 +13,15 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_no_code_module import DataTfeNoCodeModule -from imports.tfe.no_code_module import NoCodeModule -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - foobar = NoCodeModule(self, "foobar", - organization=Token.as_string(tfe_organization_foobar.id), - registry_module=Token.as_string(tfe_registry_module_foobar.id) - ) - data_tfe_no_code_module_foobar = DataTfeNoCodeModule(self, "foobar_1", - id=foobar.id - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - data_tfe_no_code_module_foobar.override_logical_id("foobar") +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id +} + +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} ``` ## Argument Reference @@ -52,4 +39,4 @@ The following arguments are supported: * `version_pin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/oauth_client.html.markdown b/website/docs/cdktf/python/d/oauth_client.html.markdown index 13a412c05..c5c3cd4c5 100644 --- a/website/docs/cdktf/python/d/oauth_client.html.markdown +++ b/website/docs/cdktf/python/d/oauth_client.html.markdown @@ -74,7 +74,7 @@ be set. * `oauth_client_id` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `service_provider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), + must be one of: `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. @@ -92,5 +92,6 @@ In addition to all arguments above, the following attributes are exported: * `organization` - The organization in which the OAuth client is registered. * `service_provider` - The API identifier of the OAuth service provider. * `service_provider_display_name` - The display name of the OAuth service provider. - - +* `organization_scoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `project_ids` - IDs of the projects that use the oauth client. + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization.html.markdown b/website/docs/cdktf/python/d/organization.html.markdown index 41bc85607..f1a02dd0b 100644 --- a/website/docs/cdktf/python/d/organization.html.markdown +++ b/website/docs/cdktf/python/d/organization.html.markdown @@ -45,4 +45,5 @@ In addition to all arguments above, the following attributes are exported: * `send_passing_statuses_for_untriggered_speculative_plans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregated_commit_status_enabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `default_project_id` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_membership.html.markdown b/website/docs/cdktf/python/d/organization_membership.html.markdown index 8f9932c99..384dbd925 100644 --- a/website/docs/cdktf/python/d/organization_membership.html.markdown +++ b/website/docs/cdktf/python/d/organization_membership.html.markdown @@ -89,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: * `user_id` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/organization_run_task.html.markdown b/website/docs/cdktf/python/d/organization_run_task.html.markdown index 0bfc0dc1e..5954b8b39 100644 --- a/website/docs/cdktf/python/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task.html.markdown @@ -47,4 +47,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/policy_set.html.markdown b/website/docs/cdktf/python/d/policy_set.html.markdown index 7792c0828..1a5e415fc 100644 --- a/website/docs/cdktf/python/d/policy_set.html.markdown +++ b/website/docs/cdktf/python/d/policy_set.html.markdown @@ -66,4 +66,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown index a89adf1e9..3c1958eca 100644 --- a/website/docs/cdktf/python/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_gpg_key import DataTfeRegistryGpgKey -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryGpgKey(self, "example", + tfe.data_tfe_registry_gpg_key.DataTfeRegistryGpgKey(self, "example", id="13DFECCA3B58CE4A", organization="my-org-name" ) @@ -44,4 +41,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown index 3320a1c75..381cfb0e9 100644 --- a/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/python/d/registry_gpg_keys.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_gpg_keys import DataTfeRegistryGpgKeys -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryGpgKeys(self, "all", + tfe.data_tfe_registry_gpg_keys.DataTfeRegistryGpgKeys(self, "all", organization="my-org-name" ) ``` @@ -45,4 +42,4 @@ The following arguments are supported: * `created_at` - The time when the GPG key was created. * `updated_at` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_provider.html.markdown b/website/docs/cdktf/python/d/registry_provider.html.markdown index 2fa766eb4..1bc8c11a0 100644 --- a/website/docs/cdktf/python/d/registry_provider.html.markdown +++ b/website/docs/cdktf/python/d/registry_provider.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a public or private provider in th A private provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.registry_provider import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - RegistryProvider(self, "example", + tfe.registry_provider.RegistryProvider(self, "example", name="my-provider", organization="my-org-name" ) @@ -36,18 +33,15 @@ class MyConvertedCode(TerraformStack): A public provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.registry_provider import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - RegistryProvider(self, "example", + tfe.registry_provider.RegistryProvider(self, "example", name="aws", namespace="hashicorp", organization="my-org-name", @@ -70,4 +64,4 @@ The following arguments are supported: * `created_at` - The time when the provider was created. * `updated_at` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/registry_providers.html.markdown b/website/docs/cdktf/python/d/registry_providers.html.markdown index 666812347..03eec5f49 100644 --- a/website/docs/cdktf/python/d/registry_providers.html.markdown +++ b/website/docs/cdktf/python/d/registry_providers.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about public and private providers in th All providers: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "all", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "all", organization="my-org-name" ) ``` @@ -35,18 +32,15 @@ class MyConvertedCode(TerraformStack): All private providers: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "private", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "private", organization="my-org-name", registry_name="private" ) @@ -55,18 +49,15 @@ class MyConvertedCode(TerraformStack): Providers with "hashicorp" in their namespace or name: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_registry_providers import DataTfeRegistryProviders -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - DataTfeRegistryProviders(self, "hashicorp", + tfe.data_tfe_registry_providers.DataTfeRegistryProviders(self, "hashicorp", organization="my-org-name", search="hashicorp" ) @@ -91,4 +82,4 @@ The following arguments are supported: * `created_at` - Time when the provider was created. * `updated_at` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/slug.html.markdown b/website/docs/cdktf/python/d/slug.html.markdown index 7335bc887..d202cf85d 100644 --- a/website/docs/cdktf/python/d/slug.html.markdown +++ b/website/docs/cdktf/python/d/slug.html.markdown @@ -47,4 +47,4 @@ The following arguments are supported: * `source_path` - (Required) The path to the directory where the files are located. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace.html.markdown b/website/docs/cdktf/python/d/workspace.html.markdown index 64a5d731d..a69e861ae 100644 --- a/website/docs/cdktf/python/d/workspace.html.markdown +++ b/website/docs/cdktf/python/d/workspace.html.markdown @@ -45,6 +45,7 @@ In addition to all arguments above, the following attributes are exported: * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `auto_destroy_at` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `global_remote_state` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remote_state_consumer_ids` argument). @@ -85,4 +86,4 @@ The `vcs_repo` block contains: * `oauth_token_id` - OAuth token ID of the configured VCS connection. * `tags_regex` - A regular expression used to trigger a Workspace run for matching Git tags. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/workspace_run_task.html.markdown b/website/docs/cdktf/python/d/workspace_run_task.html.markdown index 5ca5e8c3b..166b9b4ae 100644 --- a/website/docs/cdktf/python/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/d/workspace_run_task.html.markdown @@ -45,4 +45,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/index.html.markdown b/website/docs/cdktf/python/index.html.markdown index fa8b69331..76e099e07 100644 --- a/website/docs/cdktf/python/index.html.markdown +++ b/website/docs/cdktf/python/index.html.markdown @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.55.0" + version = "~> 0.56.0" } } } @@ -90,7 +90,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.55.0" + version = "~> 0.56.0" ... } ``` @@ -101,9 +101,9 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `app.terraform.io` + hostname = var.hostname # Optional, defaults to HCP Terraform `app.terraform.io` token = var.token - version = "~> 0.55.0" + version = "~> 0.56.0" } # Create an organization @@ -116,10 +116,10 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the `TFE_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. +* `token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `ssl_skip_verify` - (Optional) Whether or not to skip certificate verifications. Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` @@ -129,4 +129,4 @@ The following arguments are supported: arguments. Ensure that the organization already exists prior to using this argument. This can also be specified using the `TFE_ORGANIZATION` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/admin_organization_settings.markdown b/website/docs/cdktf/python/r/admin_organization_settings.markdown index 6701ab676..4ecb2b61b 100644 --- a/website/docs/cdktf/python/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/python/r/admin_organization_settings.markdown @@ -66,8 +66,4 @@ The following arguments are supported: * `sso_enabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown index f7ce8f7b8..b1079118b 100644 --- a/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/python/r/agent_pool_allowed_workspaces.html.markdown @@ -19,34 +19,37 @@ for Business account. In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. -```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. -# See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", - email="admin@company.com", - name="my-org-name" - ) - tfe_workspace_test_workspace = tfe.workspace.Workspace(self, "test-workspace", - name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) - ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", - name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name), - organization_scoped=False - ) - tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test-allowed-workspaces", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), - allowed_workspace_ids=[ - cdktf.Token.as_string(tfe_workspace_test_workspace.id) - ] - ) +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false +} + +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +} ``` ## Argument Reference @@ -65,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/agent_token.html.markdown b/website/docs/cdktf/python/r/agent_token.html.markdown index a0a13b601..1212cdb4c 100644 --- a/website/docs/cdktf/python/r/agent_token.html.markdown +++ b/website/docs/cdktf/python/r/agent_token.html.markdown @@ -52,4 +52,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/notification_configuration.html.markdown b/website/docs/cdktf/python/r/notification_configuration.html.markdown index 0c1438778..c93d5a3a0 100644 --- a/website/docs/cdktf/python/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/python/r/notification_configuration.html.markdown @@ -180,4 +180,4 @@ Notification configurations can be imported; use ` + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/oauth_client.html.markdown b/website/docs/cdktf/python/r/oauth_client.html.markdown index 8d3ebec8b..254b2d6d8 100644 --- a/website/docs/cdktf/python/r/oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/oauth_client.html.markdown @@ -33,6 +33,7 @@ class MyConvertedCode(cdktf.TerraformStack): name="my-github-oauth-client", oauth_token="my-vcs-provider-token", organization="my-org-name", + organization_scoped=True, service_provider="github" ) ``` @@ -63,11 +64,11 @@ class MyConvertedCode(cdktf.TerraformStack): ) ``` -#### BitBucket Data Center Usage +#### Bitbucket Data Center Usage -See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsa_public_key`. +When using Bitbucket Data Center, you must use three required fields: `key`, `secret`, `rsa_public_key`. ```python @@ -108,16 +109,19 @@ The following arguments are supported: * `secret` - (Required for `bitbucket_data_center`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `rsa_public_key` - (Required for `bitbucket_data_center`) Required for Bitbucket Data Center in conjunction with the secret. Not used for any other providers. The +* `rsa_public_key` - (Required for `bitbucket_data_center`) Required for Bitbucket + Data Center in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your Bitbucket Data Center Application Link. * `service_provider` - (Required) The VCS provider being connected with. Valid options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or `gitlab_enterprise_edition`. +* `agent_pool_id` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. +* `organization_scoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauth_token_id` - The ID of the OAuth token associated with the OAuth client. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/opa_version.html.markdown b/website/docs/cdktf/python/r/opa_version.html.markdown index 243e8df08..53c439b40 100644 --- a/website/docs/cdktf/python/r/opa_version.html.markdown +++ b/website/docs/cdktf/python/r/opa_version.html.markdown @@ -16,18 +16,15 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.opa_version import OpaVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - OpaVersion(self, "test", + tfe.opa_version.OpaVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/opa", version="0.58.0-custom" @@ -65,4 +62,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization.html.markdown b/website/docs/cdktf/python/r/organization.html.markdown index 30461b99d..efd445db9 100644 --- a/website/docs/cdktf/python/r/organization.html.markdown +++ b/website/docs/cdktf/python/r/organization.html.markdown @@ -62,4 +62,4 @@ example: terraform import tfe_organization.test my-org-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_default_settings.html.markdown b/website/docs/cdktf/python/r/organization_default_settings.html.markdown index b96435924..4333e747a 100644 --- a/website/docs/cdktf/python/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_default_settings.html.markdown @@ -16,35 +16,30 @@ Primarily, this is used to set the default execution mode of an organization. Se Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.organization import Organization -from imports.tfe.organization_default_settings import OrganizationDefaultSettings -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = Organization(self, "test", + tfe_organization_test = tfe.organization.Organization(self, "test", email="admin@company.com", name="my-org-name" ) - my_agents = AgentPool(self, "my_agents", + tfe_agent_pool_my_agents = tfe.agent_pool.AgentPool(self, "my_agents", name="agent_smiths", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) - org_default = OrganizationDefaultSettings(self, "org_default", - default_agent_pool_id=my_agents.id, + tfe_organization_default_settings_org_default = + tfe.organization_default_settings.OrganizationDefaultSettings(self, "org_default", + default_agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_my_agents.id), default_execution_mode="agent", - organization=test.name + organization=cdktf.Token.as_string(tfe_organization_test.name) ) - Workspace(self, "my_workspace", - depends_on=[org_default], + tfe.workspace.Workspace(self, "my_workspace", + depends_on=[tfe_organization_default_settings_org_default], name="my-workspace" ) ``` @@ -64,7 +59,7 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_membership.html.markdown b/website/docs/cdktf/python/r/organization_membership.html.markdown index 504dc7ab2..58bdae797 100644 --- a/website/docs/cdktf/python/r/organization_membership.html.markdown +++ b/website/docs/cdktf/python/r/organization_membership.html.markdown @@ -66,4 +66,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/organization_run_task.html.markdown b/website/docs/cdktf/python/r/organization_run_task.html.markdown index 49ab61168..68451ccda 100644 --- a/website/docs/cdktf/python/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task.html.markdown @@ -60,4 +60,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/policy_set.html.markdown b/website/docs/cdktf/python/r/policy_set.html.markdown index f006acbee..3bb9ac5db 100644 --- a/website/docs/cdktf/python/r/policy_set.html.markdown +++ b/website/docs/cdktf/python/r/policy_set.html.markdown @@ -21,60 +21,39 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - agent_enabled=Token.as_boolean("true"), - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policies_path="policies/my-policy-set", - policy_tool_version="0.24.1", - vcs_repo=PolicySetVcsRepo( - branch="main", - identifier="my-org-name/my-policy-set-repository", - ingress_submodules=False, - oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id) - ), - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id + } +} ``` Using manually-specified policies: -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.policy_set import PolicySet -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - PolicySet(self, "test", - agent_enabled=Token.as_boolean("true"), - description="A brand new policy set", - kind="sentinel", - name="my-policy-set", - organization="my-org-name", - policy_ids=[Token.as_string(tfe_sentinel_policy_test.id)], - policy_tool_version="0.24.1", - workspace_ids=[Token.as_string(tfe_workspace_test.id)] - ) +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] +} ``` Manually uploaded policy set, in lieu of VCS: @@ -156,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project.html.markdown b/website/docs/cdktf/python/r/project.html.markdown index 478467ba7..7f7830a41 100644 --- a/website/docs/cdktf/python/r/project.html.markdown +++ b/website/docs/cdktf/python/r/project.html.markdown @@ -40,6 +40,7 @@ The following arguments are supported: * `name` - (Required) Name of the project. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `description` - (Optional) A description for the project. ## Attributes Reference @@ -55,4 +56,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/project_oauth_client.html.markdown b/website/docs/cdktf/python/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..19132c9d0 --- /dev/null +++ b/website/docs/cdktf/python/r/project_oauth_client.html.markdown @@ -0,0 +1,74 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + + + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```python +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. +# See https://cdk.tf/provider-generation for more details. +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + tfe_organization_test = tfe.organization.Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_project_test = tfe.project.Project(self, "test_1", + name="my-project-name", + organization=cdktf.Token.as_string(tfe_organization_test.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_project_test.override_logical_id("test") + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test_2", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token="oauth_token_id", + organization=tfe_organization_test, + service_provider="github" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_oauth_client_test.override_logical_id("test") + tfe_project_oauth_client_test = + tfe.project_oauth_client.ProjectOauthClient(self, "test_3", + oauth_client_id=cdktf.Token.as_string(tfe_oauth_client_test.id), + project_id=cdktf.Token.as_string(tfe_project_test.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + tfe_project_oauth_client_test.override_logical_id("test") +``` + +## Argument Reference + +The following arguments are supported: + +* `oauth_client_id` - (Required) ID of the oauth client. +* `project_id` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown index e087f01bb..256e03929 100644 --- a/website/docs/cdktf/python/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/python/r/registry_gpg_key.html.markdown @@ -16,22 +16,11 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Fn, Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. -# See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.registry_gpg_key import RegistryGpgKey -class MyConvertedCode(TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - RegistryGpgKey(self, "example", - ascii_armor=Token.as_string(Fn.file("my-public-key.asc")), - organization="my-org-name" - ) +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") +} ``` ## Argument Reference @@ -56,4 +45,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_module.html.markdown b/website/docs/cdktf/python/r/registry_module.html.markdown index d06643317..a2cb12413 100644 --- a/website/docs/cdktf/python/r/registry_module.html.markdown +++ b/website/docs/cdktf/python/r/registry_module.html.markdown @@ -47,31 +47,26 @@ class MyConvertedCode(cdktf.TerraformStack): Create private registry module with tests enabled: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.registry_module import RegistryModule -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test_oauth_client = OauthClient(self, "test-oauth-client", + tfe_oauth_client_test_oauth_client = tfe.oauth_client.OauthClient(self, "test-oauth-client", api_url="https://api.github.com", http_url="https://github.com", oauth_token="my-vcs-provider-token", - organization=test_organization.name, + organization=cdktf.Token.as_string(tfe_organization_test_organization.name), service_provider="github" ) - RegistryModule(self, "test-registry-module", + tfe.registry_module.RegistryModule(self, "test-registry-module", test_config=[RegistryModuleTestConfig( tests_enabled=True ) @@ -80,7 +75,7 @@ class MyConvertedCode(TerraformStack): branch="main", display_identifier="my-org-name/terraform-provider-name", identifier="my-org-name/terraform-provider-name", - oauth_token_id=test_oauth_client.oauth_token_id + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test_oauth_client.oauth_token_id) ) ) ``` @@ -201,6 +196,7 @@ The following arguments are supported: * `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `module_provider` is used, or if `vcs_repo` is used via a GitHub App. * `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. * `registry_name` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. +* `initial_version` - (Optional) This specifies the initial version for a branch based module. It can be used if `vcs_repo.branch` is set. If it is omitted, the initial modules version will default to `0.0.0`. The `test_config` block supports * `tests_enabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -244,4 +240,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/registry_provider.html.markdown b/website/docs/cdktf/python/r/registry_provider.html.markdown index d53e4fb92..4090c9498 100644 --- a/website/docs/cdktf/python/r/registry_provider.html.markdown +++ b/website/docs/cdktf/python/r/registry_provider.html.markdown @@ -16,25 +16,22 @@ Manages public and private providers in the private registry. Create private provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_provider import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - example = Organization(self, "example", + tfe_organization_example = tfe.organization.Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = RegistryProvider(self, "example_1", + tfe_registry_provider_example = + tfe.registry_provider.RegistryProvider(self, "example_1", name="my-provider", - organization=example.name + organization=cdktf.Token.as_string(tfe_organization_example.name) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_registry_provider_example.override_logical_id("example") @@ -43,26 +40,23 @@ class MyConvertedCode(TerraformStack): Create public provider: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.registry_provider import RegistryProvider -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - example = Organization(self, "example", + tfe_organization_example = tfe.organization.Organization(self, "example", email="admin@company.com", name="my-org-name" ) - tfe_registry_provider_example = RegistryProvider(self, "example_1", + tfe_registry_provider_example = + tfe.registry_provider.RegistryProvider(self, "example_1", name="aws", namespace="hashicorp", - organization=example.name, + organization=cdktf.Token.as_string(tfe_organization_example.name), registry_name="public" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -100,4 +94,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/run_trigger.html.markdown b/website/docs/cdktf/python/r/run_trigger.html.markdown index 1d0ac8fb9..333d594d1 100644 --- a/website/docs/cdktf/python/r/run_trigger.html.markdown +++ b/website/docs/cdktf/python/r/run_trigger.html.markdown @@ -65,4 +65,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/sentinel_version.html.markdown b/website/docs/cdktf/python/r/sentinel_version.html.markdown index 9cdc86f21..0a29f1298 100644 --- a/website/docs/cdktf/python/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/python/r/sentinel_version.html.markdown @@ -16,18 +16,15 @@ Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. Basic Usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.sentinel_version import SentinelVersion -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - SentinelVersion(self, "test", + tfe.sentinel_version.SentinelVersion(self, "test", sha="e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url="https://tfe-host.com/path/to/sentinel.zip", version="0.24.0-custom" @@ -65,4 +62,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team.html.markdown b/website/docs/cdktf/python/r/team.html.markdown index 98dbf8cbf..8fb5f2fb3 100644 --- a/website/docs/cdktf/python/r/team.html.markdown +++ b/website/docs/cdktf/python/r/team.html.markdown @@ -73,6 +73,9 @@ The `organization_access` block supports: * `manage_run_tasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `manage_projects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manage_workspaces` to be set to `true`. * `manage_membership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `manage_teams` - (Optional) Allow members to create, update, and delete teams. +* `manage_organization_access` - (Optional) Allow members to update the organization access settings of teams. +* `access_secret_teams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference @@ -91,4 +94,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_member.html.markdown b/website/docs/cdktf/python/r/team_organization_member.html.markdown index 7628e87ec..6fa75bf24 100644 --- a/website/docs/cdktf/python/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_member.html.markdown @@ -72,4 +72,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_organization_members.html.markdown b/website/docs/cdktf/python/r/team_organization_members.html.markdown index 3c8682bab..80b4b0f7a 100644 --- a/website/docs/cdktf/python/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/python/r/team_organization_members.html.markdown @@ -113,4 +113,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/team_project_access.html.markdown b/website/docs/cdktf/python/r/team_project_access.html.markdown index 06919c267..4357e8d35 100644 --- a/website/docs/cdktf/python/r/team_project_access.html.markdown +++ b/website/docs/cdktf/python/r/team_project_access.html.markdown @@ -15,31 +15,22 @@ Associate a team to permissions on a project. Basic usage: -```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. -# See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", - name="myproject", - organization="my-org-name" - ) - tfe_team_admin = tfe.team.Team(self, "admin", - name="my-admin-team", - organization="my-org-name" - ) - tfe_team_project_access_admin = - tfe.team_project_access.TeamProjectAccess(self, "admin_2", - access="admin", - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_admin.id) - ) - # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. - tfe_team_project_access_admin.override_logical_id("admin") +```hcl +resource "tfe_team" "admin" { + name = "my-admin-team" + organization = "my-org-name" +} + +resource "tfe_project" "test" { + name = "myproject" + organization = "my-org-name" +} + +resource "tfe_team_project_access" "admin" { + access = "admin" + team_id = tfe_team.admin.id + project_id = tfe_project.test.id +} ``` ## Argument Reference @@ -83,45 +74,38 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions -```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. -# See https://cdk.tf/provider-generation for more details. -import ...gen.providers.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): - def __init__(self, scope, name): - super().__init__(scope, name) - tfe_project_test = tfe.project.Project(self, "test", - name="myproject", - organization="my-org-name" - ) - tfe_team_dev = tfe.team.Team(self, "dev", - name="my-dev-team", - organization="my-org-name" - ) - tfe.team_project_access.TeamProjectAccess(self, "custom", - access="custom", - project_access=[TeamProjectAccessProjectAccess( - settings="read", - teams="none" - ) - ], - project_id=cdktf.Token.as_string(tfe_project_test.id), - team_id=cdktf.Token.as_string(tfe_team_dev.id), - workspace_access=[TeamProjectAccessWorkspaceAccess( - create=True, - delete=False, - locking=True, - move=False, - run_tasks=False, - runs="apply", - sentinel_mocks="none", - state_versions="write", - variables="write" - ) - ] - ) +```hcl +resource "tfe_team" "dev" { + name = "my-dev-team" + organization = "my-org-name" +} + +resource "tfe_project" "test" { + name = "myproject" + organization = "my-org-name" +} + +resource "tfe_team_project_access" "custom" { + access = "custom" + team_id = tfe_team.dev.id + project_id = tfe_project.test.id + + project_access { + settings = "read" + teams = "none" + } + workspace_access { + state_versions = "write" + sentinel_mocks = "none" + runs = "apply" + variables = "write" + create = true + locking = true + move = false + delete = false + run_tasks = false + } +} ``` ## Attributes Reference @@ -137,4 +121,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/terraform_version.html.markdown b/website/docs/cdktf/python/r/terraform_version.html.markdown index 1dfbb2b45..d8ae0eb59 100644 --- a/website/docs/cdktf/python/r/terraform_version.html.markdown +++ b/website/docs/cdktf/python/r/terraform_version.html.markdown @@ -62,4 +62,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/tfe_test_variable.html.markdown b/website/docs/cdktf/python/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..0ea52ed7c --- /dev/null +++ b/website/docs/cdktf/python/r/tfe_test_variable.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + + + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/variable.html.markdown b/website/docs/cdktf/python/r/variable.html.markdown index 7d5f39b8c..7789ecaa1 100644 --- a/website/docs/cdktf/python/r/variable.html.markdown +++ b/website/docs/cdktf/python/r/variable.html.markdown @@ -171,4 +171,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace.html.markdown b/website/docs/cdktf/python/r/workspace.html.markdown index 1be5e8685..ed82765a0 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -46,31 +46,30 @@ import constructs as constructs import cdktf as cdktf # Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -<<<<<<< HEAD -# -from imports.tfe.oauth_client import OauthClient -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -class MyConvertedCode(TerraformStack): -======= import ...gen.providers.tfe as tfe class MyConvertedCode(cdktf.TerraformStack): ->>>>>>> adf61bce (cdktf: update documentation) def __init__(self, scope, name): super().__init__(scope, name) tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", - name="my-agent-pool-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + tfe_oauth_client_test = tfe.oauth_client.OauthClient(self, "test", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token="oauth_token_id", + organization=tfe_organization_test_organization, + service_provider="github" ) - tfe.workspace.Workspace(self, "test", - agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), - execution_mode="agent", - name="my-workspace-name", - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + tfe.workspace.Workspace(self, "parent", + name="parent-ws", + organization=tfe_organization_test_organization, + queue_all_runs=False, + vcs_repo=WorkspaceVcsRepo( + branch="main", + identifier="my-org-name/vcs-repository", + oauth_token_id=cdktf.Token.as_string(tfe_oauth_client_test.oauth_token_id) + ) ) ``` @@ -84,6 +83,10 @@ The following arguments are supported: * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. +* `auto_destroy_at` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `auto_destroy_at` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignore_changes` for this attribute may be preferred. + * `description` - (Optional) A description for the workspace. * `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files @@ -183,4 +186,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run.html.markdown b/website/docs/cdktf/python/r/workspace_run.html.markdown index 5550f2faa..507deebd5 100644 --- a/website/docs/cdktf/python/r/workspace_run.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run.html.markdown @@ -210,4 +210,4 @@ Both `apply` and `destroy` block supports: In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_run_task.html.markdown b/website/docs/cdktf/python/r/workspace_run_task.html.markdown index 4057850fb..7a88fbf31 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -47,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/workspace_settings.markdown b/website/docs/cdktf/python/r/workspace_settings.markdown index 5bed20c55..f2c8f0a41 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -16,105 +16,91 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = Workspace(self, "test", + tfe_workspace_test = tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - WorkspaceSettings(self, "test-settings", + tfe.workspace_settings.WorkspaceSettings(self, "test-settings", execution_mode="local", - workspace_id=test.id + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) ``` With `execution_mode` of `agent`: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.agent_pool import AgentPool -from imports.tfe.agent_pool_allowed_workspaces import AgentPoolAllowedWorkspaces -from imports.tfe.organization import Organization -from imports.tfe.workspace import Workspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test_organization = Organization(self, "test-organization", + tfe_organization_test_organization = tfe.organization.Organization(self, "test-organization", email="admin@company.com", name="my-org-name" ) - test = Workspace(self, "test", + tfe_workspace_test = tfe.workspace.Workspace(self, "test", name="my-workspace-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - test_agent_pool = AgentPool(self, "test-agent-pool", + tfe_agent_pool_test_agent_pool = tfe.agent_pool.AgentPool(self, "test-agent-pool", name="my-agent-pool-name", - organization=test_organization.name + organization=cdktf.Token.as_string(tfe_organization_test_organization.name) ) - tfe_agent_pool_allowed_workspaces_test = AgentPoolAllowedWorkspaces(self, "test_3", - agent_pool_id=test_agent_pool.id, - allowed_workspace_ids=[test.id] + tfe_agent_pool_allowed_workspaces_test = + tfe.agent_pool_allowed_workspaces.AgentPoolAllowedWorkspaces(self, "test_3", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_test_agent_pool.id), + allowed_workspace_ids=[cdktf.Token.as_string(tfe_workspace_test.id)] ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_agent_pool_allowed_workspaces_test.override_logical_id("test") - WorkspaceSettings(self, "test-settings", - agent_pool_id=Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), + tfe.workspace_settings.WorkspaceSettings(self, "test-settings", + agent_pool_id=cdktf.Token.as_string(tfe_agent_pool_allowed_workspaces_test.agent_pool_id), execution_mode="agent", - workspace_id=test.id + workspace_id=cdktf.Token.as_string(tfe_workspace_test.id) ) ``` This resource may be used as a data source when no optional arguments are defined: ```python -# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -from constructs import Construct -from cdktf import Token, TerraformOutput, Op, Fn, TerraformStack -# -# Provider bindings are generated by running `cdktf get`. +import constructs as constructs +import cdktf as cdktf +# Provider bindings are generated by running cdktf get. # See https://cdk.tf/provider-generation for more details. -# -from imports.tfe.data_tfe_workspace import DataTfeWorkspace -from imports.tfe.workspace_settings import WorkspaceSettings -class MyConvertedCode(TerraformStack): +import ...gen.providers.tfe as tfe +class MyConvertedCode(cdktf.TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - test = DataTfeWorkspace(self, "test", + data_tfe_workspace_test = tfe.data_tfe_workspace.DataTfeWorkspace(self, "test", name="my-workspace-name", organization="my-org-name" ) - tfe_workspace_settings_test = WorkspaceSettings(self, "test_1", - workspace_id=Token.as_string(test.id) + tfe_workspace_settings_test = + tfe.workspace_settings.WorkspaceSettings(self, "test_1", + workspace_id=cdktf.Token.as_string(data_tfe_workspace_test.id) ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. tfe_workspace_settings_test.override_logical_id("test") - TerraformOutput(self, "workspace-explicit-local-execution", - value=Fn.alltrue( - Token.as_any([ - Op.eq(tfe_workspace_settings_test.execution_mode, "local"), - Fn.lookup_nested(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" + cdktf.TerraformOutput(self, "workspace-explicit-local-execution", + value=cdktf.Fn.alltrue( + cdktf.Token.as_any([ + cdktf.Op.eq(tfe_workspace_settings_test.execution_mode, "local"), + cdktf.property_access(tfe_workspace_settings_test.overwrites, ["0", "\"execution_mode\"" ]) ])) ) @@ -128,7 +114,7 @@ The following arguments are supported: * `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode` to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value. * `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference @@ -152,4 +138,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/github_installation.html.markdown b/website/docs/cdktf/typescript/d/github_installation.html.markdown index 729f3c70c..7aefb2d43 100644 --- a/website/docs/cdktf/typescript/d/github_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_installation.html.markdown @@ -28,7 +28,7 @@ class MyConvertedCode extends cdktf.TerraformStack { this, "gha_installation", { - installationId: 12345, + installationId: 12345678, } ); } @@ -51,7 +51,7 @@ class MyConvertedCode extends cdktf.TerraformStack { this, "gha_installation", { - name: "installation_name", + name: "github_username_or_organization", } ); } @@ -63,7 +63,7 @@ class MyConvertedCode extends cdktf.TerraformStack { The following arguments are supported. At least one of `name`, `installationId` must be set. -* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://github.com/settings/installations/12345678`. +* `installationId` - (Optional) ID of the Github Installation. The installation ID can be found in the URL slug when visiting the installation's configuration page, e.g `https://githubCom/settings/installations/12345678`. * `name` - (Optional) Name of the Github user or organization account that installed the app. Must be one of: `installationId` or `name`. @@ -73,4 +73,5 @@ Must be one of: `installationId` or `name`. In addition to all arguments above, the following attributes are exported: * `id` - The internal ID of the Github Installation. This is different from the `installationId`. - + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown index 0b3f9604a..5f2274fae 100644 --- a/website/docs/cdktf/typescript/d/ip_ranges.html.markdown +++ b/website/docs/cdktf/typescript/d/ip_ranges.html.markdown @@ -49,4 +49,4 @@ The following attributes are exported: * `vcs` - The list of IP ranges in CIDR notation used for connecting to VCS providers. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/no_code_module.html.markdown b/website/docs/cdktf/typescript/d/no_code_module.html.markdown index e680d7bd9..e8a11ff3b 100644 --- a/website/docs/cdktf/typescript/d/no_code_module.html.markdown +++ b/website/docs/cdktf/typescript/d/no_code_module.html.markdown @@ -13,35 +13,15 @@ Use this data source to read the details of an existing No-Code-Allowed module. ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeNoCodeModule } from "./.gen/providers/tfe/data-tfe-no-code-module"; -import { NoCodeModule } from "./.gen/providers/tfe/no-code-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - const foobar = new NoCodeModule(this, "foobar", { - organization: Token.asString(tfeOrganizationFoobar.id), - registryModule: Token.asString(tfeRegistryModuleFoobar.id), - }); - const dataTfeNoCodeModuleFoobar = new DataTfeNoCodeModule( - this, - "foobar_1", - { - id: foobar.id, - } - ); - /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ - dataTfeNoCodeModuleFoobar.overrideLogicalId("foobar"); - } +```hcl +resource "tfe_no_code_module" "foobar" { + organization = tfe_organization.foobar.id + registry_module = tfe_registry_module.foobar.id } +data "tfe_no_code_module" "foobar" { + id = tfe_no_code_module.foobar.id +} ``` ## Argument Reference @@ -59,4 +39,4 @@ The following arguments are supported: * `versionPin` - Version number the no-code module is pinned to. * `enabled` - Indicates if this no-code module is currently enabled - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/oauth_client.html.markdown b/website/docs/cdktf/typescript/d/oauth_client.html.markdown index a1424e2df..448720d0e 100644 --- a/website/docs/cdktf/typescript/d/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/d/oauth_client.html.markdown @@ -83,9 +83,9 @@ be set. * `oauthClientId` - (Optional) ID of the OAuth client. * `organization` - (Optional) The name of the organization in which to search. * `serviceProvider` - (Optional) The API identifier of the OAuth service provider. If set, - must be one of: `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), - `github`, `github_enterprise`, `gitlab_hosted`, `gitlab_community_edition`, or - `gitlab_enterprise_edition`. + must be one of: `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), + `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or + `gitlabEnterpriseEdition`. ## Attributes Reference @@ -101,5 +101,6 @@ In addition to all arguments above, the following attributes are exported: * `organization` - The organization in which the OAuth client is registered. * `serviceProvider` - The API identifier of the OAuth service provider. * `serviceProviderDisplayName` - The display name of the OAuth service provider. - - +* `organizationScoped` - Whether or not the agent pool can be used by all workspaces and projects in the organization. +* `projectIds` - IDs of the projects that use the oauth client. + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization.html.markdown b/website/docs/cdktf/typescript/d/organization.html.markdown index 81ca0afca..6d36e1b08 100644 --- a/website/docs/cdktf/typescript/d/organization.html.markdown +++ b/website/docs/cdktf/typescript/d/organization.html.markdown @@ -42,10 +42,11 @@ In addition to all arguments above, the following attributes are exported: * `email` - Admin email address. * `externalId` - An identifier for the organization. * `assessmentsEnforced` - (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set thier own preferences. -* `collaboratorAuthPolicy` - Authentication policy (`password` or `two_factor_mandatory`). Defaults to `password`. +* `collaboratorAuthPolicy` - Authentication policy (`password` or `twoFactorMandatory`). Defaults to `password`. * `costEstimationEnabled` - Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `ownersTeamSamlRoleId` - The name of the "owners" team. * `sendPassingStatusesForUntriggeredSpeculativePlans` - Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to true. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. * `aggregatedCommitStatusEnabled` - Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. * `defaultProjectId` - ID of the organization's default project. All workspaces created without specifying a project ID are created in this project. - + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_membership.html.markdown b/website/docs/cdktf/typescript/d/organization_membership.html.markdown index 67c15a000..2041d6609 100644 --- a/website/docs/cdktf/typescript/d/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_membership.html.markdown @@ -110,4 +110,4 @@ In addition to all arguments above, the following attributes are exported: * `userId` - The ID of the user associated with the organization membership. * `username` - The username of the user associated with the organization membership. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown index 3d2ce438b..1550da59f 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task.html.markdown @@ -54,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the task. * `url` - URL to send a task payload. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/policy_set.html.markdown b/website/docs/cdktf/typescript/d/policy_set.html.markdown index 1a242fe1b..85028b02e 100644 --- a/website/docs/cdktf/typescript/d/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/d/policy_set.html.markdown @@ -69,4 +69,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown index f85d500f4..265d57fbc 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_key.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about a private registry GPG key. ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryGpgKey } from "./.gen/providers/tfe/data-tfe-registry-gpg-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryGpgKey(this, "example", { + new tfe.dataTfeRegistryGpgKey.DataTfeRegistryGpgKey(this, "example", { id: "13DFECCA3B58CE4A", organization: "my-org-name", }); @@ -47,4 +44,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown index 67edda778..83d0e0d82 100644 --- a/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_gpg_keys.html.markdown @@ -14,18 +14,15 @@ Use this data source to get information about all private registry GPG keys of a ## Example Usage ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryGpgKeys } from "./.gen/providers/tfe/data-tfe-registry-gpg-keys"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryGpgKeys(this, "all", { + new tfe.dataTfeRegistryGpgKeys.DataTfeRegistryGpgKeys(this, "all", { organization: "my-org-name", }); } @@ -48,4 +45,4 @@ The following arguments are supported: * `createdAt` - The time when the GPG key was created. * `updatedAt` - The time when the GPG key was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_provider.html.markdown b/website/docs/cdktf/typescript/d/registry_provider.html.markdown index 42abcc627..d5bd8c2c2 100644 --- a/website/docs/cdktf/typescript/d/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_provider.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about a public or private provider in th A private provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new RegistryProvider(this, "example", { + new tfe.registryProvider.RegistryProvider(this, "example", { name: "my-provider", organization: "my-org-name", }); @@ -39,18 +36,15 @@ class MyConvertedCode extends TerraformStack { A public provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new RegistryProvider(this, "example", { + new tfe.registryProvider.RegistryProvider(this, "example", { name: "aws", namespace: "hashicorp", organization: "my-org-name", @@ -76,4 +70,4 @@ The following arguments are supported: * `createdAt` - The time when the provider was created. * `updatedAt` - The time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/registry_providers.html.markdown b/website/docs/cdktf/typescript/d/registry_providers.html.markdown index 799f83f46..aaf6fb892 100644 --- a/website/docs/cdktf/typescript/d/registry_providers.html.markdown +++ b/website/docs/cdktf/typescript/d/registry_providers.html.markdown @@ -16,18 +16,15 @@ Use this data source to get information about public and private providers in th All providers: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "all", { + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "all", { organization: "my-org-name", }); } @@ -38,18 +35,15 @@ class MyConvertedCode extends TerraformStack { All private providers: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "private", { + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders(this, "private", { organization: "my-org-name", registryName: "private", }); @@ -61,21 +55,22 @@ class MyConvertedCode extends TerraformStack { Providers with "hashicorp" in their namespace or name: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeRegistryProviders } from "./.gen/providers/tfe/data-tfe-registry-providers"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new DataTfeRegistryProviders(this, "hashicorp", { - organization: "my-org-name", - search: "hashicorp", - }); + new tfe.dataTfeRegistryProviders.DataTfeRegistryProviders( + this, + "hashicorp", + { + organization: "my-org-name", + search: "hashicorp", + } + ); } } @@ -100,4 +95,4 @@ The following arguments are supported: * `createdAt` - Time when the provider was created. * `updatedAt` - Time when the provider was last updated. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/slug.html.markdown b/website/docs/cdktf/typescript/d/slug.html.markdown index 7146f5fc4..38f3e825e 100644 --- a/website/docs/cdktf/typescript/d/slug.html.markdown +++ b/website/docs/cdktf/typescript/d/slug.html.markdown @@ -13,7 +13,7 @@ intended to be uploaded to HCP Terraform and Terraform Enterprise, in lieu of th sourced from a configured VCS provider. A unique checksum is generated for the specified local directory, which allows -resources such as `tfe_policy_set` track the files and upload a new gzip compressed +resources such as `tfePolicySet` track the files and upload a new gzip compressed tar file containing configuration files (a Terraform "slug") when those files change. ## Example Usage @@ -50,4 +50,4 @@ The following arguments are supported: * `sourcePath` - (Required) The path to the directory where the files are located. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace.html.markdown b/website/docs/cdktf/typescript/d/workspace.html.markdown index 280e4a2d8..6bb108f22 100644 --- a/website/docs/cdktf/typescript/d/workspace.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace.html.markdown @@ -48,6 +48,7 @@ In addition to all arguments above, the following attributes are exported: * `allowDestroyPlan` - Indicates whether destroy plans can be queued on the workspace. * `autoApply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `autoApplyRunTrigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `autoDestroyAt` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `assessmentsEnabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `fileTriggersEnabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). * `globalRemoteState` - (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by the `remoteStateConsumerIds` argument). @@ -73,7 +74,7 @@ In addition to all arguments above, the following attributes are exported: * `triggerPatterns` - List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. * `vcsRepo` - Settings for the workspace's VCS repository. * `workingDirectory` - A relative path that Terraform will execute within. -* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfe_workspace_settings` resource](tfe_workspace_settings) for details. +* `executionMode` - Indicates the [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) of the workspace. **Note:** This value might be derived from an organization-level default or set on the workspace itself; see the [`tfeWorkspaceSettings` resource](tfe_workspace_settings) for details. * `htmlUrl` - The URL to the browsable HTML overview of the workspace @@ -88,4 +89,4 @@ The `vcsRepo` block contains: * `oauthTokenId` - OAuth token ID of the configured VCS connection. * `tagsRegex` - A regular expression used to trigger a Workspace run for matching Git tags. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown index 69c36eda8..561ceec3b 100644 --- a/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/d/workspace_run_task.html.markdown @@ -48,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Workspace Run task. * `stage` - Which stage the task will run in. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/index.html.markdown b/website/docs/cdktf/typescript/index.html.markdown index 151cc7d81..be83ab0b1 100644 --- a/website/docs/cdktf/typescript/index.html.markdown +++ b/website/docs/cdktf/typescript/index.html.markdown @@ -43,8 +43,8 @@ There are several ways to provide the required token: - **Set the `token` argument in the provider configuration.** You can set the `token` argument in the provider configuration. Use an input variable for the token. -- **Set the `TFE_TOKEN` environment variable:** The provider can read the -`TFE_TOKEN` environment variable and the token stored there to authenticate. +- **Set the `tfeToken` environment variable:** The provider can read the +`tfeToken` environment variable and the token stored there to authenticate. When configuring the input variable for either of these options, mark them as sensitive. @@ -62,9 +62,9 @@ Terraform on your local command line, it can automatically discover the credenti [`terraform login`](https://developer.hashicorp.com/terraform/cli/commands/login). - **Set a `credentials` block in your CLI config file (.terraformrc):** See the [CLI Configuration File documentation](/docs/commands/cli-config.html). -If you used the `TF_CLI_CONFIG_FILE` environment variable to specify a +If you used the `tfCliConfigFile` environment variable to specify a non-default location for .terraformrc, the provider will also use that location. -Using a `credentials_helper` block is not supported. +Using a `credentialsHelper` block is not supported. ## Versions @@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future: terraform { required_providers { tfe = { - version = "~> 0.50.0" + version = "~> 0.56.0" } } } @@ -86,11 +86,11 @@ terraform { As this provider is still at version zero, you should constrain the acceptable provider versions on the minor version. -The above snippet using `required_providers` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: +The above snippet using `requiredProviders` is for Terraform 0.13+; if you are using Terraform version 0.12, you can constrain by adding the version constraint to the `provider` block instead: ```hcl provider "tfe" { - version = "~> 0.55.0" + version = "~> 0.56.0" ... } ``` @@ -101,9 +101,9 @@ For more information on provider installation and constraining provider versions ```hcl provider "tfe" { - hostname = var.hostname # Optional, defaults to Terraform Cloud `appTerraformIo` + hostname = var.hostname # Optional, defaults to HCP Terraform `appTerraformIo` token = var.token - version = "~> 0.55.0" + version = "~> 0.56.0" } # Create an organization @@ -116,17 +116,17 @@ resource "tfe_organization" "org" { The following arguments are supported: -* `hostname` - (Optional) The HCP Terraform and Terraform Enterprise hostname to connect to. +* `hostname` - (Optional) The HCP Terraform or Terraform Enterprise hostname to connect to. Defaults to `app.terraform.io`. Can be overridden by setting the - `TFE_HOSTNAME` environment variable. -* `token` - (Optional) The token used to authenticate with HCP Terraform and Terraform Enterprise. + `tfeHostname` environment variable. +* `token` - (Optional) The token used to authenticate with HCP Terraform or Terraform Enterprise. See [Authentication](#authentication) above for more information. * `sslSkipVerify` - (Optional) Whether or not to skip certificate verifications. - Defaults to `false`. Can be overridden setting the `TFE_SSL_SKIP_VERIFY` + Defaults to `false`. Can be overridden setting the `tfeSslSkipVerify` environment variable. * `organization` - (Optional) The default organization that resources should belong to. If provided, it's usually possible to omit resource-specific `organization` arguments. Ensure that the organization already exists prior to using this argument. - This can also be specified using the `TFE_ORGANIZATION` environment variable. + This can also be specified using the `tfeOrganization` environment variable. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown index 1f0bdf6a7..1aaced2ae 100644 --- a/website/docs/cdktf/typescript/r/admin_organization_settings.markdown +++ b/website/docs/cdktf/typescript/r/admin_organization_settings.markdown @@ -66,8 +66,4 @@ The following arguments are supported: * `ssoEnabled` - True if SSO is enabled in this organization -## Import - -This resource does not manage the creation of an organization and there is no need to import it. - - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown index d9a33d1d3..d83bc9dd9 100644 --- a/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_pool_allowed_workspaces.html.markdown @@ -17,59 +17,39 @@ for Business account. ## Example Usage -In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfe_workspace_settings` uses the agent pool reference found in `tfe_agent_pool_allowed_workspaces` in order to create the permission to use the agent pool before assigning it. - -```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { - super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - const tfeWorkspaceTestWorkspace = new tfe.workspace.Workspace( - this, - "test-workspace", - { - name: "my-workspace-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - } - ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - organizationScoped: false, - } - ); - new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( - this, - "test-allowed-workspaces", - { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), - allowedWorkspaceIds: [ - cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), - ], - } - ); - } +In this example, the agent pool and workspace are connected through other resources that manage the agent pool permissions as well as the workspace execution mode. Notice that the `tfeWorkspaceSettings` uses the agent pool reference found in `tfeAgentPoolAllowedWorkspaces` in order to create the permission to use the agent pool before assigning it. + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// Ensure workspace and agent pool are create first +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_agent_pool" "test-agent-pool" { + name = "my-agent-pool-name" + organization = tfe_organization.test-organization.name + organization_scoped = false } +// Ensure permissions are assigned second +resource "tfe_agent_pool_allowed_workspaces" "allowed" { + agent_pool_id = tfe_agent_pool.test-agent-pool.id + allowed_workspace_ids = [for key, value in tfe_workspace.test.*.id : value] +} + +// Lastly, ensure the workspace agent execution is assigned last by +// referencing allowed_workspaces +resource "tfe_workspace_settings" "test-workspace-settings" { + workspace_id = tfe_workspace.test-workspace.id + execution_mode = "agent" + agent_pool_id = tfe_agent_pool_allowed_workspaces.allowed.id +} ``` ## Argument Reference @@ -88,5 +68,4 @@ A resource can be imported; use `` as the import ID. For example: terraform import tfe_agent_pool_allowed_workspaces.foobar apool-rW0KoLSlnuNb5adB ``` - - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/agent_token.html.markdown b/website/docs/cdktf/typescript/r/agent_token.html.markdown index 10ad0157b..c8629c52c 100644 --- a/website/docs/cdktf/typescript/r/agent_token.html.markdown +++ b/website/docs/cdktf/typescript/r/agent_token.html.markdown @@ -63,4 +63,4 @@ The following arguments are supported: * `description` - The description of agent token. * `token` - The generated token. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown index 6513e8520..55c9a5082 100644 --- a/website/docs/cdktf/typescript/r/notification_configuration.html.markdown +++ b/website/docs/cdktf/typescript/r/notification_configuration.html.markdown @@ -115,7 +115,7 @@ class MyConvertedCode extends cdktf.TerraformStack { ``` -(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `email_users`: +(**TFE only**) With `destinationType` of `email`, using `emailAddresses` list and `emailUsers`: ```typescript import * as constructs from "constructs"; @@ -184,22 +184,22 @@ The following arguments are supported: * `generic` * `email` available in HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoft-teams` available in HCP Terraform or Terraform Enterprise v202206-1 or later + * `microsoftTeams` available in HCP Terraform or Terraform Enterprise v202206-1 or later * `emailAddresses` - (Optional) **TFE only** A list of email addresses. This value - _must not_ be provided if `destinationType` is `generic`, `microsoft-teams`, or `slack`. + _must not_ be provided if `destinationType` is `generic`, `microsoftTeams`, or `slack`. * `emailUserIds` - (Optional) A list of user IDs. This value _must not_ be provided - if `destinationType` is `generic`, `microsoft-teams`, or `slack`. + if `destinationType` is `generic`, `microsoftTeams`, or `slack`. * `enabled` - (Optional) Whether the notification configuration should be enabled or not. Disabled configurations will not send any notifications. Defaults to `false`. * `token` - (Optional) A write-only secure token for the notification configuration, which can be used by the receiving server to verify request authenticity when configured for notification configurations with a destination type of `generic`. Defaults to `null`. - This value _must not_ be provided if `destinationType` is `email`, `microsoft-teams`, or `slack`. + This value _must not_ be provided if `destinationType` is `email`, `microsoftTeams`, or `slack`. * `triggers` - (Optional) The array of triggers for which this notification configuration will - send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` - `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, or `assessment:failed`. + send notifications. Valid values are `run:created`, `run:planning`, `run:needsAttention`, `run:applying` + `run:completed`, `run:errored`, `assessment:checkFailure`, `assessment:drifted`, or `assessment:failed`. If omitted, no notification triggers are configured. -* `url` - (Required if `destinationType` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification +* `url` - (Required if `destinationType` is `generic`, `microsoftTeams`, or `slack`) The HTTP or HTTPS URL of the notification configuration where notification requests will be made. This value _must not_ be provided if `destinationType` is `email`. * `workspaceId` - (Required) The id of the workspace that owns the notification configuration. @@ -216,4 +216,4 @@ Notification configurations can be imported; use ` + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/oauth_client.html.markdown b/website/docs/cdktf/typescript/r/oauth_client.html.markdown index 5895085b5..bae635a3f 100644 --- a/website/docs/cdktf/typescript/r/oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/oauth_client.html.markdown @@ -33,6 +33,7 @@ class MyConvertedCode extends cdktf.TerraformStack { name: "my-github-oauth-client", oauthToken: "my-vcs-provider-token", organization: "my-org-name", + organizationScoped: true, serviceProvider: "github", }); } @@ -70,11 +71,11 @@ class MyConvertedCode extends cdktf.TerraformStack { ``` -#### BitBucket Data Center Usage +#### Bitbucket Data Center Usage -See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-data-center). +See [documentation for HCP Terraform and Terraform Enterprise setup](https://developer.hashicorp.com/terraform/cloud-docs/vcs/bitbucket-server). -When using BitBucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. +When using Bitbucket Data Center, you must use three required fields: `key`, `secret`, `rsaPublicKey`. ```typescript @@ -110,27 +111,29 @@ The following arguments are supported: * `name` - (Optional) Display name for the OAuth Client. Defaults to the `serviceProvider` if not supplied. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. * `apiUrl` - (Required) The base URL of your VCS provider's API (e.g. - `https://api.github.com` or `https://ghe.example.com/api/v3`). + `https://apiGithubCom` or `https://gheExampleCom/api/v3`). * `httpUrl` - (Required) The homepage of your VCS provider (e.g. - `https://github.com` or `https://ghe.example.com`). -* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghp_xxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. -* `privateKey` - (Required for `ado_server`) The text of the private key associated with your Azure DevOps Server account + `https://githubCom` or `https://gheExampleCom`). +* `oauthToken` - The token string you were given by your VCS provider, e.g. `ghpXxxxxxxxxxxxxxx` for a GitHub personal access token. For more information on how to generate this token string for your VCS provider, see the [Create an OAuth Client](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients#create-an-oauth-client) documentation. +* `privateKey` - (Required for `adoServer`) The text of the private key associated with your Azure DevOps Server account * `key` - The OAuth Client key can refer to a Consumer Key, Application Key, or another type of client key for the VCS provider. -* `secret` - (Required for `bitbucket_data_center`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the +* `secret` - (Required for `bitbucketDataCenter`) The OAuth Client secret is used for Bitbucket Data Center, this secret is the the text of the SSH private key associated with your Bitbucket Data Center Application Link. -* `rsaPublicKey` - (Required for `bitbucket_data_center`) Required for BitBucket - Server in conjunction with the secret. Not used for any other providers. The +* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for Bitbucket + Data Center in conjunction with the secret. Not used for any other providers. The text of the SSH public key associated with your Bitbucket Data Center Application Link. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `ado_server`, `ado_services`, `bitbucket_data_center`, `bitbucket_hosted`, `bitbucket_server`(deprecated), `github`, `github_enterprise`, `gitlab_hosted`, - `gitlab_community_edition`, or `gitlab_enterprise_edition`. + options are `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, + `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. +* `agentPoolId` - (Optional) An existing agent pool ID within the organization that has Private VCS support enabled. +* `organizationScoped` - (Optional) Whether or not the oauth client is scoped to all projects and workspaces in the organization. Defaults to `true`. ## Attributes Reference * `id` - The ID of the OAuth client. * `oauthTokenId` - The ID of the OAuth token associated with the OAuth client. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown index 616a73c82..fb467bb53 100644 --- a/website/docs/cdktf/typescript/r/opa_version.html.markdown +++ b/website/docs/cdktf/typescript/r/opa_version.html.markdown @@ -16,18 +16,15 @@ Manage OPA versions available on Terraform Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OpaVersion } from "./.gen/providers/tfe/opa-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new OpaVersion(this, "test", { + new tfe.opaVersion.OpaVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/opa", version: "0.58.0-custom", @@ -68,4 +65,4 @@ terraform import tfe_opa_version.test 0.58.0 -> **Note:** You can fetch a OPA version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization.html.markdown b/website/docs/cdktf/typescript/r/organization.html.markdown index dac894796..b04caf9de 100644 --- a/website/docs/cdktf/typescript/r/organization.html.markdown +++ b/website/docs/cdktf/typescript/r/organization.html.markdown @@ -44,16 +44,12 @@ The following arguments are supported: * `sessionRememberMinutes` - (Optional) Session expiration. Defaults to `20160`. * `collaboratorAuthPolicy` - (Optional) Authentication policy (`password` - or `two_factor_mandatory`). Defaults to `password`. + or `twoFactorMandatory`). Defaults to `password`. * `ownersTeamSamlRoleId` - (Optional) The name of the "owners" team. * `costEstimationEnabled` - (Optional) Whether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a HCP Terraform organization which does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration. * `sendPassingStatusesForUntriggeredSpeculativePlans` - (Optional) Whether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting has no effect and cannot be changed but is also available in Site Administration. -<<<<<<< HEAD * `aggregatedCommitStatusEnabled` - (Optional) Whether or not to enable Aggregated Status Checks. This can be useful for monorepo repositories with multiple workspaces receiving status checks for events such as a pull request. If enabled, `sendPassingStatusesForUntriggeredSpeculativePlans` needs to be false. * `assessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. -======= -* `assessmentsEnforced` - (Optional) (Available only in HCP Terraform) Whether to force health assessments (drift detection) on all eligible workspaces or allow workspaces to set their own preferences. ->>>>>>> 79010b4f (Removed all references to HCP Terraform) * `allowForceDeleteWorkspaces` - (Optional) Whether workspace administrators are permitted to delete workspaces with resources under management. If false, only organization owners may delete these workspaces. Defaults to false. ## Attributes Reference @@ -69,4 +65,4 @@ example: terraform import tfe_organization.test my-org-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown index cf68a6606..08cdc7a91 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -9,42 +9,49 @@ description: |- # tfe_organization_default_settings -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 [`tfe_workspace_settings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). +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). ## Example Usage Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { OrganizationDefaultSettings } from "./.gen/providers/tfe/organization-default-settings"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new Organization(this, "test", { - email: "admin@company.com", - name: "my-org-name", - }); - const myAgents = new AgentPool(this, "my_agents", { - name: "agent_smiths", - organization: test.name, - }); - const orgDefault = new OrganizationDefaultSettings(this, "org_default", { - defaultAgentPoolId: myAgents.id, - defaultExecutionMode: "agent", - organization: test.name, - }); - new Workspace(this, "my_workspace", { - dependsOn: [orgDefault], + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeAgentPoolMyAgents = new tfe.agentPool.AgentPool( + this, + "my_agents", + { + name: "agent_smiths", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + } + ); + const tfeOrganizationDefaultSettingsOrgDefault = + new tfe.organizationDefaultSettings.OrganizationDefaultSettings( + this, + "org_default", + { + defaultAgentPoolId: cdktf.Token.asString(tfeAgentPoolMyAgents.id), + defaultExecutionMode: "agent", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + } + ); + new tfe.workspace.Workspace(this, "my_workspace", { + dependsOn: [tfeOrganizationDefaultSettingsOrgDefault], name: "my-workspace", }); } @@ -67,7 +74,7 @@ The following arguments are supported: Organization default execution mode can be imported; use `` as the import ID. For example: ```shell -terraform import tfe_organization_default_execution_mode.test my-org-name +terraform import tfe_organization_default_settings.test my-org-name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_membership.html.markdown b/website/docs/cdktf/typescript/r/organization_membership.html.markdown index ba4af10f8..8a7b3c5d8 100644 --- a/website/docs/cdktf/typescript/r/organization_membership.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_membership.html.markdown @@ -69,4 +69,4 @@ terraform import tfe_organization_membership.test my-org-name/user@example.com terraform import tfe_organization_membership.test ou-wAs3zYmWAhYK7peR ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown index ca4ff3bab..654ef9ec1 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task.html.markdown @@ -63,4 +63,4 @@ import ID. For example: terraform import tfe_organization_run_task.test my-org-name/task-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/policy_set.html.markdown b/website/docs/cdktf/typescript/r/policy_set.html.markdown index 74aa0b73b..3a3a14959 100644 --- a/website/docs/cdktf/typescript/r/policy_set.html.markdown +++ b/website/docs/cdktf/typescript/r/policy_set.html.markdown @@ -21,63 +21,38 @@ for workspaces that the policy set is attached to. Basic usage (VCS-based policy set): -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - agentEnabled: Token.asBoolean("true"), - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policiesPath: "policies/my-policy-set", - policyToolVersion: "0.24.1", - vcsRepo: { - branch: "main", - identifier: "my-org-name/my-policy-set-repository", - ingressSubmodules: false, - oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), - }, - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policies_path = "policies/my-policy-set" + workspace_ids = [tfe_workspace.test.id] + + vcs_repo { + identifier = "my-org-name/my-policy-set-repository" + branch = "main" + ingress_submodules = false + oauth_token_id = tfe_oauth_client.test.oauth_token_id } } ``` Using manually-specified policies: -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { PolicySet } from "./.gen/providers/tfe/policy-set"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new PolicySet(this, "test", { - agentEnabled: Token.asBoolean("true"), - description: "A brand new policy set", - kind: "sentinel", - name: "my-policy-set", - organization: "my-org-name", - policyIds: [Token.asString(tfeSentinelPolicyTest.id)], - policyToolVersion: "0.24.1", - workspaceIds: [Token.asString(tfeWorkspaceTest.id)], - }); - } +```hcl +resource "tfe_policy_set" "test" { + name = "my-policy-set" + description = "A brand new policy set" + organization = "my-org-name" + kind = "sentinel" + agent_enabled = "true" + policy_tool_version = "0.24.1" + policy_ids = [tfe_sentinel_policy.test.id] + workspace_ids = [tfe_workspace.test.id] } ``` @@ -128,10 +103,10 @@ The following arguments are supported: new resource if changed. This value _must not_ be provided if `policyIds` are provided. * `workspaceIds` - (Optional) A list of workspace IDs. This value _must not_ be provided if `global` is provided. -* `slug` - (Optional) A reference to the `tfe_slug` data source that contains +* `slug` - (Optional) A reference to the `tfeSlug` data source that contains the `sourcePath` to where the local policies are located. This is used when policies are located locally, and can only be used when there is no VCS repo or -explicit Policy IDs. This _requires_ the usage of the `tfe_slug` data source. +explicit Policy IDs. This _requires_ the usage of the `tfeSlug` data source. -> **Note:** When neither `vcsRepo` or `policyIds` is not specified, the current default is to create an empty non-VCS policy set. @@ -160,4 +135,4 @@ Policy sets can be imported; use `` as the import ID. For example terraform import tfe_policy_set.test polset-wAs3zYmWAhYK7peR ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project.html.markdown b/website/docs/cdktf/typescript/r/project.html.markdown index 3ec3cb87d..d2b610ebb 100644 --- a/website/docs/cdktf/typescript/r/project.html.markdown +++ b/website/docs/cdktf/typescript/r/project.html.markdown @@ -47,6 +47,7 @@ The following arguments are supported: * `name` - (Required) Name of the project. * `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. +* `description` - (Optional) A description for the project. ## Attributes Reference @@ -62,4 +63,4 @@ Projects can be imported; use `` as the import ID. For example: terraform import tfe_project.test prj-niVoeESBXT8ZREhr ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown b/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown new file mode 100644 index 000000000..6bdf50804 --- /dev/null +++ b/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown @@ -0,0 +1,81 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_project_oauth_client" +description: |- + Add an oauth client to a project +--- + + + +# tfe_project_oauth_client + +Adds and removes oauth clients from a project + +## Example Usage + +Basic usage: + +```typescript +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { + super(scope, name); + const tfeOrganizationTest = new tfe.organization.Organization( + this, + "test", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeProjectTest = new tfe.project.Project(this, "test_1", { + name: "my-project-name", + organization: cdktf.Token.asString(tfeOrganizationTest.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectTest.overrideLogicalId("test"); + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test_2", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "oauth_token_id", + organization: tfeOrganizationTest, + serviceProvider: "github", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeOauthClientTest.overrideLogicalId("test"); + const tfeProjectOauthClientTest = + new tfe.projectOauthClient.ProjectOauthClient(this, "test_3", { + oauthClientId: cdktf.Token.asString(tfeOauthClientTest.id), + projectId: cdktf.Token.asString(tfeProjectTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + tfeProjectOauthClientTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `oauthClientId` - (Required) ID of the oauth client. +* `projectId` - (Required) Project ID to add the oauth client to. + +## Attributes Reference + +* `id` - The ID of the oauth client attachment. ID format: `_` + +## Import + +Project OAuth Clients can be imported; use `//`. For example: + +```shell +terraform import tfe_project_oauth_client.test 'my-org-name/project/oauth-client-name' +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index 3d4c9f943..851e98f10 100644 --- a/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown @@ -16,25 +16,11 @@ The provided GPG key must be ASCII-armored, i.e. starting with: ## Example Usage -```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Fn, Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { RegistryGpgKey } from "./.gen/providers/tfe/registry-gpg-key"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { - super(scope, name); - new RegistryGpgKey(this, "example", { - asciiArmor: Token.asString(Fn.file("my-public-key.asc")), - organization: "my-org-name", - }); - } +```hcl +resource "tfe_registry_gpg_key" "example" { + organization = "my-org-name" + ascii_armor = file("my-public-key.asc") } - ``` ## Argument Reference @@ -59,4 +45,4 @@ example: terraform import tfe_registry_gpg_key.example my-org-name/34365D9472D7468F ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_module.html.markdown b/website/docs/cdktf/typescript/r/registry_module.html.markdown index 67258cdb8..5bb26c416 100644 --- a/website/docs/cdktf/typescript/r/registry_module.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_module.html.markdown @@ -62,31 +62,36 @@ class MyConvertedCode extends cdktf.TerraformStack { Create private registry module with tests enabled: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { OauthClient } from "./.gen/providers/tfe/oauth-client"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryModule } from "./.gen/providers/tfe/registry-module"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const testOauthClient = new OauthClient(this, "test-oauth-client", { - apiUrl: "https://api.github.com", - httpUrl: "https://github.com", - oauthToken: "my-vcs-provider-token", - organization: testOrganization.name, - serviceProvider: "github", - }); - new RegistryModule(this, "test-registry-module", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeOauthClientTestOauthClient = new tfe.oauthClient.OauthClient( + this, + "test-oauth-client", + { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-vcs-provider-token", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), + serviceProvider: "github", + } + ); + new tfe.registryModule.RegistryModule(this, "test-registry-module", { testConfig: [ { testsEnabled: true, @@ -96,7 +101,9 @@ class MyConvertedCode extends TerraformStack { branch: "main", displayIdentifier: "my-org-name/terraform-provider-name", identifier: "my-org-name/terraform-provider-name", - oauthTokenId: testOauthClient.oauthTokenId, + oauthTokenId: cdktf.Token.asString( + tfeOauthClientTestOauthClient.oauthTokenId + ), }, }); } @@ -268,6 +275,7 @@ The following arguments are supported: * `organization` - (Optional) The name of the organization associated with the registry module. It must be set if `moduleProvider` is used, or if `vcsRepo` is used via a GitHub App. * `namespace` - (Optional) The namespace of a public registry module. It can be used if `moduleProvider` is set and `registryName` is public. * `registryName` - (Optional) Whether the registry module is private or public. It can be used if `moduleProvider` is set. +* `initialVersion` - (Optional) This specifies the initial version for a branch based module. It can be used if `vcsRepoBranch` is set. If it is omitted, the initial modules version will default to `000`. The `testConfig` block supports * `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -311,4 +319,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/registry_provider.html.markdown b/website/docs/cdktf/typescript/r/registry_provider.html.markdown index 324adacab..3094a32f4 100644 --- a/website/docs/cdktf/typescript/r/registry_provider.html.markdown +++ b/website/docs/cdktf/typescript/r/registry_provider.html.markdown @@ -16,26 +16,27 @@ Manages public and private providers in the private registry. Create private provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const example = new Organization(this, "example", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { - name: "my-provider", - organization: example.name, - }); + const tfeOrganizationExample = new tfe.organization.Organization( + this, + "example", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryProviderExample = + new tfe.registryProvider.RegistryProvider(this, "example_1", { + name: "my-provider", + organization: cdktf.Token.asString(tfeOrganizationExample.name), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -46,28 +47,29 @@ class MyConvertedCode extends TerraformStack { Create public provider: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { RegistryProvider } from "./.gen/providers/tfe/registry-provider"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const example = new Organization(this, "example", { - email: "admin@company.com", - name: "my-org-name", - }); - const tfeRegistryProviderExample = new RegistryProvider(this, "example_1", { - name: "aws", - namespace: "hashicorp", - organization: example.name, - registryName: "public", - }); + const tfeOrganizationExample = new tfe.organization.Organization( + this, + "example", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeRegistryProviderExample = + new tfe.registryProvider.RegistryProvider(this, "example_1", { + name: "aws", + namespace: "hashicorp", + organization: cdktf.Token.asString(tfeOrganizationExample.name), + registryName: "public", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeRegistryProviderExample.overrideLogicalId("example"); } @@ -106,4 +108,4 @@ Or a public provider: terraform import tfe_registry_provider.example my-org-name/public/hashicorp/aws ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/run_trigger.html.markdown b/website/docs/cdktf/typescript/r/run_trigger.html.markdown index 1c6bc9701..cf77d93e0 100644 --- a/website/docs/cdktf/typescript/r/run_trigger.html.markdown +++ b/website/docs/cdktf/typescript/r/run_trigger.html.markdown @@ -80,4 +80,4 @@ Run triggers can be imported; use `` as the import ID. For examp terraform import tfe_run_trigger.test rt-qV9JnKRkmtMa4zcA ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown index f439c7125..ebfaa56c0 100644 --- a/website/docs/cdktf/typescript/r/sentinel_version.html.markdown +++ b/website/docs/cdktf/typescript/r/sentinel_version.html.markdown @@ -16,18 +16,15 @@ Manage Sentinel versions available on HCP Terraform and Terraform Enterprise. Basic Usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { SentinelVersion } from "./.gen/providers/tfe/sentinel-version"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - new SentinelVersion(this, "test", { + new tfe.sentinelVersion.SentinelVersion(this, "test", { sha: "e75ac73deb69a6b3aa667cb0b8b731aee79e2904", url: "https://tfe-host.com/path/to/sentinel.zip", version: "0.24.0-custom", @@ -68,4 +65,4 @@ terraform import tfe_sentinel_version.test 0.24.0 -> **Note:** You can fetch a Sentinel version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team.html.markdown b/website/docs/cdktf/typescript/r/team.html.markdown index 2726bf8a9..78feb8f71 100644 --- a/website/docs/cdktf/typescript/r/team.html.markdown +++ b/website/docs/cdktf/typescript/r/team.html.markdown @@ -79,6 +79,9 @@ The `organizationAccess` block supports: * `manageRunTasks` - (Optional) Allow members to create, edit, and delete the organization's run tasks. * `manageProjects` - (Optional) Allow members to create and administrate all projects within the organization. Requires `manageWorkspaces` to be set to `true`. * `manageMembership` - (Optional) Allow members to add/remove users from the organization, and to add/remove users from visible teams. +* `manageTeams` - (Optional) Allow members to create, update, and delete teams. +* `manageOrganizationAccess` - (Optional) Allow members to update the organization access settings of teams. +* `accessSecretTeams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. ## Attributes Reference @@ -97,4 +100,4 @@ or terraform import tfe_team.test my-org-name/my-team-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown index c7e1877b3..5c5c81837 100644 --- a/website/docs/cdktf/typescript/r/team_organization_member.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_member.html.markdown @@ -77,4 +77,4 @@ or terraform import tfe_team_organization_member.test my-org-name/user@company.com/my-team-name ``` ~> **NOTE:** The `//` import ID format cannot be used if there are `/` characters in the user's email. These users must be imported with the `/` format instead - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown index 12151468f..37b905299 100644 --- a/website/docs/cdktf/typescript/r/team_organization_members.html.markdown +++ b/website/docs/cdktf/typescript/r/team_organization_members.html.markdown @@ -131,8 +131,4 @@ as the import ID. For example: terraform import tfe_team_organization_members.test team-47qC3LmA47piVan7 ``` -<<<<<<< HEAD - -======= - ->>>>>>> adf61bce (cdktf: update documentation) + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/team_project_access.html.markdown b/website/docs/cdktf/typescript/r/team_project_access.html.markdown index b221ebff0..85e1d7183 100644 --- a/website/docs/cdktf/typescript/r/team_project_access.html.markdown +++ b/website/docs/cdktf/typescript/r/team_project_access.html.markdown @@ -75,7 +75,7 @@ The following permissions apply to all workspaces (and future workspaces) in the |----------------------|-------------------------------------------------------| | `runs` | The permission to grant project's workspaces' runs. Default: `read`. Valid strings: `read`, `plan`, or `apply`. | | `sentinelMocks` | The permission to grant project's workspaces' Sentinel mocks. Default: `none`. Valid strings: `none`, or `read`. | -| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `read-outputs`, `read`, or `write`.| +| `stateVersions` | The permission to grant project's workspaces' state versions. Default: `none` Valid strings: `none`, `readOutputs`, `read`, or `write`.| | `variables` | The permission to grant project's workspaces' variables. Default `none`. Valid strings: `none`, `read`, or `write`. | | `create` | The permission to create project's workspaces in the project. Default: `false`. Valid booleans `true`, `false` | | `locking` | The permission to manually lock or unlock the project's workspaces. Default `false`. Valid booleans `true`, `false` | @@ -86,50 +86,38 @@ The following permissions apply to all workspaces (and future workspaces) in the ## Example Usage with Custom Project Permissions -```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { - super(scope, name); - const tfeProjectTest = new tfe.project.Project(this, "test", { - name: "myproject", - organization: "my-org-name", - }); - const tfeTeamDev = new tfe.team.Team(this, "dev", { - name: "my-dev-team", - organization: "my-org-name", - }); - new tfe.teamProjectAccess.TeamProjectAccess(this, "custom", { - access: "custom", - projectAccess: [ - { - settings: "read", - teams: "none", - }, - ], - projectId: cdktf.Token.asString(tfeProjectTest.id), - teamId: cdktf.Token.asString(tfeTeamDev.id), - workspaceAccess: [ - { - create: true, - delete: false, - locking: true, - move: false, - runTasks: false, - runs: "apply", - sentinelMocks: "none", - stateVersions: "write", - variables: "write", - }, - ], - }); - } +```hcl +resource "tfe_team" "dev" { + name = "my-dev-team" + organization = "my-org-name" } +resource "tfe_project" "test" { + name = "myproject" + organization = "my-org-name" +} + +resource "tfe_team_project_access" "custom" { + access = "custom" + team_id = tfe_team.dev.id + project_id = tfe_project.test.id + + project_access { + settings = "read" + teams = "none" + } + workspace_access { + state_versions = "write" + sentinel_mocks = "none" + runs = "apply" + variables = "write" + create = true + locking = true + move = false + delete = false + run_tasks = false + } +} ``` ## Attributes Reference @@ -145,4 +133,4 @@ example: terraform import tfe_team_project_access.admin tprj-2pmtXpZa4YzVMTPi ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/terraform_version.html.markdown b/website/docs/cdktf/typescript/r/terraform_version.html.markdown index 7ac1306ee..ae044a10a 100644 --- a/website/docs/cdktf/typescript/r/terraform_version.html.markdown +++ b/website/docs/cdktf/typescript/r/terraform_version.html.markdown @@ -65,4 +65,4 @@ terraform import tfe_terraform_version.test 1.1.2 -> **Note:** You can fetch a Terraform version ID from the URL of an existing version in the HCP Terraform UI. The ID is in the format `tool-` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown b/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown new file mode 100644 index 000000000..0ea52ed7c --- /dev/null +++ b/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_test_variable" +description: |- + Manages environmet variables used for testing by modules in the Private Module Registry. +--- + + + +# tfe_test_variable + +Creates, updates and destroys environment variables used for testing in the Private Module Registry. + +## Example Usage + +```hcl +resource "tfe_organization" "test_org" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_oauth_client" "test_client" { + organization = tfe_organization.test.name + api_url = "https://api.github.com" + http_url = "https://github.com" + oauth_token = "my-token-123" + service_provider = "github" +} + +resource "tfe_registry_module" "test_module" { + organization = "test-module" + vcs_repo { + display_identifier = "GH_NAME/REPO_NAME" + identifier = "GH_NAME/REPO_NAME" + oauth_token_id = tfe_oauth_client.test.oauth_token_id + branch = "main" + tags = false +} + test_config { + tests_enabled = true + } +} + +resource "tfe_test_variable" "tf_test_test_variable" { + key = "key_test" + value = "value_test" + description = "some description" + category = "env" + organization = tfe_organization.test.name + module_name = tfe_registry_module.test.name + module_provider = tfe_registry_module.test.module_provider +} +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/variable.html.markdown b/website/docs/cdktf/typescript/r/variable.html.markdown index 7a2783483..65115c35e 100644 --- a/website/docs/cdktf/typescript/r/variable.html.markdown +++ b/website/docs/cdktf/typescript/r/variable.html.markdown @@ -185,4 +185,4 @@ example: terraform import tfe_variable.test my-org-name/varset-47qC3LmA47piVan7/var-5rTwnSaRPogw6apb ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace.html.markdown b/website/docs/cdktf/typescript/r/workspace.html.markdown index dd11c8fb7..a1b073f5c 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -65,21 +65,22 @@ class MyConvertedCode extends cdktf.TerraformStack { name: "my-org-name", } ); - const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( - this, - "test-agent-pool", - { - name: "my-agent-pool-name", - organization: cdktf.Token.asString( - tfeOrganizationTestOrganization.name - ), - } - ); - new tfe.workspace.Workspace(this, "test", { - agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), - executionMode: "agent", - name: "my-workspace-name", - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + const tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "oauth_token_id", + organization: tfeOrganizationTestOrganization, + serviceProvider: "github", + }); + new tfe.workspace.Workspace(this, "parent", { + name: "parent-ws", + organization: tfeOrganizationTestOrganization, + queueAllRuns: false, + vcsRepo: { + branch: "main", + identifier: "my-org-name/vcs-repository", + oauthTokenId: cdktf.Token.asString(tfeOauthClientTest.oauthTokenId), + }, }); } } @@ -96,6 +97,10 @@ The following arguments are supported: * `assessmentsEnabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `autoApply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `autoApplyRunTrigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. +* `autoDestroyAt` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). + +~> **NOTE:** `autoDestroyAt` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignoreChanges` for this attribute may be preferred. + * `description` - (Optional) A description for the workspace. * `executionMode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead. * `fileTriggersEnabled` - (Optional) Whether to filter runs based on the changed files @@ -152,7 +157,7 @@ will be used. (like `~> 1.0.0`); if you specify a constraint, the workspace will always use the newest release that meets that constraint. Defaults to the latest available version. -* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `trigger-prefixes`. +* `triggerPatterns` - (Optional) List of [glob patterns](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/vcs#glob-patterns-for-automatic-run-triggering) that describe the files HCP Terraform monitors for changes. Trigger patterns are always appended to the root directory of the repository. Mutually exclusive with `triggerPrefixes`. * `triggerPrefixes` - (Optional) List of repository-root-relative paths which describe all locations to be tracked for changes. * `vcsRepo` - (Optional) Settings for the workspace's VCS repository, enabling the [UI/VCS-driven run workflow](https://developer.hashicorp.com/terraform/cloud-docs/run/ui). @@ -171,7 +176,7 @@ The `vcsRepo` block supports: * `ingressSubmodules` - (Optional) Whether submodules should be fetched when cloning the VCS repository. Defaults to `false`. * `oauthTokenId` - (Optional) The VCS Connection (OAuth Connection + Token) to use. - This ID can be obtained from a `tfe_oauth_client` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. + This ID can be obtained from a `tfeOauthClient` resource. This conflicts with `githubAppInstallationId` and can only be used if `githubAppInstallationId` is not used. * `tagsRegex` - (Optional) A regular expression used to trigger a Workspace run for matching Git tags. This option conflicts with `triggerPatterns` and `triggerPrefixes`. Should only set this value if the former is not being used. ## Attributes Reference @@ -195,4 +200,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace.test my-org-name/my-wkspace-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run.html.markdown b/website/docs/cdktf/typescript/r/workspace_run.html.markdown index 5d7f547bb..61a417d34 100644 --- a/website/docs/cdktf/typescript/r/workspace_run.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run.html.markdown @@ -14,10 +14,10 @@ Provides a resource to manage the _initial_ and/or _final_ Terraform run in a gi There are a few main use cases this resource was designed for: - **Workspaces that depend on other workspaces.** If a workspace will create infrastructure that other workspaces rely on (for example, a Kubernetes cluster to deploy resources into), those downstream workspaces can depend on an initial `apply` with `wait_for_run = true`, so they aren't created before their infrastructure dependencies. -- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfe_workspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfe_variable` resources themselves depend on the `tfe_workspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfe_variables`, you can accomplish the same goal without a circular dependency. -- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfe_workspace` resource's default safe deletion behavior. +- **A more reliable `queue_all_runs = true`.** The `queueAllRuns` argument on `tfeWorkspace` requests an initial run, which can complete asynchronously outside of the Terraform run that creates the workspace. Unfortunately, it can't be used with workspaces that require variables to be set, because the `tfeVariable` resources themselves depend on the `tfeWorkspace`. By managing an initial `apply` with `wait_for_run = false` that depends on your `tfeVariables`, you can accomplish the same goal without a circular dependency. +- **Safe workspace destruction.** To ensure a workspace's managed resources are destroyed before deleting it, manage a `destroy` with `wait_for_run = true`. When you destroy the whole configuration, Terraform will wait for the destroy run to complete before deleting the workspace. This pattern is compatible with the `tfeWorkspace` resource's default safe deletion behavior. -The `tfe_workspace_run` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfe_workspace_run` resource that includes an `apply` block will queue a new apply when added to a config. +The `tfeWorkspaceRun` expects to own exactly one apply during a creation and/or one destroy during a destruction. This implies that even if previous successful applies exist in the workspace, a `tfeWorkspaceRun` resource that includes an `apply` block will queue a new apply when added to a config. ## Example Usage @@ -223,16 +223,16 @@ Both `apply` and `destroy` block supports: * `manualConfirm` - (Required) If set to true a human will have to manually confirm a plan in HCP Terraform's UI to start an apply. If set to false, this resource will be automatically applied. Defaults to `false`. * If `waitForRun` is set to `false`, this auto-apply will be done by HCP Terraform. * If `waitForRun` is set to `true`, the apply will be confirmed by the provider. The exception is the case of policy check soft-failed where a human has to perform an override by manually confirming the plan even though `manualConfirm` is set to false. - * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfe_workspace` data source. + * Note that this setting will override the workspace's default apply mode. To use the workspace default apply mode, look up the setting for `autoApply` with the `tfeWorkspace` data source. * `retry` - (Optional) Whether or not to retry on plan or apply errors. When set to true, `retryAttempts` must also be greater than zero inorder for retries to happen. Defaults to `true`. * `retryAttempts` - (Optional) The number to retry attempts made after an initial error. Defaults to `3`. * `retryBackoffMin` - (Optional) The minimum time in seconds to backoff before attempting a retry. Defaults to `1`. * `retryBackoffMax` - (Optional) The maximum time in seconds to backoff before attempting a retry. Defaults to `30`. -* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfe_workspace_run` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. +* `waitForRun` - (Optional) Whether or not to wait for a run to reach completion before considering this a success. When set to `false`, the provider considers the `tfeWorkspaceRun` resource to have been created immediately after the run has been queued. When set to `true`, the provider waits for a successful apply on the target workspace to have applied successfully (or if it resulted in a no-change plan). Defaults to `true`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - The ID of the run created by this resource. Note, if the resource was created without an `apply{}` configuration block, then this ID will not refer to a real run in HCP Terraform. - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown index 459eaab6e..3ec9bba3e 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -32,7 +32,7 @@ The following arguments are supported: * `enforcementLevel` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`. * `taskId` - (Required) The id of the Run task to associate to the Workspace. * `workspaceId` - (Required) The id of the workspace to associate the Run task to. -* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`. +* `stage` - (Optional) The stage to run the task in. Valid values are `prePlan`, `postPlan`, and `preApply`. ## Attributes Reference @@ -47,4 +47,4 @@ import ID. For example: terraform import tfe_workspace_run_task.test my-org-name/workspace/task-name ``` - + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/workspace_settings.markdown b/website/docs/cdktf/typescript/r/workspace_settings.markdown index 5ce4c9141..1551ccdf1 100644 --- a/website/docs/cdktf/typescript/r/workspace_settings.markdown +++ b/website/docs/cdktf/typescript/r/workspace_settings.markdown @@ -16,30 +16,29 @@ Manages or reads execution mode and agent pool settings for a workspace. This al Basic usage: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); - new WorkspaceSettings(this, "test-settings", { + new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { executionMode: "local", - workspaceId: test.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); } } @@ -49,49 +48,53 @@ class MyConvertedCode extends TerraformStack { With `executionMode` of `agent`: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { AgentPool } from "./.gen/providers/tfe/agent-pool"; -import { AgentPoolAllowedWorkspaces } from "./.gen/providers/tfe/agent-pool-allowed-workspaces"; -import { Organization } from "./.gen/providers/tfe/organization"; -import { Workspace } from "./.gen/providers/tfe/workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const testOrganization = new Organization(this, "test-organization", { - email: "admin@company.com", - name: "my-org-name", - }); - const test = new Workspace(this, "test", { + const tfeOrganizationTestOrganization = new tfe.organization.Organization( + this, + "test-organization", + { + email: "admin@company.com", + name: "my-org-name", + } + ); + const tfeWorkspaceTest = new tfe.workspace.Workspace(this, "test", { name: "my-workspace-name", - organization: testOrganization.name, - }); - const testAgentPool = new AgentPool(this, "test-agent-pool", { - name: "my-agent-pool-name", - organization: testOrganization.name, + organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), }); - const tfeAgentPoolAllowedWorkspacesTest = new AgentPoolAllowedWorkspaces( + const tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( this, - "test_3", + "test-agent-pool", { - agentPoolId: testAgentPool.id, - allowedWorkspaceIds: [test.id], + name: "my-agent-pool-name", + organization: cdktf.Token.asString( + tfeOrganizationTestOrganization.name + ), } ); + const tfeAgentPoolAllowedWorkspacesTest = + new tfe.agentPoolAllowedWorkspaces.AgentPoolAllowedWorkspaces( + this, + "test_3", + { + agentPoolId: cdktf.Token.asString(tfeAgentPoolTestAgentPool.id), + allowedWorkspaceIds: [cdktf.Token.asString(tfeWorkspaceTest.id)], + } + ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeAgentPoolAllowedWorkspacesTest.overrideLogicalId("test"); - new WorkspaceSettings(this, "test-settings", { - agentPoolId: Token.asString( + new tfe.workspaceSettings.WorkspaceSettings(this, "test-settings", { + agentPoolId: cdktf.Token.asString( tfeAgentPoolAllowedWorkspacesTest.agentPoolId ), executionMode: "agent", - workspaceId: test.id, + workspaceId: cdktf.Token.asString(tfeWorkspaceTest.id), }); } } @@ -101,32 +104,33 @@ class MyConvertedCode extends TerraformStack { This resource may be used as a data source when no optional arguments are defined: ```typescript -// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug -import { Construct } from "constructs"; -import { Token, TerraformOutput, Op, Fn, TerraformStack } from "cdktf"; -/* - * Provider bindings are generated by running `cdktf get`. - * See https://cdk.tf/provider-generation for more details. - */ -import { DataTfeWorkspace } from "./.gen/providers/tfe/data-tfe-workspace"; -import { WorkspaceSettings } from "./.gen/providers/tfe/workspace-settings"; -class MyConvertedCode extends TerraformStack { - constructor(scope: Construct, name: string) { +import * as constructs from "constructs"; +import * as cdktf from "cdktf"; +/*Provider bindings are generated by running cdktf get. +See https://cdk.tf/provider-generation for more details.*/ +import * as tfe from "./.gen/providers/tfe"; +class MyConvertedCode extends cdktf.TerraformStack { + constructor(scope: constructs.Construct, name: string) { super(scope, name); - const test = new DataTfeWorkspace(this, "test", { - name: "my-workspace-name", - organization: "my-org-name", - }); - const tfeWorkspaceSettingsTest = new WorkspaceSettings(this, "test_1", { - workspaceId: Token.asString(test.id), - }); + const dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( + this, + "test", + { + name: "my-workspace-name", + organization: "my-org-name", + } + ); + const tfeWorkspaceSettingsTest = + new tfe.workspaceSettings.WorkspaceSettings(this, "test_1", { + workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeWorkspaceSettingsTest.overrideLogicalId("test"); - new TerraformOutput(this, "workspace-explicit-local-execution", { - value: Fn.alltrue( - Token.asAny([ - Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), - Fn.lookupNested(tfeWorkspaceSettingsTest.overwrites, [ + new cdktf.TerraformOutput(this, "workspace-explicit-local-execution", { + value: cdktf.Fn.alltrue( + cdktf.Token.asAny([ + cdktf.Op.eq(tfeWorkspaceSettingsTest.executionMode, "local"), + cdktf.propertyAccess(tfeWorkspaceSettingsTest.overwrites, [ "0", '"execution_mode"', ]), @@ -146,7 +150,7 @@ The following arguments are supported: * `agentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `executionMode` to be set to `agent`. This value _must not_ be provided if `executionMode` is set to any other value. * `executionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) - to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. + to use. Using HCP Terraform, valid values are `remote`, `local` or `agent`. When set to `local`, the workspace will be used for state storage only. **Important:** If you omit this attribute, the resource configures the workspace to use your organization's default execution mode (which in turn defaults to `remote`), removing any explicit value that might have previously been set for the workspace. ## Attributes Reference @@ -155,7 +159,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The workspace ID. * `overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource. - `executionMode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode) - - `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) + - `agentPool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool) ## Import @@ -170,4 +174,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name ``` - \ No newline at end of file + \ No newline at end of file From 3f2bf7496b75b5acaad79a58488c9a764792e8b1 Mon Sep 17 00:00:00 2001 From: Chris Trombley Date: Thu, 13 Jun 2024 16:58:05 -0700 Subject: [PATCH 405/420] chore: revise changelog for 0.55.0 and include an explanation --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc436c232..a7a37b3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ BUG FIXES: FEATURES: * `r/tfe_team`: Add attributes `manage_teams`, `manage_organization_access`, and `access_secret_teams` to `organization_access` on `tfe_team` by @juliannatetreault [#1313](https://github.com/hashicorp/terraform-provider-tfe/pull/1313) +NOTES: +* This release's changes have been edited for correctness. [#1351](https://github.com/hashicorp/terraform-provider-tfe/pull/1351) (`r/tfe_project`: Increase the Project name length from 36 to 40 characters) was erroneously reported as included in the v0.55.0 release. Those changes have been included in v0.56.0. + ## v0.54.0 ENHANCEMENTS: From 48c8b7e8e117aecafb6361d5248b2fa000736029 Mon Sep 17 00:00:00 2001 From: emlanctot Date: Tue, 14 May 2024 13:45:22 -0700 Subject: [PATCH 406/420] chore: add manage-agent-pools to team organization access --- internal/provider/resource_tfe_team.go | 8 ++++++++ internal/provider/resource_tfe_team_test.go | 16 ++++++++++++++++ website/docs/r/team.html.markdown | 1 + 3 files changed, 25 insertions(+) diff --git a/internal/provider/resource_tfe_team.go b/internal/provider/resource_tfe_team.go index e871d07e7..937ceffc1 100644 --- a/internal/provider/resource_tfe_team.go +++ b/internal/provider/resource_tfe_team.go @@ -120,6 +120,11 @@ func resourceTFETeam() *schema.Resource { Optional: true, Default: false, }, + "manage_agent_pools": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -173,6 +178,7 @@ func resourceTFETeamCreate(d *schema.ResourceData, meta interface{}) error { ManageTeams: tfe.Bool(organizationAccess["manage_teams"].(bool)), ManageOrganizationAccess: tfe.Bool(organizationAccess["manage_organization_access"].(bool)), AccessSecretTeams: tfe.Bool(organizationAccess["access_secret_teams"].(bool)), + ManageAgentPools: tfe.Bool(organizationAccess["manage_agent_pools"].(bool)), } } @@ -236,6 +242,7 @@ func resourceTFETeamRead(d *schema.ResourceData, meta interface{}) error { "manage_teams": team.OrganizationAccess.ManageTeams, "manage_organization_access": team.OrganizationAccess.ManageOrganizationAccess, "access_secret_teams": team.OrganizationAccess.AccessSecretTeams, + "manage_agent_pools": team.OrganizationAccess.ManageAgentPools, }} if err := d.Set("organization_access", organizationAccess); err != nil { return fmt.Errorf("error setting organization access for team %s: %w", d.Id(), err) @@ -276,6 +283,7 @@ func resourceTFETeamUpdate(d *schema.ResourceData, meta interface{}) error { ManageTeams: tfe.Bool(organizationAccess["manage_teams"].(bool)), ManageOrganizationAccess: tfe.Bool(organizationAccess["manage_organization_access"].(bool)), AccessSecretTeams: tfe.Bool(organizationAccess["access_secret_teams"].(bool)), + ManageAgentPools: tfe.Bool(organizationAccess["manage_agent_pools"].(bool)), } } diff --git a/internal/provider/resource_tfe_team_test.go b/internal/provider/resource_tfe_team_test.go index 22f79c60d..a64042e47 100644 --- a/internal/provider/resource_tfe_team_test.go +++ b/internal/provider/resource_tfe_team_test.go @@ -85,6 +85,8 @@ func TestAccTFETeam_full(t *testing.T) { "tfe_team.foobar", "organization_access.0.manage_organization_access", "true"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.access_secret_teams", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_agent_pools", "true"), ), }, }, @@ -138,6 +140,8 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "organization_access.0.manage_organization_access", "true"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.access_secret_teams", "true"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_agent_pools", "true"), ), }, { @@ -178,6 +182,8 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "organization_access.0.manage_organization_access", "false"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.access_secret_teams", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_agent_pools", "false"), ), }, { @@ -219,6 +225,8 @@ func TestAccTFETeam_full_update(t *testing.T) { "tfe_team.foobar", "organization_access.0.manage_organization_access", "false"), resource.TestCheckResourceAttr( "tfe_team.foobar", "organization_access.0.access_secret_teams", "false"), + resource.TestCheckResourceAttr( + "tfe_team.foobar", "organization_access.0.manage_agent_pools", "false"), ), }, }, @@ -480,6 +488,9 @@ func testAccCheckTFETeamAttributes_full( if !team.OrganizationAccess.AccessSecretTeams { return fmt.Errorf("OrganizationAccess.AccessSecretTeams should be true") } + if !team.OrganizationAccess.ManageAgentPools { + return fmt.Errorf("OrganizationAccess.ManageAgentPools should be true") + } if team.SSOTeamID != "team-test-sso-id" { return fmt.Errorf("Bad SSO Team ID: %s", team.SSOTeamID) @@ -527,6 +538,9 @@ func testAccCheckTFETeamAttributes_full_update( if team.OrganizationAccess.AccessSecretTeams { return fmt.Errorf("OrganizationAccess.AccessSecretTeams should be false") } + if team.OrganizationAccess.ManageAgentPools { + return fmt.Errorf("OrganizationAccess.ManageAgentPools should be false") + } if team.SSOTeamID != "changed-sso-id" { return fmt.Errorf("Bad SSO Team ID: %s", team.SSOTeamID) @@ -598,6 +612,7 @@ resource "tfe_team" "foobar" { manage_teams = true manage_organization_access = true access_secret_teams = true + manage_agent_pools = true } sso_team_id = "team-test-sso-id" }`, rInt) @@ -631,6 +646,7 @@ resource "tfe_team" "foobar" { manage_teams = false manage_organization_access = false access_secret_teams = false + manage_agent_pools = false } sso_team_id = "changed-sso-id" diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown index 4a2e76d49..c3dca4146 100644 --- a/website/docs/r/team.html.markdown +++ b/website/docs/r/team.html.markdown @@ -58,6 +58,7 @@ The `organization_access` block supports: * `manage_teams` - (Optional) Allow members to create, update, and delete teams. * `manage_organization_access` - (Optional) Allow members to update the organization access settings of teams. * `access_secret_teams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. +* `manage_secret_teams` - (Optional) Allows members to create, edit, and delete agent pools within their organization. ## Attributes Reference From 9c3014487daaacfb9144609851421f108890a707 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Fri, 14 Jun 2024 10:33:47 -0700 Subject: [PATCH 407/420] fmt --- internal/provider/data_retention_policy.go | 4 ++-- .../provider/resource_tfe_data_retention_policy.go | 12 ++++++------ .../resource_tfe_data_retention_policy_test.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/provider/data_retention_policy.go b/internal/provider/data_retention_policy.go index 771c7b106..6cf70d10a 100644 --- a/internal/provider/data_retention_policy.go +++ b/internal/provider/data_retention_policy.go @@ -1,11 +1,11 @@ package provider import ( - "github.com/hashicorp/go-tfe" - "github.com/hashicorp/terraform-plugin-framework/types" "context" + "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "math/big" ) diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 2e7542fa9..38a20e4a2 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -4,20 +4,20 @@ import ( "context" "fmt" "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/numbervalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/numberplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-plugin-log/tflog" "strings" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/numberplanmodifier" - "github.com/hashicorp/terraform-plugin-framework-validators/numbervalidator" ) // Ensure provider defined types fully satisfy framework interfaces. diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go index 7d86a3281..7529c7884 100644 --- a/internal/provider/resource_tfe_data_retention_policy_test.go +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" + "fmt" tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "fmt" "os" ) From 417a8910397647f1bd1095f34515cba9d5b58ef7 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Fri, 14 Jun 2024 11:04:19 -0700 Subject: [PATCH 408/420] fix lint errors --- internal/provider/data_retention_policy.go | 28 ++-------- .../resource_tfe_data_retention_policy.go | 55 ++++++++++--------- 2 files changed, 34 insertions(+), 49 deletions(-) diff --git a/internal/provider/data_retention_policy.go b/internal/provider/data_retention_policy.go index 6cf70d10a..919c26feb 100644 --- a/internal/provider/data_retention_policy.go +++ b/internal/provider/data_retention_policy.go @@ -13,7 +13,7 @@ import ( type modelTFEDataRetentionPolicy struct { ID types.String `tfsdk:"id"` Organization types.String `tfsdk:"organization"` - WorkspaceId types.String `tfsdk:"workspace_id"` + WorkspaceID types.String `tfsdk:"workspace_id"` DeleteOlderThan types.Object `tfsdk:"delete_older_than"` DontDelete types.Object `tfsdk:"dont_delete"` } @@ -45,7 +45,7 @@ func modelFromTFEDataRetentionPolicyDeleteOlder(ctx context.Context, model model return modelTFEDataRetentionPolicy{ ID: types.StringValue(deleteOlder.ID), Organization: model.Organization, - WorkspaceId: model.WorkspaceId, + WorkspaceID: model.WorkspaceID, DeleteOlderThan: deleteOlderThanObject, DontDelete: types.ObjectNull(map[string]attr.Type{}), }, diags @@ -55,37 +55,17 @@ func modelFromTFEDataRetentionPolicyDontDelete(model modelTFEDataRetentionPolicy return modelTFEDataRetentionPolicy{ ID: types.StringValue(dontDelete.ID), Organization: model.Organization, - WorkspaceId: model.WorkspaceId, + WorkspaceID: model.WorkspaceID, DeleteOlderThan: types.ObjectNull(modelTFEDeleteOlderThan{}.AttributeTypes()), DontDelete: DontDeleteEmptyObject(), } } -func modelFromTFELegacyDataRetentionPolicy(ctx context.Context, model modelTFEDataRetentionPolicy, legacy *tfe.DataRetentionPolicy) (modelTFEDataRetentionPolicy, diag.Diagnostics) { - deleteOlderThan := modelTFEDeleteOlderThan{ - Days: types.NumberValue(big.NewFloat(float64(legacy.DeleteOlderThanNDays))), - } - deleteOlderThanObject, diags := types.ObjectValueFrom(ctx, deleteOlderThan.AttributeTypes(), deleteOlderThan) - - return modelTFEDataRetentionPolicy{ - ID: types.StringValue(legacy.ID), - Organization: model.Organization, - WorkspaceId: model.WorkspaceId, - DeleteOlderThan: deleteOlderThanObject, - DontDelete: types.ObjectNull(map[string]attr.Type{}), - }, diags -} - func modelFromTFEDataRetentionPolicyChoice(ctx context.Context, model modelTFEDataRetentionPolicy, choice *tfe.DataRetentionPolicyChoice) (modelTFEDataRetentionPolicy, diag.Diagnostics) { if choice.DataRetentionPolicyDeleteOlder != nil { return modelFromTFEDataRetentionPolicyDeleteOlder(ctx, model, choice.DataRetentionPolicyDeleteOlder) } var emptyDiag []diag.Diagnostic - if choice.DataRetentionPolicyDontDelete != nil { - return modelFromTFEDataRetentionPolicyDontDelete(model, choice.DataRetentionPolicyDontDelete), emptyDiag - } - - legacyPolicy := choice.ConvertToLegacyStruct() - return modelFromTFELegacyDataRetentionPolicy(ctx, model, legacyPolicy) + return modelFromTFEDataRetentionPolicyDontDelete(model, choice.DataRetentionPolicyDontDelete), emptyDiag } diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 38a20e4a2..99c74bd70 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -140,7 +140,6 @@ func (r *resourceTFEDataRetentionPolicy) Create(ctx context.Context, req resourc r.createDontDeleteRetentionPolicy(ctx, plan, resp) return } - } func (r *resourceTFEDataRetentionPolicy) ensureOrganizationIsSet(ctx context.Context, model *modelTFEDataRetentionPolicy, data AttrGettable, diags *diag.Diagnostics) { @@ -149,7 +148,7 @@ func (r *resourceTFEDataRetentionPolicy) ensureOrganizationIsSet(ctx context.Con return } - if model.WorkspaceId.IsNull() { + if model.WorkspaceID.IsNull() { var organization string diags.Append(r.config.dataOrDefaultOrganization(ctx, data, &organization)...) model.Organization = types.StringValue(organization) @@ -173,10 +172,10 @@ func (r *resourceTFEDataRetentionPolicy) createDeleteOlderThanRetentionPolicy(ct tflog.Debug(ctx, "Creating data retention policy") var dataRetentionPolicy *tfe.DataRetentionPolicyDeleteOlder var err error - if plan.WorkspaceId.IsNull() { + if plan.WorkspaceID.IsNull() { dataRetentionPolicy, err = r.config.Client.Organizations.SetDataRetentionPolicyDeleteOlder(ctx, plan.Organization.ValueString(), options) } else { - dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDeleteOlder(ctx, plan.WorkspaceId.ValueString(), options) + dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDeleteOlder(ctx, plan.WorkspaceID.ValueString(), options) } if err != nil { resp.Diagnostics.AddError("Unable to create data retention policy", err.Error()) @@ -211,10 +210,10 @@ func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx con tflog.Debug(ctx, "Creating data retention policy") var dataRetentionPolicy *tfe.DataRetentionPolicyDontDelete var err error - if plan.WorkspaceId.IsNull() { + if plan.WorkspaceID.IsNull() { dataRetentionPolicy, err = r.config.Client.Organizations.SetDataRetentionPolicyDontDelete(ctx, plan.Organization.ValueString(), options) } else { - dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDontDelete(ctx, plan.WorkspaceId.ValueString(), options) + dataRetentionPolicy, err = r.config.Client.Workspaces.SetDataRetentionPolicyDontDelete(ctx, plan.WorkspaceID.ValueString(), options) } if err != nil { resp.Diagnostics.AddError("Unable to create data retention policy", err.Error()) @@ -233,7 +232,7 @@ func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx con func (r *resourceTFEDataRetentionPolicy) ensureOrganizationSetAfterApply(policy *modelTFEDataRetentionPolicy, diags *diag.Diagnostics) { if policy.Organization.IsUnknown() { - workspace, err := r.config.Client.Workspaces.ReadByID(ctx, policy.WorkspaceId.ValueString()) + workspace, err := r.config.Client.Workspaces.ReadByID(ctx, policy.WorkspaceID.ValueString()) if err != nil { diags.AddError("Unable to create data retention policy", err.Error()) return @@ -254,14 +253,14 @@ func (r *resourceTFEDataRetentionPolicy) Read(ctx context.Context, req resource. var policy *tfe.DataRetentionPolicyChoice var err error - if state.WorkspaceId.IsNull() { + if state.WorkspaceID.IsNull() { policy, err = r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, state.Organization.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) return } } else { - policy, err = r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, state.WorkspaceId.ValueString()) + policy, err = r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, state.WorkspaceID.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) return @@ -295,7 +294,7 @@ func (r *resourceTFEDataRetentionPolicy) Delete(ctx context.Context, req resourc return } - if state.WorkspaceId.IsNull() { + if state.WorkspaceID.IsNull() { tflog.Debug(ctx, fmt.Sprintf("Deleting data retention policy for organization: %s", state.Organization)) err := r.config.Client.Organizations.DeleteDataRetentionPolicy(ctx, state.Organization.ValueString()) if err != nil { @@ -303,29 +302,32 @@ func (r *resourceTFEDataRetentionPolicy) Delete(ctx context.Context, req resourc return } } else { - tflog.Debug(ctx, fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceId)) - err := r.config.Client.Workspaces.DeleteDataRetentionPolicy(ctx, state.WorkspaceId.ValueString()) + tflog.Debug(ctx, fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceID)) + err := r.config.Client.Workspaces.DeleteDataRetentionPolicy(ctx, state.WorkspaceID.ValueString()) if err != nil { - resp.Diagnostics.AddError(fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceId), err.Error()) + resp.Diagnostics.AddError(fmt.Sprintf("Deleting data retention policy for workspace: %s", state.WorkspaceID), err.Error()) return } } - } func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { s := strings.Split(req.ID, "/") - if len(s) >= 3 { + if len(s) >= 3 || len(s) == 0 { resp.Diagnostics.AddError("Error importing workspace settings", fmt.Sprintf( "invalid workspace input format: %s (expected / or )", req.ID, )) - } else if len(s) == 2 { + return + } + + if len(s) == 2 { workspaceID, err := fetchWorkspaceExternalID(s[0]+"/"+s[1], r.config.Client) if err != nil { resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( "error retrieving workspace with name %s from organization %s: %s", s[1], s[0], err.Error(), )) + return } policy, err := r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, workspaceID) @@ -333,21 +335,24 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( "error retrieving data policy for workspace %s from organization %s: %s", s[1], s[0], err.Error(), )) + return } req.ID = r.getPolicyID(policy) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), workspaceID)...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) - } else if len(s) == 1 { - policy, err := r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, s[0]) - if err != nil { - resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( - "error retrieving data policy for organization %s: %s", s[0], err.Error(), - )) - } - req.ID = r.getPolicyID(policy) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) + return + } + + policy, err := r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, s[0]) + if err != nil { + resp.Diagnostics.AddError("Error importing data retention policy", fmt.Sprintf( + "error retrieving data policy for organization %s: %s", s[0], err.Error(), + )) + return } + req.ID = r.getPolicyID(policy) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) } func (r *resourceTFEDataRetentionPolicy) getPolicyID(policy *tfe.DataRetentionPolicyChoice) string { From 1760252545485096ff7b4a5d6c510eaaeba99a83 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Fri, 14 Jun 2024 11:07:40 -0700 Subject: [PATCH 409/420] skip tests for data retention policies if enterprise is not enabled --- .../resource_tfe_data_retention_policy_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go index 7529c7884..00a62f3cb 100644 --- a/internal/provider/resource_tfe_data_retention_policy_test.go +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -13,6 +13,8 @@ import ( ) func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { + skipIfCloud(t) + policy := &tfe.DataRetentionPolicyChoice{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -48,6 +50,8 @@ func TestAccTFEDataRetentionPolicy_basic(t *testing.T) { } func TestAccTFEDataRetentionPolicy_dontdelete_basic(t *testing.T) { + skipIfCloud(t) + policy := &tfe.DataRetentionPolicyChoice{} rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -74,6 +78,8 @@ func TestAccTFEDataRetentionPolicy_dontdelete_basic(t *testing.T) { } func TestAccTFEDataRetentionPolicy_explicit_organization(t *testing.T) { + skipIfCloud(t) + policy := &tfe.DataRetentionPolicyChoice{} orgName, _ := setupDefaultOrganization(t) @@ -111,6 +117,8 @@ func TestAccTFEDataRetentionPolicy_explicit_organization(t *testing.T) { } func TestAccTFEDataRetentionPolicy_implicit_organization(t *testing.T) { + skipIfCloud(t) + policy := &tfe.DataRetentionPolicyChoice{} defaultOrgName, _ := setupDefaultOrganization(t) @@ -148,6 +156,8 @@ func TestAccTFEDataRetentionPolicy_implicit_organization(t *testing.T) { } func TestAccTFEDataRetentionPolicy_dontdelete_organization_level(t *testing.T) { + skipIfCloud(t) + policy := &tfe.DataRetentionPolicyChoice{} defaultOrgName, _ := setupDefaultOrganization(t) From 80d23c02915d3f726f037187a61e471693d6dea8 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Fri, 14 Jun 2024 11:23:44 -0700 Subject: [PATCH 410/420] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 672418c61..0c9d94e63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ ENHANCEMENTS: * `r/tfe_registry_module`: Add `initial_version` support for Branch Based Modules by @aaabdelgany [#1363](https://github.com/hashicorp/terraform-provider-tfe/pull/1363) * `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @roleesinhaHC [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255) +FEATURES: +* **New Resource**: `r/tfe_data_retention_policy` is a new resource for managing data retention policies for organizations and workspaces, by @SwiftEngineer [1385](https://github.com/hashicorp/terraform-provider-tfe/pull/1385) + BUG FIXES: * `r/tfe_registry_module`: Prevents constant diff after a successful apply when `tags` and `tests_enabled` is not set by @Uk1288 [#1357](https://github.com/hashicorp/terraform-provider-tfe/pull/1357) From 106e41421e37bcdf195d68a082d4f2c167fdbfa2 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Fri, 14 Jun 2024 11:44:48 -0700 Subject: [PATCH 411/420] add documentation --- .../r/data_retention_policy.html.markdown | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 website/docs/r/data_retention_policy.html.markdown diff --git a/website/docs/r/data_retention_policy.html.markdown b/website/docs/r/data_retention_policy.html.markdown new file mode 100644 index 000000000..f6984fb75 --- /dev/null +++ b/website/docs/r/data_retention_policy.html.markdown @@ -0,0 +1,99 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_data_retention_policy" +description: |- + Manages data retention policies for organizations and workspaces +--- + +# tfe_data_retention_policy + +Creates a data retention policy attached to either an organization or workspace. This resource is for Terraform Enterprise only. + +## Example Usage + +Creating a data retention policy for a workspace: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +resource "tfe_data_retention_policy" "foobar" { + workspace_id = tfe_workspace.test-workspace.id + + delete_older_than { + days = 42 + } +} +``` + +Creating a data retention policy for an organization: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +resource "tfe_data_retention_policy" "foobar" { + organization = tfe_organization.test-organization.name + + delete_older_than { + days = 1138 + } +} +``` + +Creating a data retention policy for an organization and exclude a single workspace from it: + +```hcl +resource "tfe_organization" "test-organization" { + name = "my-org-name" + email = "admin@company.com" +} + +// create data retention policy the organization +resource "tfe_data_retention_policy" "foobar" { + organization = tfe_organization.test-organization.name + + delete_older_than { + days = 1138 + } +} + +resource "tfe_workspace" "test-workspace" { + name = "my-workspace-name" + organization = tfe_organization.test-organization.name +} + +// create a policy that prevents automatic deletion of data in the test-workspace +resource "tfe_data_retention_policy" "foobar" { + workspace_id = tfe_workspace.test-workspace.id + + dont_delete {} +} +``` + +## Argument Reference + +The following arguments are supported: + +* `organization` - (Optional) The name of the organization you want the policy to apply to. Must not be set if `workspace_id` is set. +* `workspace_id` - (Optional) The ID of the workspace you want the policy to apply to. Must not be set if `organization` is set. +* `delete_older_than` - (Optional) If this block is set, the created policy will apply to any data older than the configured number of days. Must not be set if `dont_delete` is set. +* `dont_delete` - (Optional) If this block is set, the created policy will prevent other policies from deleting data from this workspace or organization. Must not be set if `delete_older_than` is set. + + +## Import + +A resource can be imported; use `/` or `` as the import ID. For example: + +```shell +terraform import tfe_data_retention_policy.foobar my-org-name/my-workspace-name +``` From ad38813fa8e1c969a0e3b19e3d00e9a564ec44e0 Mon Sep 17 00:00:00 2001 From: emlanctot Date: Fri, 14 Jun 2024 11:12:58 -0700 Subject: [PATCH 412/420] chore: update changelog for manage_agent_pools addition --- CHANGELOG.md | 3 +++ website/docs/r/team.html.markdown | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a37b3f1..31bf3bdaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Unreleased +FEATURES: +* `r/tfe_team`: Add attribute `manage_agent_pools` to `organization_access` on `tfe_team` by @emlanctot [#1358](https://github.com/hashicorp/terraform-provider-tfe/pull/1358) + ## v0.56.0 ENHANCEMENTS: diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown index c3dca4146..9fff72873 100644 --- a/website/docs/r/team.html.markdown +++ b/website/docs/r/team.html.markdown @@ -24,7 +24,7 @@ Organization Permission usage: ```hcl resource "tfe_team" "test" { - name = "my-team-name" + name = "my-team-name organization = "my-org-name" organization_access { manage_vcs_settings = true @@ -58,7 +58,7 @@ The `organization_access` block supports: * `manage_teams` - (Optional) Allow members to create, update, and delete teams. * `manage_organization_access` - (Optional) Allow members to update the organization access settings of teams. * `access_secret_teams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. -* `manage_secret_teams` - (Optional) Allows members to create, edit, and delete agent pools within their organization. +* `manage_agent_pools` - (Optional) Allows members to create, edit, and delete agent pools within their organization. ## Attributes Reference From 8575740b271f04d2bff676e236c2c17bd5564b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emma=20Lanct=C3=B4t?= Date: Mon, 17 Jun 2024 12:43:12 -0700 Subject: [PATCH 413/420] Update website/docs/r/team.html.markdown Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> --- website/docs/r/team.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/team.html.markdown b/website/docs/r/team.html.markdown index 9fff72873..fb67f1ad1 100644 --- a/website/docs/r/team.html.markdown +++ b/website/docs/r/team.html.markdown @@ -58,7 +58,7 @@ The `organization_access` block supports: * `manage_teams` - (Optional) Allow members to create, update, and delete teams. * `manage_organization_access` - (Optional) Allow members to update the organization access settings of teams. * `access_secret_teams` - (Optional) Allow members access to secret teams up to the level of permissions granted by their team permissions setting. -* `manage_agent_pools` - (Optional) Allows members to create, edit, and delete agent pools within their organization. +* `manage_agent_pools` - (Optional) Allow members to create, edit, and delete agent pools within their organization. ## Attributes Reference From 89fb64c037c6fd040cc993dd4daa1c1979b22f37 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 18 Jun 2024 16:20:31 -0700 Subject: [PATCH 414/420] handle drift when policy is replaced or removed --- .../resource_tfe_data_retention_policy.go | 23 +++++++---- ...resource_tfe_data_retention_policy_test.go | 41 +++++++++++++++++++ 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 99c74bd70..29287d1a1 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -11,12 +11,14 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/numberplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-log/tflog" + "log" "strings" ) @@ -93,6 +95,9 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc path.MatchRelative().AtParent().AtName("delete_older_than"), ), }, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.RequiresReplace(), + }, }, }, } @@ -255,16 +260,18 @@ func (r *resourceTFEDataRetentionPolicy) Read(ctx context.Context, req resource. var err error if state.WorkspaceID.IsNull() { policy, err = r.config.Client.Organizations.ReadDataRetentionPolicyChoice(ctx, state.Organization.ValueString()) - if err != nil { - resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) - return - } } else { policy, err = r.config.Client.Workspaces.ReadDataRetentionPolicyChoice(ctx, state.WorkspaceID.ValueString()) - if err != nil { - resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) - return - } + } + if err != nil { + resp.Diagnostics.AddError("Failed to read data retention policy", err.Error()) + return + } + // remove the policy from state if it no longer exists or has been replaced by another policy + if policy == nil || r.getPolicyID(policy) != state.ID.ValueString() { + log.Printf("[DEBUG] Data retention policy %s no longer exists", state.ID) + resp.State.RemoveResource(ctx) + return } result, diags := modelFromTFEDataRetentionPolicyChoice(ctx, state, policy) if diags.HasError() { diff --git a/internal/provider/resource_tfe_data_retention_policy_test.go b/internal/provider/resource_tfe_data_retention_policy_test.go index 00a62f3cb..05f4288b7 100644 --- a/internal/provider/resource_tfe_data_retention_policy_test.go +++ b/internal/provider/resource_tfe_data_retention_policy_test.go @@ -116,6 +116,47 @@ func TestAccTFEDataRetentionPolicy_explicit_organization(t *testing.T) { }) } +func TestAccTFEDataRetentionPolicy_update_type(t *testing.T) { + skipIfCloud(t) + + policy := &tfe.DataRetentionPolicyChoice{} + defaultOrgName, _ := setupDefaultOrganization(t) + + os.Setenv("TFE_ORGANIZATION", defaultOrgName) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEDataRetentionPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEDataRetentionPolicy_implicit_organization(42), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), + ), + }, + { + Config: testAccTFEDataRetentionPolicy_dontDelete_implicit_organization(), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "organization", defaultOrgName), + ), + }, + { + Config: testAccTFEDataRetentionPolicy_implicit_organization(42), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEDataRetentionPolicyExists("tfe_data_retention_policy.foobar", policy), + resource.TestCheckResourceAttr( + "tfe_data_retention_policy.foobar", "delete_older_than.days", "42"), + ), + }, + }, + }) +} + func TestAccTFEDataRetentionPolicy_implicit_organization(t *testing.T) { skipIfCloud(t) From 6c14bf8184340e00b1ba795879e634638e72783f Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 18 Jun 2024 17:02:07 -0700 Subject: [PATCH 415/420] fix import --- internal/provider/resource_tfe_data_retention_policy.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index 29287d1a1..f193b179c 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -68,6 +68,11 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), }, + //Validators: []validator.String{ + // stringvalidator.ExactlyOneOf( + // path.MatchRelative().AtParent().AtName("organization"), + // ), + //}, }, }, Blocks: map[string]schema.Block{ @@ -346,6 +351,7 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re } req.ID = r.getPolicyID(policy) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), r.getPolicyID(policy))...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), workspaceID)...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) return @@ -358,7 +364,7 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re )) return } - req.ID = r.getPolicyID(policy) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), r.getPolicyID(policy))...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) } From 4998032d4cd93d7c33b97fa22e7019c6ce9cfed3 Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 18 Jun 2024 18:15:27 -0700 Subject: [PATCH 416/420] workspace_id cannot be set if organization is set --- internal/provider/data_retention_policy.go | 14 +++++++-- .../resource_tfe_data_retention_policy.go | 29 ++++--------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/internal/provider/data_retention_policy.go b/internal/provider/data_retention_policy.go index 919c26feb..6faff7bfb 100644 --- a/internal/provider/data_retention_policy.go +++ b/internal/provider/data_retention_policy.go @@ -42,9 +42,14 @@ func modelFromTFEDataRetentionPolicyDeleteOlder(ctx context.Context, model model } deleteOlderThanObject, diags := types.ObjectValueFrom(ctx, deleteOlderThan.AttributeTypes(), deleteOlderThan) + organization := types.StringNull() + if model.WorkspaceID.IsNull() { + organization = model.Organization + } + return modelTFEDataRetentionPolicy{ ID: types.StringValue(deleteOlder.ID), - Organization: model.Organization, + Organization: organization, WorkspaceID: model.WorkspaceID, DeleteOlderThan: deleteOlderThanObject, DontDelete: types.ObjectNull(map[string]attr.Type{}), @@ -52,9 +57,14 @@ func modelFromTFEDataRetentionPolicyDeleteOlder(ctx context.Context, model model } func modelFromTFEDataRetentionPolicyDontDelete(model modelTFEDataRetentionPolicy, dontDelete *tfe.DataRetentionPolicyDontDelete) modelTFEDataRetentionPolicy { + organization := types.StringNull() + if model.WorkspaceID.IsNull() { + organization = model.Organization + } + return modelTFEDataRetentionPolicy{ ID: types.StringValue(dontDelete.ID), - Organization: model.Organization, + Organization: organization, WorkspaceID: model.WorkspaceID, DeleteOlderThan: types.ObjectNull(modelTFEDeleteOlderThan{}.AttributeTypes()), DontDelete: DontDeleteEmptyObject(), diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index f193b179c..a979cc99e 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "log" "strings" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" ) // Ensure provider defined types fully satisfy framework interfaces. @@ -68,11 +69,11 @@ func (r *resourceTFEDataRetentionPolicy) Schema(ctx context.Context, req resourc PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), }, - //Validators: []validator.String{ - // stringvalidator.ExactlyOneOf( - // path.MatchRelative().AtParent().AtName("organization"), - // ), - //}, + Validators: []validator.String{ + stringvalidator.ConflictsWith( + path.MatchRelative().AtParent().AtName("organization"), + ), + }, }, }, Blocks: map[string]schema.Block{ @@ -198,9 +199,6 @@ func (r *resourceTFEDataRetentionPolicy) createDeleteOlderThanRetentionPolicy(ct return } - // set organization if it is still not known after creating the data retention policy - r.ensureOrganizationSetAfterApply(&result, &resp.Diagnostics) - // Save data into Terraform state diags = resp.State.Set(ctx, &result) resp.Diagnostics.Append(diags...) @@ -232,25 +230,11 @@ func (r *resourceTFEDataRetentionPolicy) createDontDeleteRetentionPolicy(ctx con result := modelFromTFEDataRetentionPolicyDontDelete(plan, dataRetentionPolicy) - // set organization if it is still not known after creating the data retention policy - r.ensureOrganizationSetAfterApply(&result, &resp.Diagnostics) - // Save data into Terraform state diags = resp.State.Set(ctx, &result) resp.Diagnostics.Append(diags...) } -func (r *resourceTFEDataRetentionPolicy) ensureOrganizationSetAfterApply(policy *modelTFEDataRetentionPolicy, diags *diag.Diagnostics) { - if policy.Organization.IsUnknown() { - workspace, err := r.config.Client.Workspaces.ReadByID(ctx, policy.WorkspaceID.ValueString()) - if err != nil { - diags.AddError("Unable to create data retention policy", err.Error()) - return - } - policy.Organization = types.StringValue(workspace.Organization.Name) - } -} - func (r *resourceTFEDataRetentionPolicy) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { var state modelTFEDataRetentionPolicy @@ -353,7 +337,6 @@ func (r *resourceTFEDataRetentionPolicy) ImportState(ctx context.Context, req re req.ID = r.getPolicyID(policy) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), r.getPolicyID(policy))...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("workspace_id"), workspaceID)...) - resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("organization"), s[0])...) return } From 902d7033b47fb7a196d7f992b0a7da4bebb522eb Mon Sep 17 00:00:00 2001 From: SwiftEngineer Date: Tue, 18 Jun 2024 18:16:56 -0700 Subject: [PATCH 417/420] fmt --- internal/provider/resource_tfe_data_retention_policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_tfe_data_retention_policy.go b/internal/provider/resource_tfe_data_retention_policy.go index a979cc99e..3bdd95507 100644 --- a/internal/provider/resource_tfe_data_retention_policy.go +++ b/internal/provider/resource_tfe_data_retention_policy.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-framework-validators/numbervalidator" "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -20,7 +21,6 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "log" "strings" - "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" ) // Ensure provider defined types fully satisfy framework interfaces. From 863e9f2e0d6966e83c08eaf91cba8718de8a4a14 Mon Sep 17 00:00:00 2001 From: Taylor Chaparro <33099255+notchairmk@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:12:57 -0700 Subject: [PATCH 418/420] feat(workspace): add auto destroy activity duration (#1377) --- CHANGELOG.md | 2 + internal/provider/data_source_workspace.go | 14 ++ .../provider/data_source_workspace_test.go | 40 ++++++ internal/provider/resource_tfe_workspace.go | 129 +++++++++++++----- .../provider/resource_tfe_workspace_test.go | 98 ++++++++++++- website/docs/d/workspace.html.markdown | 1 + website/docs/r/workspace.html.markdown | 3 +- 7 files changed, 252 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31bf3bdaa..86ba72fe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ FEATURES: * `r/tfe_team`: Add attribute `manage_agent_pools` to `organization_access` on `tfe_team` by @emlanctot [#1358](https://github.com/hashicorp/terraform-provider-tfe/pull/1358) +* `r/tfe_workspace`: Add an `auto_destroy_activity_duration` attribute for automatic scheduling of auto-destroy runs based off of workspace activity, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377) +* `d/tfe_workspace`: Add an `auto_destroy_activity_duration`, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377) ## v0.56.0 diff --git a/internal/provider/data_source_workspace.go b/internal/provider/data_source_workspace.go index 40f3c330e..72c334a63 100644 --- a/internal/provider/data_source_workspace.go +++ b/internal/provider/data_source_workspace.go @@ -57,6 +57,11 @@ func dataSourceTFEWorkspace() *schema.Resource { Computed: true, }, + "auto_destroy_activity_duration": { + Type: schema.TypeString, + Computed: true, + }, + "file_triggers_enabled": { Type: schema.TypeBool, Computed: true, @@ -251,6 +256,15 @@ func dataSourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error } d.Set("auto_destroy_at", autoDestroyAt) + var autoDestroyDuration string + if workspace.AutoDestroyActivityDuration.IsSpecified() { + autoDestroyDuration, err = workspace.AutoDestroyActivityDuration.Get() + if err != nil { + return fmt.Errorf("Error reading auto destroy activity duration: %w", err) + } + } + d.Set("auto_destroy_activity_duration", autoDestroyDuration) + // If target tfe instance predates projects, then workspace.Project will be nil if workspace.Project != nil { d.Set("project_id", workspace.Project.ID) diff --git a/internal/provider/data_source_workspace_test.go b/internal/provider/data_source_workspace_test.go index 57d096653..7b2683e8c 100644 --- a/internal/provider/data_source_workspace_test.go +++ b/internal/provider/data_source_workspace_test.go @@ -190,6 +190,25 @@ func TestAccTFEWorkspaceDataSource_readAutoDestroyAt(t *testing.T) { }) } +func TestAccTFEWorkspaceDataSource_readAutoDestroyDuration(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspaceDataSourceConfig_basic(rInt), + Check: resource.TestCheckResourceAttr("data.tfe_workspace.foobar", "auto_destroy_activity_duration", ""), + }, + { + Config: testAccTFEWorkspaceDataSourceConfig_basicWithAutoDestroyDuration(rInt), + Check: resource.TestCheckResourceAttr("data.tfe_workspace.foobar", "auto_destroy_activity_duration", "1d"), + }, + }, + }) +} + func TestAccTFEWorkspaceDataSource_readProjectIDDefault(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -300,6 +319,27 @@ data "tfe_workspace" "foobar" { organization = tfe_workspace.foobar.organization }`, rInt, rInt) } + +func testAccTFEWorkspaceDataSourceConfig_basicWithAutoDestroyDuration(rInt int) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test-%d" + organization = tfe_organization.foobar.id + description = "provider-testing" + auto_destroy_activity_duration = "1d" +} + +data "tfe_workspace" "foobar" { + name = tfe_workspace.foobar.name + organization = tfe_workspace.foobar.organization +}`, rInt, rInt) +} + func testAccTFEWorkspaceDataSourceConfigWithTriggerPatterns(workspaceName string, organizationName string) string { return fmt.Sprintf(` data "tfe_workspace" "foobar" { diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index c9d1100d6..0a2f3ccc2 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -63,6 +63,10 @@ func resourceTFEWorkspace() *schema.Resource { return err } + if err := customizeDiffAutoDestroyAt(c, d); err != nil { + return err + } + return nil }, @@ -112,9 +116,17 @@ func resourceTFEWorkspace() *schema.Resource { "auto_destroy_at": { Type: schema.TypeString, + Computed: true, Optional: true, }, + "auto_destroy_activity_duration": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"auto_destroy_at"}, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\d{1,4}[dh]$`), "must be 1-4 digits followed by d or h"), + }, + "execution_mode": { Type: schema.TypeString, Optional: true, @@ -354,6 +366,10 @@ func resourceTFEWorkspaceCreate(d *schema.ResourceData, meta interface{}) error options.AutoDestroyAt = autoDestroyAt } + if v, ok := d.GetOk("auto_destroy_activity_duration"); ok { + options.AutoDestroyActivityDuration = jsonapi.NewNullableAttrWithValue(v.(string)) + } + if v, ok := d.GetOk("execution_mode"); ok { executionMode := tfe.String(v.(string)) options.SettingOverwrites = &tfe.WorkspaceSettingOverwritesOptions{ @@ -553,6 +569,15 @@ func resourceTFEWorkspaceRead(d *schema.ResourceData, meta interface{}) error { } d.Set("auto_destroy_at", autoDestroyAt) + if workspace.AutoDestroyActivityDuration.IsSpecified() { + v, err := workspace.AutoDestroyActivityDuration.Get() + if err != nil { + return fmt.Errorf("Error reading auto destroy activity duration: %w", err) + } + + d.Set("auto_destroy_activity_duration", v) + } + var tagNames []interface{} managedTags := d.Get("tag_names").(*schema.Set) for _, tagName := range workspace.TagNames { @@ -605,7 +630,8 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error d.HasChange("operations") || d.HasChange("execution_mode") || d.HasChange("description") || d.HasChange("agent_pool_id") || d.HasChange("global_remote_state") || d.HasChange("structured_run_output_enabled") || - d.HasChange("assessments_enabled") || d.HasChange("project_id") || d.HasChange("auto_destroy_at") { + d.HasChange("assessments_enabled") || d.HasChange("project_id") || + hasAutoDestroyAtChange(d) || d.HasChange("auto_destroy_activity_duration") { // Create a new options struct. options := tfe.WorkspaceUpdateOptions{ Name: tfe.String(d.Get("name").(string)), @@ -658,7 +684,7 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("auto_destroy_at") { + if hasAutoDestroyAtChange(d) { autoDestroyAt, err := expandAutoDestroyAt(d) if err != nil { return fmt.Errorf("Error expanding auto destroy during update: %w", err) @@ -666,6 +692,15 @@ func resourceTFEWorkspaceUpdate(d *schema.ResourceData, meta interface{}) error options.AutoDestroyAt = autoDestroyAt } + if d.HasChange("auto_destroy_activity_duration") { + duration, ok := d.GetOk("auto_destroy_activity_duration") + if !ok { + options.AutoDestroyActivityDuration = jsonapi.NewNullNullableAttr[string]() + } else { + options.AutoDestroyActivityDuration = jsonapi.NewNullableAttrWithValue(duration.(string)) + } + } + if d.HasChange("execution_mode") { if v, ok := d.GetOk("execution_mode"); ok { options.ExecutionMode = tfe.String(v.(string)) @@ -961,35 +996,6 @@ func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { return nil } -func expandAutoDestroyAt(d *schema.ResourceData) (jsonapi.NullableAttr[time.Time], error) { - v, ok := d.GetOk("auto_destroy_at") - - if !ok { - return jsonapi.NewNullNullableAttr[time.Time](), nil - } - - autoDestroyAt, err := time.Parse(time.RFC3339, v.(string)) - if err != nil { - return nil, err - } - - return jsonapi.NewNullableAttrWithValue(autoDestroyAt), nil -} - -func flattenAutoDestroyAt(a jsonapi.NullableAttr[time.Time]) (*string, error) { - if !a.IsSpecified() { - return nil, nil - } - - autoDestroyTime, err := a.Get() - if err != nil { - return nil, err - } - - autoDestroyAt := autoDestroyTime.Format(time.RFC3339) - return &autoDestroyAt, nil -} - func validTagName(tag string) bool { // Tags are re-validated here because the API will accept uppercase letters and automatically // downcase them, causing resource drift. It's better to catch this issue during the plan phase @@ -1076,3 +1082,64 @@ func errWorkspaceResourceCountCheck(workspaceID string, resourceCount int) error } return nil } + +func customizeDiffAutoDestroyAt(_ context.Context, d *schema.ResourceDiff) error { + config := d.GetRawConfig() + + // check if auto_destroy_activity_duration is set in config + if !config.GetAttr("auto_destroy_activity_duration").IsNull() { + return nil + } + + // if config auto_destroy_at is unset but it exists in state, clear it out + // required because auto_destroy_at is computed and we want to set it to null + if _, ok := d.GetOk("auto_destroy_at"); ok && config.GetAttr("auto_destroy_at").IsNull() { + return d.SetNew("auto_destroy_at", nil) + } + + return nil +} + +func expandAutoDestroyAt(d *schema.ResourceData) (jsonapi.NullableAttr[time.Time], error) { + v := d.GetRawConfig().GetAttr("auto_destroy_at") + + if v.IsNull() { + return jsonapi.NewNullNullableAttr[time.Time](), nil + } + + autoDestroyAt, err := time.Parse(time.RFC3339, v.AsString()) + if err != nil { + return nil, err + } + + return jsonapi.NewNullableAttrWithValue(autoDestroyAt), nil +} + +func flattenAutoDestroyAt(a jsonapi.NullableAttr[time.Time]) (*string, error) { + if !a.IsSpecified() { + return nil, nil + } + + autoDestroyTime, err := a.Get() + if err != nil { + return nil, err + } + + autoDestroyAt := autoDestroyTime.Format(time.RFC3339) + return &autoDestroyAt, nil +} + +func hasAutoDestroyAtChange(d *schema.ResourceData) bool { + state := d.GetRawState() + if state.IsNull() { + return d.HasChange("auto_destroy_at") + } + + config := d.GetRawConfig() + autoDestroyAt := config.GetAttr("auto_destroy_at") + if !autoDestroyAt.IsNull() { + return d.HasChange("auto_destroy_at") + } + + return config.GetAttr("auto_destroy_at") != state.GetAttr("auto_destroy_at") +} diff --git a/internal/provider/resource_tfe_workspace_test.go b/internal/provider/resource_tfe_workspace_test.go index 3f24cf199..e308ac9b8 100644 --- a/internal/provider/resource_tfe_workspace_test.go +++ b/internal/provider/resource_tfe_workspace_test.go @@ -2694,6 +2694,82 @@ func TestAccTFEWorkspace_updateWithAutoDestroyAt(t *testing.T) { }) } +func TestAccTFEWorkspace_createWithAutoDestroyDuration(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_basicWithAutoDestroyDuration(rInt, "1d"), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists("tfe_workspace.foobar", &tfe.Workspace{}, testAccProvider), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_activity_duration", "1d"), + ), + }, + }, + }) +} + +func TestAccTFEWorkspace_updateWithAutoDestroyDuration(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEWorkspace_basicWithAutoDestroyDuration(rInt, "1d"), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEWorkspaceExists("tfe_workspace.foobar", &tfe.Workspace{}, testAccProvider), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_activity_duration", "1d"), + ), + }, + { + Config: testAccTFEWorkspace_basicWithAutoDestroyAt(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_activity_duration", ""), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", "2100-01-01T00:00:00Z"), + ), + }, + { + Config: testAccTFEWorkspace_basicWithAutoDestroyDuration(rInt, "1d"), + Check: resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_activity_duration", "1d"), + }, + { + Config: testAccTFEWorkspace_basic(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_at", ""), + resource.TestCheckResourceAttr("tfe_workspace.foobar", "auto_destroy_activity_duration", ""), + ), + }, + }, + }) +} + +func TestAccTFEWorkspace_validationAutoDestroyDuration(t *testing.T) { + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + values := []string{"d", "1w", "1d1", "123456h"} + steps := []resource.TestStep{} + for _, value := range values { + steps = append(steps, resource.TestStep{ + Config: testAccTFEWorkspace_basicWithAutoDestroyDuration(rInt, value), + ExpectError: regexp.MustCompile("must be 1-4 digits followed by d or h"), + }) + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTFEWorkspaceDestroy, + Steps: steps, + }) +} + func TestAccTFEWorkspace_createWithSourceURL(t *testing.T) { rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() @@ -2978,14 +3054,30 @@ resource "tfe_organization" "foobar" { } resource "tfe_workspace" "foobar" { - name = "workspace-test" - organization = tfe_organization.foobar.id - auto_apply = true + name = "workspace-test" + organization = tfe_organization.foobar.id + auto_apply = true file_triggers_enabled = false auto_destroy_at = "2100-01-01T00:00:00Z" }`, rInt) } +func testAccTFEWorkspace_basicWithAutoDestroyDuration(rInt int, value string) string { + return fmt.Sprintf(` +resource "tfe_organization" "foobar" { + name = "tst-terraform-%d" + email = "admin@company.com" +} + +resource "tfe_workspace" "foobar" { + name = "workspace-test" + organization = tfe_organization.foobar.id + auto_apply = true + file_triggers_enabled = false + auto_destroy_activity_duration = "%s" +}`, rInt, value) +} + func testAccTFEWorkspace_operationsTrue(organization string) string { return fmt.Sprintf(` resource "tfe_workspace" "foobar" { diff --git a/website/docs/d/workspace.html.markdown b/website/docs/d/workspace.html.markdown index f44e8aa67..cc122baa5 100644 --- a/website/docs/d/workspace.html.markdown +++ b/website/docs/d/workspace.html.markdown @@ -35,6 +35,7 @@ In addition to all arguments above, the following attributes are exported: * `allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace. * `auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful. * `auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace. +* `auto_destroy_activity_duration` - A duration string representing time after workspace activity when an auto-destroy run will be triggered. * `auto_destroy_at` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted. * `assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace. * `file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`). diff --git a/website/docs/r/workspace.html.markdown b/website/docs/r/workspace.html.markdown index 9688c0d06..e26ecb8ab 100644 --- a/website/docs/r/workspace.html.markdown +++ b/website/docs/r/workspace.html.markdown @@ -68,7 +68,8 @@ The following arguments are supported: * `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`. * `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`. * `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`. -* `auto_destroy_at` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). +* `auto_destroy_activity_duration` - (Optional) A duration string of the period of time after workspace activity to automatically schedule an auto-destroy run. Must be of the form `` where allowed unit values are "d" and "h". Conflicts with `auto_destroy_at`. +* `auto_destroy_at` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z"). Conflicts with `auto_destroy_activity_duration`. ~> **NOTE:** `auto_destroy_at` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignore_changes` for this attribute may be preferred. From 190e54e3310205e481df2c92ed0255b56f2794f8 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 12 Apr 2024 16:02:29 +0800 Subject: [PATCH 419/420] Add new global run task features This commit; * Updates the workspace run task resource and datasource to deprecate the `stage` attribute in favour of the new `stages` attribute. This also includes a state version update * Adds a new organization_run_task_global_settings resource and datasource for managing the global settings of a Run task. This does require the HCP Terraform/TFE instance to support global run tasks. The provider does attempt to error gracefully if a user is trying to use this feature if it's unsupported. --- ...e_organization_run_task_global_settings.go | 114 +++++++ .../data_source_workspace_run_task.go | 16 +- .../data_source_workspace_run_task_test.go | 1 + internal/provider/helper_test.go | 11 + internal/provider/provider_next.go | 4 +- ...e_organization_run_task_global_settings.go | 298 ++++++++++++++++++ ...anization_run_task_global_settings_test.go | 240 ++++++++++++++ .../resource_tfe_workspace_run_task.go | 118 +++---- ...resource_tfe_workspace_run_task_schemas.go | 161 ++++++++++ 9 files changed, 883 insertions(+), 80 deletions(-) create mode 100644 internal/provider/data_source_organization_run_task_global_settings.go create mode 100644 internal/provider/resource_tfe_organization_run_task_global_settings.go create mode 100644 internal/provider/resource_tfe_organization_run_task_global_settings_test.go create mode 100644 internal/provider/resource_tfe_workspace_run_task_schemas.go diff --git a/internal/provider/data_source_organization_run_task_global_settings.go b/internal/provider/data_source_organization_run_task_global_settings.go new file mode 100644 index 000000000..182194d68 --- /dev/null +++ b/internal/provider/data_source_organization_run_task_global_settings.go @@ -0,0 +1,114 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var ( + _ datasource.DataSource = &dataSourceOrganizationRunTask{} + _ datasource.DataSourceWithConfigure = &dataSourceOrganizationRunTask{} +) + +func NewOrganizationRunTaskGlobalSettingsDataSource() datasource.DataSource { + return &dataSourceOrganizationRunTaskGlobalSettings{} +} + +type dataSourceOrganizationRunTaskGlobalSettings struct { + config ConfiguredClient +} + +func (d *dataSourceOrganizationRunTaskGlobalSettings) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_organization_run_task_global_settings" +} + +func (d *dataSourceOrganizationRunTaskGlobalSettings) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "enabled": schema.BoolAttribute{ + Description: "Whether the run task will be applied globally", + Optional: true, + }, + "enforcement_level": schema.StringAttribute{ + Description: "The enforcement level of the global task.", + Optional: true, + }, + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the task settings", + }, + "stages": schema.ListAttribute{ + ElementType: types.StringType, + Description: "Which stages the task will run in.", + Optional: true, + }, + "task_id": schema.StringAttribute{ + Description: "The id of the run task.", + Required: true, + }, + }, + } +} + +func (d *dataSourceOrganizationRunTaskGlobalSettings) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + d.config = client +} + +func (d *dataSourceOrganizationRunTaskGlobalSettings) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data modelDataTFEOrganizationRunTaskGlobalSettings + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } + + taskID := data.TaskID.ValueString() + + task, err := d.config.Client.RunTasks.Read(ctx, taskID) + if err != nil { + resp.Diagnostics.AddError("Error retrieving task", + fmt.Sprintf("Error retrieving task %s: %s", taskID, err.Error()), + ) + return + } + + if task == nil { + resp.Diagnostics.AddError("Error retrieving task", + fmt.Sprintf("Error retrieving task %s", taskID), + ) + return + } + + if task.Global == nil { + resp.Diagnostics.AddWarning("Error retrieving task", + fmt.Sprintf("The task %s exists however it does not support global run tasks.", taskID), + ) + return + } + + result := dataModelFromTFEOrganizationRunTaskGlobalSettings(*task) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, result)...) +} diff --git a/internal/provider/data_source_workspace_run_task.go b/internal/provider/data_source_workspace_run_task.go index b6f78e4ba..8fa35b275 100644 --- a/internal/provider/data_source_workspace_run_task.go +++ b/internal/provider/data_source_workspace_run_task.go @@ -10,25 +10,22 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" ) -// Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &dataSourceWorkspaceRunTask{} _ datasource.DataSourceWithConfigure = &dataSourceWorkspaceRunTask{} ) -// NewWorkspaceRunTaskDataSource is a helper function to simplify the provider implementation. func NewWorkspaceRunTaskDataSource() datasource.DataSource { return &dataSourceWorkspaceRunTask{} } -// dataSourceWorkspaceRunTask is the data source implementation. type dataSourceWorkspaceRunTask struct { config ConfiguredClient } -// Metadata returns the data source type name. func (d *dataSourceWorkspaceRunTask) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_workspace_run_task" } @@ -53,7 +50,13 @@ func (d *dataSourceWorkspaceRunTask) Schema(_ context.Context, _ datasource.Sche Computed: true, }, "stage": schema.StringAttribute{ - Description: "Which stage the task will run in.", + DeprecationMessage: "stage is deprecated, please use stages instead", + Description: "Which stage the task will run in.", + Computed: true, + }, + "stages": schema.ListAttribute{ + ElementType: types.StringType, + Description: "Which stages the task will run in.", Computed: true, }, }, @@ -78,9 +81,8 @@ func (d *dataSourceWorkspaceRunTask) Configure(_ context.Context, req datasource d.config = client } -// Read refreshes the Terraform state with the latest data. func (d *dataSourceWorkspaceRunTask) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data modelTFEWorkspaceRunTaskV0 + var data modelTFEWorkspaceRunTaskV1 // Read Terraform configuration data into the model resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) diff --git a/internal/provider/data_source_workspace_run_task_test.go b/internal/provider/data_source_workspace_run_task_test.go index f454e930c..7eaac6571 100644 --- a/internal/provider/data_source_workspace_run_task_test.go +++ b/internal/provider/data_source_workspace_run_task_test.go @@ -37,6 +37,7 @@ func TestAccTFEWorkspaceRunTaskDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.tfe_workspace_run_task.foobar", "id"), resource.TestCheckResourceAttrSet("data.tfe_workspace_run_task.foobar", "task_id"), resource.TestCheckResourceAttrSet("data.tfe_workspace_run_task.foobar", "workspace_id"), + resource.TestCheckResourceAttr("data.tfe_workspace_run_task.foobar", "stages.#", "1"), ), }, }, diff --git a/internal/provider/helper_test.go b/internal/provider/helper_test.go index 407d6d56b..4eccb7a7a 100644 --- a/internal/provider/helper_test.go +++ b/internal/provider/helper_test.go @@ -66,6 +66,17 @@ func createBusinessOrganization(t *testing.T, client *tfe.Client) (*tfe.Organiza return org, orgCleanup } +func createTrialOrganization(t *testing.T, client *tfe.Client) (*tfe.Organization, func()) { + org, orgCleanup := createOrganization(t, client, tfe.OrganizationCreateOptions{ + Name: tfe.String("tst-" + randomString(t)), + Email: tfe.String(fmt.Sprintf("%s@tfe.local", randomString(t))), + }) + + newSubscriptionUpdater(org).WithTrialPlan().Update(t) + + return org, orgCleanup +} + func createOrganization(t *testing.T, client *tfe.Client, options tfe.OrganizationCreateOptions) (*tfe.Organization, func()) { ctx := context.Background() org, err := client.Organizations.Create(ctx, options) diff --git a/internal/provider/provider_next.go b/internal/provider/provider_next.go index feed894e9..cc635b1a6 100644 --- a/internal/provider/provider_next.go +++ b/internal/provider/provider_next.go @@ -123,12 +123,13 @@ func (p *frameworkProvider) Configure(ctx context.Context, req provider.Configur func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ + NewNoCodeModuleDataSource, NewOrganizationRunTaskDataSource, + NewOrganizationRunTaskGlobalSettingsDataSource, NewRegistryGPGKeyDataSource, NewRegistryGPGKeysDataSource, NewRegistryProviderDataSource, NewRegistryProvidersDataSource, - NewNoCodeModuleDataSource, NewSAMLSettingsDataSource, NewWorkspaceRunTaskDataSource, } @@ -136,6 +137,7 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ + NewOrganizationRunTaskGlobalSettingsResource, NewOrganizationRunTaskResource, NewRegistryGPGKeyResource, NewRegistryProviderResource, diff --git a/internal/provider/resource_tfe_organization_run_task_global_settings.go b/internal/provider/resource_tfe_organization_run_task_global_settings.go new file mode 100644 index 000000000..2254e04ca --- /dev/null +++ b/internal/provider/resource_tfe_organization_run_task_global_settings.go @@ -0,0 +1,298 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "fmt" + "strings" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +var _ resource.Resource = &resourceOrganizationRunTaskGlobalSettings{} +var _ resource.ResourceWithConfigure = &resourceOrganizationRunTaskGlobalSettings{} +var _ resource.ResourceWithImportState = &resourceOrganizationRunTaskGlobalSettings{} + +type modelDataTFEOrganizationRunTaskGlobalSettings struct { + Enabled types.Bool `tfsdk:"enabled"` + EnforcementLevel types.String `tfsdk:"enforcement_level"` + ID types.String `tfsdk:"id"` + Stages types.List `tfsdk:"stages"` + TaskID types.String `tfsdk:"task_id"` +} + +func dataModelFromTFEOrganizationRunTaskGlobalSettings(v tfe.RunTask) modelDataTFEOrganizationRunTaskGlobalSettings { + result := modelDataTFEOrganizationRunTaskGlobalSettings{ + Enabled: types.BoolNull(), + ID: types.StringValue(v.ID), + TaskID: types.StringValue(v.ID), + EnforcementLevel: types.StringNull(), + Stages: types.ListNull(types.StringType), + } + + if v.Global == nil { + return result + } + + result.Enabled = types.BoolValue(v.Global.Enabled) + result.EnforcementLevel = types.StringValue(string(v.Global.EnforcementLevel)) + if stages, err := types.ListValueFrom(ctx, types.StringType, v.Global.Stages); err == nil { + result.Stages = stages + } + + return result +} + +func NewOrganizationRunTaskGlobalSettingsResource() resource.Resource { + return &resourceOrganizationRunTaskGlobalSettings{} +} + +type resourceOrganizationRunTaskGlobalSettings struct { + config ConfiguredClient +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_organization_run_task_global_settings" +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the task", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "enabled": schema.BoolAttribute{ + Description: "Whether the run task will be applied globally", + Optional: true, + Computed: true, + Default: booldefault.StaticBool(true), + }, + "enforcement_level": schema.StringAttribute{ + Description: fmt.Sprintf("The enforcement level of the global task. Valid values are %s.", sentenceList( + workspaceRunTaskEnforcementLevels(), + "`", + "`", + "and", + )), + Required: true, + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskEnforcementLevels()...), + }, + }, + "stages": schema.ListAttribute{ + ElementType: types.StringType, + Description: fmt.Sprintf("Which stages the task will run in. Valid values are %s.", sentenceList( + workspaceRunTaskStages(), + "`", + "`", + "and", + )), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + listvalidator.UniqueValues(), + listvalidator.ValueStringsAre( + stringvalidator.OneOf(workspaceRunTaskStages()...), + ), + }, + Required: true, + }, + "task_id": schema.StringAttribute{ + Description: "The id of the run task.", + Required: true, + // When the task changes force a replace + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + }, + } +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(ConfiguredClient) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected tfe.ConfiguredClient, got %T. This is a bug in the tfe provider, so please report it on GitHub.", req.ProviderData), + ) + + return + } + r.config = client +} + +func (r *resourceOrganizationRunTaskGlobalSettings) getRunTask(ctx context.Context, taskID string, diags *diag.Diagnostics) *tfe.RunTask { + tflog.Error(ctx, fmt.Sprintf("Reading organization run task %s", taskID)) + task, err := r.config.Client.RunTasks.Read(ctx, taskID) + + if err != nil || task == nil { + diags.AddError("Error reading Organization Run Task", "Could not read Organization Run Task, unexpected error: "+err.Error()) + return nil + } + + if task.Global == nil { + diags.AddError("Organization does not support global run tasks", + fmt.Sprintf("The task %s exists however it does not support global run tasks.", taskID), + ) + return nil + } + + return task +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state modelDataTFEOrganizationRunTaskGlobalSettings + + // Read Terraform current state into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + taskID := state.TaskID.ValueString() + + task := r.getRunTask(ctx, taskID, &resp.Diagnostics) + if task == nil { + return + } + + result := dataModelFromTFEOrganizationRunTaskGlobalSettings(*task) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + r.updateRunTask(ctx, &req.Plan, &resp.State, &resp.Diagnostics) +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + r.updateRunTask(ctx, &req.Plan, &resp.State, &resp.Diagnostics) +} + +func (r *resourceOrganizationRunTaskGlobalSettings) updateRunTask(ctx context.Context, tfPlan *tfsdk.Plan, tfState *tfsdk.State, diagnostics *diag.Diagnostics) { + var plan modelDataTFEOrganizationRunTaskGlobalSettings + + // Read Terraform planned changes into the model + diagnostics.Append(tfPlan.Get(ctx, &plan)...) + if diagnostics.HasError() { + return + } + + taskID := plan.TaskID.ValueString() + + task := r.getRunTask(ctx, taskID, diagnostics) + if task == nil { + return + } + + var stageStrings []types.String + if err := plan.Stages.ElementsAs(ctx, &stageStrings, false); err != nil && err.HasError() { + diagnostics.Append(err...) + return + } + + stages := make([]tfe.Stage, len(stageStrings)) + for idx, s := range stageStrings { + stages[idx] = tfe.Stage(s.ValueString()) + } + + options := tfe.RunTaskUpdateOptions{ + Global: &tfe.GlobalRunTaskOptions{ + Enabled: plan.Enabled.ValueBoolPointer(), + Stages: &stages, + EnforcementLevel: (*tfe.TaskEnforcementLevel)(plan.EnforcementLevel.ValueStringPointer()), + }, + } + + tflog.Debug(ctx, fmt.Sprintf("Update task %s global settings", taskID)) + task, err := r.config.Client.RunTasks.Update(ctx, taskID, options) + if err != nil || task == nil { + diagnostics.AddError("Unable to update organization task", err.Error()) + return + } + result := dataModelFromTFEOrganizationRunTaskGlobalSettings(*task) + + diagnostics.Append(tfState.Set(ctx, &result)...) +} + +func (r *resourceOrganizationRunTaskGlobalSettings) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state modelDataTFEOrganizationRunTaskGlobalSettings + + // Read Terraform planned changes into the model + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + taskID := state.TaskID.ValueString() + + e := false + options := tfe.RunTaskUpdateOptions{ + Global: &tfe.GlobalRunTaskOptions{ + Enabled: &e, + }, + } + + tflog.Debug(ctx, fmt.Sprintf("Disabling task %s global settings", taskID)) + task, err := r.config.Client.RunTasks.Update(ctx, taskID, options) + if err != nil || task == nil { + resp.Diagnostics.AddError("Unable to update organization task", err.Error()) + return + } + // Resource is implicitly deleted from resp.State if diagnostics have no errors. +} + +func (r *resourceOrganizationRunTaskGlobalSettings) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + s := strings.SplitN(req.ID, "/", 2) + if len(s) != 2 { + resp.Diagnostics.AddError( + "Error importing organization run task global settings", + fmt.Sprintf("Invalid task input format: %s (expected /)", req.ID), + ) + return + } + + taskName := s[1] + orgName := s[0] + + if task, err := fetchOrganizationRunTask(taskName, orgName, r.config.Client); err != nil { + resp.Diagnostics.AddError( + "Error importing organization run task", + err.Error(), + ) + } else if task == nil { + resp.Diagnostics.AddError( + "Error importing organization run task", + "Task does not exist or does not support global settings", + ) + } else { + // We can never import the HMACkey (Write-only) so assume it's the default (empty) + result := dataModelFromTFEOrganizationRunTaskGlobalSettings(*task) + resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) + } +} diff --git a/internal/provider/resource_tfe_organization_run_task_global_settings_test.go b/internal/provider/resource_tfe_organization_run_task_global_settings_test.go new file mode 100644 index 000000000..aa7e7a374 --- /dev/null +++ b/internal/provider/resource_tfe_organization_run_task_global_settings_test.go @@ -0,0 +1,240 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "math/rand" + "regexp" + "testing" + "time" + + tfe "github.com/hashicorp/go-tfe" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccTFEOrganizationRunTaskGlobalSettings_validateSchemaAttributeUrl(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + Steps: []resource.TestStep{ + // enforcement_level + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_parameters("", `["pre_plan"]`), + ExpectError: regexp.MustCompile(`Attribute enforcement_level value must be one of: \[.*\]`), + }, + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_parameters("bad name", `["pre_plan"]`), + ExpectError: regexp.MustCompile(`Attribute enforcement_level value must be one of: \[.*\]`), + }, + // stages + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_parameters(string(tfe.Mandatory), `[]`), + ExpectError: regexp.MustCompile(`Attribute stages list must contain at least 1 elements.*`), + }, + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_parameters(string(tfe.Mandatory), `["pre_plan","BADWOLF","post_plan"]`), + ExpectError: regexp.MustCompile(`Attribute stages\[1\] value must be.*`), + }, + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_parameters(string(tfe.Mandatory), `["pre_plan","pre_plan","pre_plan"]`), + ExpectError: regexp.MustCompile(`Error: Duplicate List Value`), + }, + }, + }) +} + +func TestAccTFEOrganizationRunTaskGlobalSettings_create(t *testing.T) { + skipUnlessRunTasksDefined(t) + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, orgCleanup := createBusinessOrganization(t, tfeClient) + t.Cleanup(orgCleanup) + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEOrganizationRunTaskDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_basic(org.Name, rInt, runTasksURL(), runTasksHMACKey()), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationRunTaskGlobalEnabled("tfe_organization_run_task.foobar", true), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "enabled", "true"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "enforcement_level", "mandatory"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "stages.#", "1"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "stages.0", "post_plan"), + ), + }, + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_update(org.Name, rInt, runTasksURL(), runTasksHMACKey()), + Check: resource.ComposeTestCheckFunc( + testAccCheckTFEOrganizationRunTaskGlobalEnabled("tfe_organization_run_task.foobar", false), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "enabled", "false"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "enforcement_level", "advisory"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "stages.#", "2"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "stages.0", "pre_plan"), + resource.TestCheckResourceAttr("tfe_organization_run_task_global_settings.sut", "stages.1", "post_plan"), + ), + }, + }, + }) +} + +func TestAccTFEOrganizationRunTaskGlobalSettings_createUnsupported(t *testing.T) { + skipUnlessRunTasksDefined(t) + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, orgCleanup := createTrialOrganization(t, tfeClient) + t.Cleanup(orgCleanup) + + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFEOrganizationRunTaskDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_basic(org.Name, rInt, runTasksURL(), runTasksHMACKey()), + ExpectError: regexp.MustCompile(`Error: Organization does not support global run tasks`), + }, + }, + }) +} + +func TestAccTFEOrganizationRunTaskGlobalSettings_import(t *testing.T) { + skipUnlessRunTasksDefined(t) + + tfeClient, err := getClientUsingEnv() + if err != nil { + t.Fatal(err) + } + + org, orgCleanup := createBusinessOrganization(t, tfeClient) + t.Cleanup(orgCleanup) + + rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: testAccMuxedProviders, + CheckDestroy: testAccCheckTFETeamAccessDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTFEOrganizationRunTaskGlobalSettings_basic(org.Name, rInt, runTasksURL(), runTasksHMACKey()), + }, + { + ResourceName: "tfe_organization_run_task_global_settings.sut", + ImportState: true, + ImportStateId: fmt.Sprintf("%s/foobar-task-%d", org.Name, rInt), + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckTFEOrganizationRunTaskGlobalEnabled(resourceName string, expectedEnabled bool) resource.TestCheckFunc { + return func(s *terraform.State) error { + config := testAccProvider.Meta().(ConfiguredClient) + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No instance ID is set") + } + rt, err := config.Client.RunTasks.Read(ctx, rs.Primary.ID) + if err != nil { + return fmt.Errorf("error reading Run Task: %w", err) + } + + if rt == nil { + return fmt.Errorf("Organization Run Task not found") + } + + if rt.Global == nil { + return fmt.Errorf("Organization Run Task exists but does not support global run tasks") + } + + if rt.Global.Enabled != expectedEnabled { + return fmt.Errorf("Task expected a global enabled value of %t, got %t", expectedEnabled, rt.Global.Enabled) + } + + return nil + } +} + +func testAccTFEOrganizationRunTaskGlobalSettings_basic(orgName string, rInt int, runTaskURL, runTaskHMACKey string) string { + return fmt.Sprintf(` +resource "tfe_organization_run_task" "foobar" { + organization = "%s" + url = "%s" + name = "foobar-task-%d" + enabled = false + hmac_key = "%s" +} + +resource "tfe_organization_run_task_global_settings" "sut" { + task_id = tfe_organization_run_task.foobar.id + + enabled = true + enforcement_level = "mandatory" + stages = ["post_plan"] +} +`, orgName, runTaskURL, rInt, runTaskHMACKey) +} + +func testAccTFEOrganizationRunTaskGlobalSettings_parameters(enforceLevel, stages string) string { + return fmt.Sprintf(` +resource "tfe_organization_run_task" "foobar" { + organization = "foo" + url = "http://somewhere.local" + name = "task_name" + enabled = false + hmac_key = "something" +} + +resource "tfe_organization_run_task_global_settings" "sut" { + task_id = tfe_organization_run_task.foobar.id + + enabled = true + enforcement_level = "%s" + stages = %s +} +`, enforceLevel, stages) +} + +func testAccTFEOrganizationRunTaskGlobalSettings_update(orgName string, rInt int, runTaskURL, runTaskHMACKey string) string { + return fmt.Sprintf(` + resource "tfe_organization_run_task" "foobar" { + organization = "%s" + url = "%s" + name = "foobar-task-%d-new" + enabled = true + hmac_key = "%s" + description = "a description" + } + + resource "tfe_organization_run_task_global_settings" "sut" { + task_id = tfe_organization_run_task.foobar.id + + enabled = false + enforcement_level = "advisory" + stages = ["pre_plan", "post_plan"] + } +`, orgName, runTaskURL, rInt, runTaskHMACKey) +} diff --git a/internal/provider/resource_tfe_workspace_run_task.go b/internal/provider/resource_tfe_workspace_run_task.go index 416510920..ba5e7a3bb 100644 --- a/internal/provider/resource_tfe_workspace_run_task.go +++ b/internal/provider/resource_tfe_workspace_run_task.go @@ -12,12 +12,6 @@ import ( tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" - "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" ) @@ -67,22 +61,21 @@ func NewWorkspaceRunTaskResource() resource.Resource { return &resourceWorkspaceRunTask{} } -type modelTFEWorkspaceRunTaskV0 struct { - ID types.String `tfsdk:"id"` - WorkspaceID types.String `tfsdk:"workspace_id"` - TaskID types.String `tfsdk:"task_id"` - EnforcementLevel types.String `tfsdk:"enforcement_level"` - Stage types.String `tfsdk:"stage"` -} - -func modelFromTFEWorkspaceRunTask(v *tfe.WorkspaceRunTask) modelTFEWorkspaceRunTaskV0 { - return modelTFEWorkspaceRunTaskV0{ +func modelFromTFEWorkspaceRunTask(v *tfe.WorkspaceRunTask) modelTFEWorkspaceRunTaskV1 { + result := modelTFEWorkspaceRunTaskV1{ ID: types.StringValue(v.ID), WorkspaceID: types.StringValue(v.Workspace.ID), TaskID: types.StringValue(v.RunTask.ID), EnforcementLevel: types.StringValue(string(v.EnforcementLevel)), Stage: types.StringValue(string(v.Stage)), + Stages: types.ListNull(types.StringType), } + + if stages, err := types.ListValueFrom(ctx, types.StringType, v.Stages); err == nil { + result.Stages = stages + } + + return result } func (r *resourceWorkspaceRunTask) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { @@ -107,62 +100,11 @@ func (r *resourceWorkspaceRunTask) Configure(ctx context.Context, req resource.C } func (r *resourceWorkspaceRunTask) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ - Version: 0, - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Computed: true, - Description: "Service-generated identifier for the workspace task", - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - }, - "workspace_id": schema.StringAttribute{ - Description: "The id of the workspace to associate the Run task to.", - Required: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, - "task_id": schema.StringAttribute{ - Description: "The id of the Run task to associate to the Workspace.", - Required: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, - "enforcement_level": schema.StringAttribute{ - Description: fmt.Sprintf("The enforcement level of the task. Valid values are %s.", sentenceList( - workspaceRunTaskEnforcementLevels(), - "`", - "`", - "and", - )), - Required: true, - Validators: []validator.String{ - stringvalidator.OneOf(workspaceRunTaskEnforcementLevels()...), - }, - }, - "stage": schema.StringAttribute{ - Description: fmt.Sprintf("The stage to run the task in. Valid values are %s.", sentenceList( - workspaceRunTaskStages(), - "`", - "`", - "and", - )), - Optional: true, - Computed: true, - Default: stringdefault.StaticString(string(tfe.PostPlan)), - Validators: []validator.String{ - stringvalidator.OneOf(workspaceRunTaskStages()...), - }, - }, - }, - } + resp.Schema = resourceWorkspaceRunTaskSchemaV1 } func (r *resourceWorkspaceRunTask) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state modelTFEWorkspaceRunTaskV0 + var state modelTFEWorkspaceRunTaskV1 // Read Terraform current state into the model resp.Diagnostics.Append(req.State.Get(ctx, &state)...) @@ -187,7 +129,7 @@ func (r *resourceWorkspaceRunTask) Read(ctx context.Context, req resource.ReadRe } func (r *resourceWorkspaceRunTask) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan modelTFEWorkspaceRunTaskV0 + var plan modelTFEWorkspaceRunTaskV1 // Read Terraform planned changes into the model resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) @@ -239,7 +181,7 @@ func (r *resourceWorkspaceRunTask) stringPointerToStagePointer(val *string) *tfe } func (r *resourceWorkspaceRunTask) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan modelTFEWorkspaceRunTaskV0 + var plan modelTFEWorkspaceRunTaskV1 // Read Terraform planned changes into the model resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) @@ -272,7 +214,7 @@ func (r *resourceWorkspaceRunTask) Update(ctx context.Context, req resource.Upda } func (r *resourceWorkspaceRunTask) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state modelTFEWorkspaceRunTaskV0 + var state modelTFEWorkspaceRunTaskV1 diags := req.State.Get(ctx, &state) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -323,3 +265,35 @@ func (r *resourceWorkspaceRunTask) ImportState(ctx context.Context, req resource resp.Diagnostics.Append(resp.State.Set(ctx, &result)...) } } + +func (r *resourceWorkspaceRunTask) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader { + return map[int64]resource.StateUpgrader{ + 0: { + PriorSchema: &resourceWorkspaceRunTaskSchemaV0, + StateUpgrader: func(ctx context.Context, req resource.UpgradeStateRequest, resp *resource.UpgradeStateResponse) { + var oldData modelTFEWorkspaceRunTaskV0 + diags := req.State.Get(ctx, &oldData) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + oldWorkspaceID := oldData.WorkspaceID.ValueString() + oldID := oldData.ID.ValueString() + + wstask, err := r.config.Client.WorkspaceRunTasks.Read(ctx, oldWorkspaceID, oldID) + if err != nil || wstask == nil { + resp.Diagnostics.AddError( + "Error reading workspace run task", + fmt.Sprintf("Couldn't read workspace run task %s while trying to upgrade state of tfe_workspace_run_task: %s", oldID, err.Error()), + ) + return + } + + newData := modelFromTFEWorkspaceRunTask(wstask) + diags = resp.State.Set(ctx, newData) + resp.Diagnostics.Append(diags...) + }, + }, + } +} diff --git a/internal/provider/resource_tfe_workspace_run_task_schemas.go b/internal/provider/resource_tfe_workspace_run_task_schemas.go new file mode 100644 index 000000000..4647a30b7 --- /dev/null +++ b/internal/provider/resource_tfe_workspace_run_task_schemas.go @@ -0,0 +1,161 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + + tfe "github.com/hashicorp/go-tfe" + + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type modelTFEWorkspaceRunTaskV0 struct { + ID types.String `tfsdk:"id"` + WorkspaceID types.String `tfsdk:"workspace_id"` + TaskID types.String `tfsdk:"task_id"` + EnforcementLevel types.String `tfsdk:"enforcement_level"` + Stage types.String `tfsdk:"stage"` +} + +var resourceWorkspaceRunTaskSchemaV0 = schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the workspace task", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "workspace_id": schema.StringAttribute{ + Description: "The id of the workspace to associate the Run task to.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "task_id": schema.StringAttribute{ + Description: "The id of the Run task to associate to the Workspace.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "enforcement_level": schema.StringAttribute{ + Description: fmt.Sprintf("The enforcement level of the task. Valid values are %s.", sentenceList( + workspaceRunTaskEnforcementLevels(), + "`", + "`", + "and", + )), + Required: true, + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskEnforcementLevels()...), + }, + }, + "stage": schema.StringAttribute{ + Description: fmt.Sprintf("The stage to run the task in. Valid values are %s.", sentenceList( + workspaceRunTaskStages(), + "`", + "`", + "and", + )), + Optional: true, + Computed: true, + Default: stringdefault.StaticString(string(tfe.PostPlan)), + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskStages()...), + }, + }, + }, +} + +type modelTFEWorkspaceRunTaskV1 struct { + ID types.String `tfsdk:"id"` + WorkspaceID types.String `tfsdk:"workspace_id"` + TaskID types.String `tfsdk:"task_id"` + EnforcementLevel types.String `tfsdk:"enforcement_level"` + Stage types.String `tfsdk:"stage"` + Stages types.List `tfsdk:"stages"` +} + +var resourceWorkspaceRunTaskSchemaV1 = schema.Schema{ + Version: 1, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + Description: "Service-generated identifier for the workspace task", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "workspace_id": schema.StringAttribute{ + Description: "The id of the workspace to associate the Run task to.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "task_id": schema.StringAttribute{ + Description: "The id of the Run task to associate to the Workspace.", + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "enforcement_level": schema.StringAttribute{ + Description: fmt.Sprintf("The enforcement level of the task. Valid values are %s.", sentenceList( + workspaceRunTaskEnforcementLevels(), + "`", + "`", + "and", + )), + Required: true, + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskEnforcementLevels()...), + }, + }, + "stage": schema.StringAttribute{ + DeprecationMessage: "stage is deprecated, please use stages instead", + Description: fmt.Sprintf("The stage to run the task in. Valid values are %s.", sentenceList( + workspaceRunTaskStages(), + "`", + "`", + "and", + )), + Optional: true, + Computed: true, + Default: stringdefault.StaticString(string(tfe.PostPlan)), + Validators: []validator.String{ + stringvalidator.OneOf(workspaceRunTaskStages()...), + }, + }, + "stages": schema.ListAttribute{ + ElementType: types.StringType, + Description: fmt.Sprintf("The stages to run the task in. Valid values are %s.", sentenceList( + workspaceRunTaskStages(), + "`", + "`", + "and", + )), + Validators: []validator.List{ + listvalidator.SizeAtLeast(1), + listvalidator.UniqueValues(), + listvalidator.ValueStringsAre( + stringvalidator.OneOf(workspaceRunTaskStages()...), + ), + }, + Optional: true, + Computed: true, + }, + }, +} From f094806eb3b95e877814f21250b29732ab045846 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 3 May 2024 12:03:01 +0800 Subject: [PATCH 420/420] Update documentation and changelog This commit updates the documentation and changelog for the Global Run Tasks feature. --- CHANGELOG.md | 6 ++ ...ion_run_task_global_settings.html.markdown | 34 ++++++++++++ .../docs/d/workspace_run_task.html.markdown | 3 +- ...ion_run_task_global_settings.html.markdown | 55 +++++++++++++++++++ .../docs/r/workspace_run_task.html.markdown | 4 +- 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 website/docs/d/organization_run_task_global_settings.html.markdown create mode 100644 website/docs/r/organization_run_task_global_settings.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fae63f86..fe5a8ab10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ FEATURES: * `r/tfe_team`: Add attribute `manage_agent_pools` to `organization_access` on `tfe_team` by @emlanctot [#1358](https://github.com/hashicorp/terraform-provider-tfe/pull/1358) * `r/tfe_workspace`: Add an `auto_destroy_activity_duration` attribute for automatic scheduling of auto-destroy runs based off of workspace activity, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377) * `d/tfe_workspace`: Add an `auto_destroy_activity_duration`, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377) +* `d/tfe_organization_run_task_global_settings`: Add a datasource to retrieve the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330) +* `r/tfe_organization_run_task_global_settings`: Add a resource to manage the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330) + +DEPRECATIONS and BREAKING CHANGES: +* `r/_workspace_run_task`: The `stage` attribute has been deprecated in favor of the `stages` attribute, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330) +* `d/_workspace_run_task`: The `stage` attribute has been deprecated in favor of the `stages` attribute, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330) ## v0.56.0 diff --git a/website/docs/d/organization_run_task_global_settings.html.markdown b/website/docs/d/organization_run_task_global_settings.html.markdown new file mode 100644 index 000000000..3ce36a2e6 --- /dev/null +++ b/website/docs/d/organization_run_task_global_settings.html.markdown @@ -0,0 +1,34 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings" +description: |- + Get information on a Run task's global settings. +--- + +# Data Source: tfe_organization_run_task_global_settings + +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. + +The tfe_organization_run_task_global_settings resource creates, updates and destroys the [global settings](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#global-run-tasks) for an [Organization Run task](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). Your organization must have the `global-run-task` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks. + +## Example Usage + +```hcl +data "tfe_organization_run_task_global_settings" "example" { + task_id = "task-abc123" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `task_id` - (Required) The id of the Run task with the global settings. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `enabled` - Whether the run task will be applied globally. +* `enforcement_level` - The enforcement level of the global task. Valid values are `advisory` and `mandatory`. +* `stages` - The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`. diff --git a/website/docs/d/workspace_run_task.html.markdown b/website/docs/d/workspace_run_task.html.markdown index 05d0131ad..f722a7e17 100644 --- a/website/docs/d/workspace_run_task.html.markdown +++ b/website/docs/d/workspace_run_task.html.markdown @@ -33,4 +33,5 @@ In addition to all arguments above, the following attributes are exported: * `enforcement_level` - The enforcement level of the task. * `id` - The ID of the Workspace Run task. -* `stage` - Which stage the task will run in. +* `stage` - **Deprecated** Use `stages` instead. +* `stages` - Which stages the task will run in. diff --git a/website/docs/r/organization_run_task_global_settings.html.markdown b/website/docs/r/organization_run_task_global_settings.html.markdown new file mode 100644 index 000000000..295b2be6c --- /dev/null +++ b/website/docs/r/organization_run_task_global_settings.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings" +description: |- + Manages Run tasks global settings. +--- + +# tfe_organization_run_task_global_settings + +[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization. + +The tfe_organization_run_task_global_settings resource creates, updates and destroys the [global settings](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#global-run-tasks) for an [Organization Run task](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). Your organization must have the `global-run-task` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks. + +## Example Usage + +Basic usage: + +```hcl +resource "tfe_organization_run_task_global_settings" "example" { + task_id = tfe_organization_run_task.example.id + enabled = true + enforcement_level = "advisory" + stages = ["pre_plan", "post_plan"] +} + +resource "tfe_organization_run_task" "example" { + organization = "org-name" + url = "https://external.service.com" + name = "task-name" + enabled = true + description = "An example task" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `enabled` - (Optional) Whether the run task will be applied globally. +* `enforcement_level` - (Required) The enforcement level of the global task. Valid values are `advisory` and `mandatory`. +* `stages` - (Required) The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`. +* `task_id` - (Required) The id of the Run task which will have the global settings applied. + +## Attributes Reference + +* `id` - The ID of the global settings. + +## Import + +Run task global settings can be imported; use `/` as the +import ID. For example: + +```shell +terraform import tfe_organization_run_task_global_settings.test my-org-name/task-name +``` diff --git a/website/docs/r/workspace_run_task.html.markdown b/website/docs/r/workspace_run_task.html.markdown index de0b3a012..f59be587b 100644 --- a/website/docs/r/workspace_run_task.html.markdown +++ b/website/docs/r/workspace_run_task.html.markdown @@ -20,6 +20,7 @@ resource "tfe_workspace_run_task" "example" { workspace_id = resource.tfe_workspace.example.id task_id = resource.tfe_organization_run_task.example.id enforcement_level = "advisory" + stages = ["pre_plan"] } ``` @@ -30,7 +31,8 @@ The following arguments are supported: * `enforcement_level` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`. * `task_id` - (Required) The id of the Run task to associate to the Workspace. * `workspace_id` - (Required) The id of the workspace to associate the Run task to. -* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`. +* `stage` - **Deprecated** Use `stages` instead. +* `stages` - (Optional) The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`. ## Attributes Reference