diff --git a/website/docs/cdktf/python/d/agent_pool.html.markdown b/website/docs/cdktf/python/d/agent_pool.html.markdown index 7293e009c..5c61f5ddc 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_app_installation.html.markdown b/website/docs/cdktf/python/d/github_app_installation.html.markdown index 30c40a42b..5ceca2109 100644 --- a/website/docs/cdktf/python/d/github_app_installation.html.markdown +++ b/website/docs/cdktf/python/d/github_app_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 20aa4d148..20178f17d 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 HCP Terraform's IP ranges. For more i ## 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..21bff82ed 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 c5c3cd4c5..918c471dc 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" ) @@ -94,4 +103,4 @@ In addition to all arguments above, the following attributes are exported: * `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 + \ 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 984d9b969..f52920b72 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" ) ``` @@ -47,4 +50,4 @@ In addition to all arguments above, the following attributes are exported: * `speculative_plan_management_enabled` - Whether or not to enable Speculative Plan Management. If true, pending VCS-triggered speculative plans from outdated commits will be cancelled if a newer commit is pushed to the same branch. * `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..e470d63d5 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 384dbd925..45061e758 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 5954b8b39..75c03b82b 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_run_task_global_settings.html.markdown b/website/docs/cdktf/python/d/organization_run_task_global_settings.html.markdown index 05073db68..067ea4623 100644 --- a/website/docs/cdktf/python/d/organization_run_task_global_settings.html.markdown +++ b/website/docs/cdktf/python/d/organization_run_task_global_settings.html.markdown @@ -16,15 +16,18 @@ The tfe_organization_run_task_global_settings resource creates, updates and dest ## 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_global_settings import DataTfeOrganizationRunTaskGlobalSettings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_organization_run_task_global_settings.DataTfeOrganizationRunTaskGlobalSettings(self, "example", + DataTfeOrganizationRunTaskGlobalSettings(self, "example", task_id="task-abc123" ) ``` @@ -43,4 +46,4 @@ In addition to all arguments above, the following attributes are exported: * `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`. - \ 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..ce3da516a 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..6707012ee 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..9c76fa7f4 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..a31b763b5 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 fdca91151..6201d38ec 100644 --- a/website/docs/cdktf/python/d/project.html.markdown +++ b/website/docs/cdktf/python/d/project.html.markdown @@ -16,15 +16,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" ) @@ -45,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `workspace_ids` - IDs of the workspaces that are associated with the project. * `workspace_names` - Names 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/projects.html.markdown b/website/docs/cdktf/python/d/projects.html.markdown index d690f8bba..82a4bfbfe 100644 --- a/website/docs/cdktf/python/d/projects.html.markdown +++ b/website/docs/cdktf/python/d/projects.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about all projects in 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_projects import DataTfeProjects +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe.data_tfe_projects.DataTfeProjects(self, "all", + DataTfeProjects(self, "all", organization="my-org-name" ) ``` @@ -42,4 +45,4 @@ The following arguments are supported: * `organization` - Name of the organization. - \ 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..d2a0d6c78 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..a1e72fc69 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..7eba2193b 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..331a21def 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..1878f59ca 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 d202cf85d..a36cb013f 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..e38857066 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..78f952791 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..478e3d39d 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..3bcf6f53c 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..f59fe6c49 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..9409c90e3 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..270477413 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 2f64c25e0..934924fea 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" ) @@ -87,4 +90,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..49db0d664 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 2240a571f..8e405a335 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" ) @@ -46,4 +49,4 @@ In addition to all arguments above, the following attributes are exported: * `stage` - **Deprecated** Use `stages` instead. * `stages` - Which stages 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 be69bef14..d71775098 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.60.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 @@ -90,7 +89,7 @@ The above snippet using `required_providers` is for Terraform 0.13+; if you are ```hcl provider "tfe" { - version = "~> 0.60.0" + version = "~> 0.61.0" ... } ``` @@ -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 HCP Terraform `app.terraform.io` - token = var.token - version = "~> 0.60.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..b4d83db23 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..eff3d5e30 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 b1079118b..d5ef5af27 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 1212cdb4c..8fcde5bc4 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 HCP Terraform. 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/audit_trail_token.html.markdown b/website/docs/cdktf/python/r/audit_trail_token.html.markdown new file mode 100644 index 000000000..a7e06812e --- /dev/null +++ b/website/docs/cdktf/python/r/audit_trail_token.html.markdown @@ -0,0 +1,91 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_audit_trail_token" +description: |- + Generates a new audit trail token in organization, replacing any existing token. +--- + + + +# tfe_audit_trail_token + +Generates a new audit trail token in organization, replacing any existing token. + +Note that only organizations that have the [audit-logging entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#audit-logging) may create audit trail tokens. + +## 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.audit_trail_token import AuditTrailToken +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + AuditTrailToken(self, "test", + 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. +* `force_regenerate` - (Optional) If set to `true`, a new token will be + generated even if a token already exists. This will invalidate the existing + token! +* `expired_at` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339 +format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and +never expire. + +## Example Usage + +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.audit_trail_token import AuditTrailToken +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 + ) + AuditTrailToken(self, "test", + expired_at=Token.as_string(example.rotation_rfc3339), + organization=Token.as_string(org.name) + ) +``` + +## Attributes Reference + +* `id` - The ID of the token. +* `token` - The generated token. + +## Import + +Audit trail tokens can be imported; use `` as the import ID. +For example: + +```shell +terraform import tfe_audit_trail_token.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/data_retention_policy.html.markdown b/website/docs/cdktf/python/r/data_retention_policy.html.markdown index 40a166ede..41e675c41 100644 --- a/website/docs/cdktf/python/r/data_retention_policy.html.markdown +++ b/website/docs/cdktf/python/r/data_retention_policy.html.markdown @@ -16,83 +16,98 @@ Creates a data retention policy attached to either an organization or workspace. Creating a data retention policy for a 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.tfe as tfe -class MyConvertedCode(cdktf.TerraformStack): - def __init__(self, scope, name): +# +from imports.tfe.data_retention_policy import DataRetentionPolicy +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, dontDelete): 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.data_retention_policy.DataRetentionPolicy(self, "foobar", + DataRetentionPolicy(self, "foobar", delete_older_than=[{ "days": 42 } ], - workspace_id=cdktf.Token.as_string(tfe_workspace_test_workspace.id) + workspace_id=test_workspace.id, + dont_delete=dont_delete ) ``` Creating a data retention policy for an organization: ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf 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): - def __init__(self, scope, name): +# +from imports.tfe.data_retention_policy import DataRetentionPolicy +from imports.tfe.organization import Organization +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, dontDelete): 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.data_retention_policy.DataRetentionPolicy(self, "foobar", + DataRetentionPolicy(self, "foobar", delete_older_than=[{ "days": 1138 } ], - organization=cdktf.Token.as_string(tfe_organization_test_organization.name) + organization=test_organization.name, + dont_delete=dont_delete ) ``` 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 {} -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - 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_retention_policy import DataRetentionPolicy +from imports.tfe.organization import Organization +from imports.tfe.workspace import Workspace +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, dontDelete): + 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 + ) + DataRetentionPolicy(self, "foobar", + delete_older_than=[{ + "days": 1138 + } + ], + organization=test_organization.name, + dont_delete=dont_delete + ) ``` ## Argument Reference @@ -113,4 +128,4 @@ A resource can be imported; use `/` or ` \ 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 296b7c334..1dd2eb80c 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") @@ -45,34 +50,47 @@ class MyConvertedCode(cdktf.TerraformStack): Creating a no-code module with variable options: -```hcl -resource "tfe_organization" "foobar" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_registry_module" "foobar" { - organization = tfe_organization.foobar.id - module_provider = "my_provider" - name = "test_module" -} - -resource "tfe_no_code_module" "foobar" { - organization = tfe_organization.foobar.id - registry_module = tfe_registry_module.foobar.id - - variable_options { - name = "ami" - type = "string" - options = [ "ami-0", "ami-1", "ami-2" ] - } - - variable_options { - name = "region" - type = "string" - options = [ "us-east-1", "us-east-2", "us-west-1"] - } -} +```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.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) + foobar = Organization(self, "foobar", + email="admin@company.com", + name="my-org-name" + ) + tfe_registry_module_foobar = RegistryModule(self, "foobar_1", + module_provider="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. + 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), + variable_options=[NoCodeModuleVariableOptions( + name="ami", + options=["ami-0", "ami-1", "ami-2"], + type="string" + ), NoCodeModuleVariableOptions( + 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. + tfe_no_code_module_foobar.override_logical_id("foobar") ``` ## Argument Reference @@ -101,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 41eff35e4..b735e7c55 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 254b2d6d8..ad00b7a97 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", @@ -45,15 +48,18 @@ 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 -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf 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", @@ -72,15 +78,18 @@ When using Bitbucket Data Center, you must use three required fields: `key`, `se ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf 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://bbdc.example.com", http_url="https://bbdc.example.com", key="", @@ -124,4 +133,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 53c439b40..c33c465b3 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 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 e42a3d956..47a31880b 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" ) @@ -63,4 +66,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 4333e747a..aa4ab7f56 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_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 58bdae797..2aff2055a 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..ff61d148e 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 68451ccda..63f98b867 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_run_task_global_settings.html.markdown b/website/docs/cdktf/python/r/organization_run_task_global_settings.html.markdown index 5038f02ab..388e72265 100644 --- a/website/docs/cdktf/python/r/organization_run_task_global_settings.html.markdown +++ b/website/docs/cdktf/python/r/organization_run_task_global_settings.html.markdown @@ -18,16 +18,19 @@ The tfe_organization_run_task_global_settings resource creates, updates and dest 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 +from imports.tfe.organization_run_task_global_settings import OrganizationRunTaskGlobalSettings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - tfe_organization_run_task_example = - tfe.organization_run_task.OrganizationRunTask(self, "example", + example = OrganizationRunTask(self, "example", description="An example task", enabled=True, name="task-name", @@ -35,11 +38,11 @@ class MyConvertedCode(cdktf.TerraformStack): url="https://external.service.com" ) tfe_organization_run_task_global_settings_example = - tfe.organization_run_task_global_settings.OrganizationRunTaskGlobalSettings(self, "example_1", + OrganizationRunTaskGlobalSettings(self, "example_1", enabled=True, enforcement_level="advisory", stages=["pre_plan", "post_plan"], - task_id=cdktf.Token.as_string(tfe_organization_run_task_example.id) + task_id=example.id ) # This 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_run_task_global_settings_example.override_logical_id("example") @@ -67,4 +70,4 @@ import ID. For example: terraform import tfe_organization_run_task_global_settings.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..763aad5f2 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..138e9cfd5 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..522a39568 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..30195705e 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 4516f3c69..a0430d046 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 ) ``` @@ -58,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/python/r/project_oauth_client.html.markdown b/website/docs/cdktf/python/r/project_oauth_client.html.markdown index 19132c9d0..b59e73753 100644 --- a/website/docs/cdktf/python/r/project_oauth_client.html.markdown +++ b/website/docs/cdktf/python/r/project_oauth_client.html.markdown @@ -16,37 +16,42 @@ Adds and removes oauth clients 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.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.project import Project +from imports.tfe.project_oauth_client import ProjectOauthClient +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_oauth_client_test = tfe.oauth_client.OauthClient(self, "test_2", + tfe_oauth_client_test = OauthClient(self, "test_2", api_url="https://api.github.com", http_url="https://github.com", oauth_token="oauth_token_id", - organization=tfe_organization_test, + 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) + tfe_project_oauth_client_test = ProjectOauthClient(self, "test_3", + oauth_client_id=Token.as_string(tfe_oauth_client_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_oauth_client_test.override_logical_id("test") @@ -71,4 +76,4 @@ Project OAuth Clients 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_policy_set.html.markdown b/website/docs/cdktf/python/r/project_policy_set.html.markdown index f3a5cd235..0fcc29653 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..f2e69c922 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..452a337fa 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 a2cb12413..006655900 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 @@ HCP Terraform's private module registry helps you share Terraform modules across 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 ) ``` @@ -240,4 +266,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..3927b84be 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 333d594d1..134fdee2a 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..72b7d3fd2 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..c35e51fa5 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 0a29f1298..e8a8faaef 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 HCP Terraform and 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.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 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/ssh_key.html.markdown b/website/docs/cdktf/python/r/ssh_key.html.markdown index 177974c7f..ef7f1dad0 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/stack.html.markdown b/website/docs/cdktf/python/r/stack.html.markdown index 61a6953fa..6a9ff1ad0 100644 --- a/website/docs/cdktf/python/r/stack.html.markdown +++ b/website/docs/cdktf/python/r/stack.html.markdown @@ -17,30 +17,41 @@ Defines a Stack resource. Basic usage: -```hcl -resource "tfe_oauth_client" "test" { - organization = "my-example-org" - api_url = "https://api.github.com" - http_url = "https://github.com" - oauth_token = var.github_token - service_provider = "github" -} - -data "tfe_organization" "organization" { - name = "my-example-org" -} - -resource "tfe_stack" "test-stack" { - name = "my-stack" - description = "A Terraform Stack using two components with two environments" - project_id = data.tfe_organization.organization.default_project_id - - vcs_repo { - branch = "main" - identifier = "my-github-org/stack-repo" - 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.data_tfe_organization import DataTfeOrganization +from imports.tfe.oauth_client import OauthClient +from imports.tfe.stack import Stack +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = OauthClient(self, "test", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token=github_token.string_value, + organization="my-example-org", + service_provider="github" + ) + organization = DataTfeOrganization(self, "organization", + name="my-example-org" + ) + Stack(self, "test-stack", + description="A Terraform Stack using two components with two environments", + name="my-stack", + project_id=Token.as_string(organization.default_project_id), + vcs_repo=[{ + "branch": "main", + "identifier": "my-github-org/stack-repo", + "oauth_token_id": test.oauth_token_id + } + ] + ) ``` ## Argument Reference @@ -78,4 +89,4 @@ Example: terraform import tfe_stack.test-stack st-9cs9Vf6Z49Zzrk1t ``` - \ 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 3fc98639c..d2e7496a0 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" ) @@ -88,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 ab50b1a2d..6948d97cf 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..6641a682c 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..9d00252d8 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 6fa75bf24..11f57630f 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 80b4b0f7a..c580a3719 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..8b30bb57d 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..86537af6a 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 d8ae0eb59..8b4716dfb 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 HCP Terraform and 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.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 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/tfe_test_variable.html.markdown b/website/docs/cdktf/python/r/tfe_test_variable.html.markdown index 0ea52ed7c..6b0f70087 100644 --- a/website/docs/cdktf/python/r/tfe_test_variable.html.markdown +++ b/website/docs/cdktf/python/r/tfe_test_variable.html.markdown @@ -13,43 +13,55 @@ Creates, updates and destroys environment variables used for testing in the Priv ## 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 -} +```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.oauth_client import OauthClient +from imports.tfe.organization import Organization +from imports.tfe.registry_module import RegistryModule +from imports.tfe.test_variable import TestVariable +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + OauthClient(self, "test_client", + api_url="https://api.github.com", + http_url="https://github.com", + oauth_token="my-token-123", + organization=test.name, + service_provider="github" + ) + Organization(self, "test_org", + email="admin@company.com", + name="my-org-name" + ) + RegistryModule(self, "test_module", + organization="test-module", + test_config=[RegistryModuleTestConfig( + tests_enabled=True + ) + ], + vcs_repo=RegistryModuleVcsRepo( + branch="main", + display_identifier="GH_NAME/REPO_NAME", + identifier="GH_NAME/REPO_NAME", + oauth_token_id=Token.as_string(tfe_oauth_client_test.oauth_token_id), + tags=False + ) + ) + TestVariable(self, "tf_test_test_variable", + category="env", + description="some description", + key="key_test", + module_name=Token.as_string(tfe_registry_module_test.name), + module_provider=Token.as_string(tfe_registry_module_test.module_provider), + organization=test.name, + value="value_test" + ) ``` - \ 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 7789ecaa1..6297ce1cc 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..935936115 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 5a4c43b5e..3f155f39d 100644 --- a/website/docs/cdktf/python/r/workspace.html.markdown +++ b/website/docs/cdktf/python/r/workspace.html.markdown @@ -13,28 +13,30 @@ 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 HCP Terraform or an instance of Terraform Enterprise at least as recent as v202104-1. - ## Example Usage 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 +44,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 ) ) ``` @@ -95,7 +102,7 @@ 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. * `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`). +* `global_remote_state` - (Optional) **Deprecated** Whether the workspace allows all workspaces in the organization to access its state data during runs. Use [tfe_workspace_settings](workspace_settings) instead. * `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 @@ -110,7 +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. -* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. +* `remote_state_consumer_ids` - (Optional) **Deprecated** The set of workspace IDs set as explicit remote state consumers for the given workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `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 ". @@ -187,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/python/r/workspace_policy_set.html.markdown b/website/docs/cdktf/python/r/workspace_policy_set.html.markdown index 733784218..4b6d0892b 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..8ee3903a7 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 507deebd5..43da65444 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 HCP Terraform. - \ 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 721be95b6..9f88404d9 100644 --- a/website/docs/cdktf/python/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/python/r/workspace_run_task.html.markdown @@ -17,13 +17,24 @@ 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" - stages = ["pre_plan"] -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - 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", + stages=["pre_plan"], + task_id=tfe_organization_run_task.example.id, + workspace_id=tfe_workspace.example.id + ) ``` ## Argument Reference @@ -49,4 +60,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 3810d9583..7e134c484 100644 --- a/website/docs/cdktf/python/r/workspace_settings.markdown +++ b/website/docs/cdktf/python/r/workspace_settings.markdown @@ -15,86 +15,154 @@ Manages or reads execution mode and agent pool settings for a workspace. This al 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" -} +```python +# DO NOT EDIT. Code generated by 'cdktf convert' - 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 -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf 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 + ) +``` + +Using `remote_state_consumer_ids`: + +```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, Op, conditional, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +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) + # 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. + test_for_each_iterator = TerraformIterator.from_list( + Token.as_any(Fn.toset(["qa", "production"]))) + test = Workspace(self, "test", + name="${" + test_for_each_iterator.value + "}-test", + for_each=test_for_each_iterator + ) + # 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. + test_settings_for_each_iterator = TerraformIterator.from_list( + Token.as_any(Fn.toset(["qa", "production"]))) + WorkspaceSettings(self, "test-settings", + global_remote_state=False, + remote_state_consumer_ids=Token.as_list( + Fn.toset( + Fn.compact( + Token.as_list([ + conditional( + Op.eq(test_settings_for_each_iterator.value, "production"), + Fn.lookup_nested(test, ["\"qa\"", "id"]), "") + ])))), + workspace_id=Token.as_string( + Fn.lookup_nested( + Fn.lookup_nested(test, [test_settings_for_each_iterator.value]), ["id"])), + for_each=test_settings_for_each_iterator ) ``` 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\"" ]) ])) ) @@ -109,6 +177,8 @@ The following arguments are supported: 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`. 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. +* `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`). By default, HashiCorp recommends you do not allow other workspaces to access their state. We recommend that you follow the principle of least privilege and only enable state access between workspaces that specifically need information from each other. +* `remote_state_consumer_ids` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. To set this attribute, global_remote_state must be false. ## Attributes Reference @@ -132,4 +202,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 fdaee2908..86aebccb8 100644 --- a/website/docs/cdktf/python/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/python/r/workspace_variable_set.html.markdown @@ -17,27 +17,44 @@ Adds and removes variable sets from a workspace Basic usage: -```hcl -resource "tfe_organization" "test" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_variable_set" "test" { - name = "Test Varset" - description = "Some description." - organization = tfe_organization.test.name -} - -resource "tfe_workspace_variable_set" "test" { - variable_set_id = tfe_variable_set.test.id - workspace_id = 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.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) + test = Organization(self, "test", + email="admin@company.com", + name="my-org-name" + ) + tfe_variable_set_test = VariableSet(self, "test_1", + 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. + tfe_variable_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_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") ``` ## Argument Reference @@ -59,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..7ea995296 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_app_installation.html.markdown b/website/docs/cdktf/typescript/d/github_app_installation.html.markdown index 7aefb2d43..872a6ced9 100644 --- a/website/docs/cdktf/typescript/d/github_app_installation.html.markdown +++ b/website/docs/cdktf/typescript/d/github_app_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 5f2274fae..c3707c00e 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 HCP Terraform's IP ranges. For more i ## 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..6c7a7ae8e 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 448720d0e..7e9efd5f6 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`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), - `github`, `githubEnterprise`, `gitlabHosted`, `gitlabCommunityEdition`, or - `gitlabEnterpriseEdition`. + 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`. ## Attributes Reference @@ -103,4 +112,4 @@ In addition to all arguments above, the following attributes are exported: * `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 + \ 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 579c1c228..52fa4842d 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,7 +45,7 @@ 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 `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 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. @@ -50,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `speculativePlanManagementEnabled` - Whether or not to enable Speculative Plan Management. If true, pending VCS-triggered speculative plans from outdated commits will be cancelled if a newer commit is pushed to the same branch. * `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..489ddd96c 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 2041d6609..fe7f53ce4 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 1550da59f..97c56df94 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_run_task_global_settings.html.markdown b/website/docs/cdktf/typescript/d/organization_run_task_global_settings.html.markdown index 35404c7c1..a5e8cc1b4 100644 --- a/website/docs/cdktf/typescript/d/organization_run_task_global_settings.html.markdown +++ b/website/docs/cdktf/typescript/d/organization_run_task_global_settings.html.markdown @@ -11,26 +11,25 @@ description: |- [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 `globalRunTask` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks. +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 ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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 { DataTfeOrganizationRunTaskGlobalSettings } from "./.gen/providers/tfe/data-tfe-organization-run-task-global-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeOrganizationRunTaskGlobalSettings.DataTfeOrganizationRunTaskGlobalSettings( - this, - "example", - { - taskId: "task-abc123", - } - ); + new DataTfeOrganizationRunTaskGlobalSettings(this, "example", { + taskId: "task-abc123", + }); } } @@ -48,6 +47,6 @@ In addition to all arguments above, the following attributes are exported: * `enabled` - Whether the run task will be applied globally. * `enforcementLevel` - 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 `prePlan`, `postPlan`, `preApply` and `post apply`. +* `stages` - The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`. - \ 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..8f7e34280 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..0f77e644c 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 0e2b16be0..312a904bc 100644 --- a/website/docs/cdktf/typescript/d/outputs.html.markdown +++ b/website/docs/cdktf/typescript/d/outputs.html.markdown @@ -16,24 +16,36 @@ 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: - -In the example below, assume we have outputs defined in a `myOrg/myWorkspace`: - -```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 +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 `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) { + 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, + }, + }); } - - byte_length = 8 } + ``` ## Argument Reference @@ -50,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..66aeccdef 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 4ff7c9dfe..77bd1a243 100644 --- a/website/docs/cdktf/typescript/d/project.html.markdown +++ b/website/docs/cdktf/typescript/d/project.html.markdown @@ -11,20 +11,23 @@ Get information on a Project. Use this data source to get information about a project. -~> **NOTE:** The `workspaceIds` and `workspaceNames` attributes are not guaranteed to return values in the same order, so they cannot be reliably mapped to one another. To map workspace names to IDs reliably, it is recommended to pass those names into the `tfeWorkspaceIds` data source. +~> **NOTE:** The `workspaceIds` and `workspaceNames` attributes are not guaranteed to return values in the same order, so they cannot be reliably mapped to one another. To map workspace names to IDs reliably, it is recommended to pass those names into the `tfe_workspace_ids` data source. ## 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", }); @@ -48,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `workspaceIds` - IDs of the workspaces that are associated with the project. * `workspaceNames` - Names 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/projects.html.markdown b/website/docs/cdktf/typescript/d/projects.html.markdown index 14241bc46..31c1ff5d7 100644 --- a/website/docs/cdktf/typescript/d/projects.html.markdown +++ b/website/docs/cdktf/typescript/d/projects.html.markdown @@ -14,15 +14,18 @@ Use this data source to get information about all projects in 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 { DataTfeProjects } from "./.gen/providers/tfe/data-tfe-projects"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new tfe.dataTfeProjects.DataTfeProjects(this, "all", { + new DataTfeProjects(this, "all", { organization: "my-org-name", }); } @@ -45,4 +48,4 @@ The following arguments are supported: * `organization` - Name of the organization. - \ 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..2f587fdd3 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..efac1b2a1 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..7d7f5b035 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..8dcb12587 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..bcfaa9e11 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 38f3e825e..6a9a96a46 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 `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..f85c3b85c 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..0b3b27ee2 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..a8a42ce68 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..1652b3f4f 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..f67499191 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..785fb5ea0 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..0ac6e2376 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 02d8a3f85..03d9242c4 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", }); @@ -75,7 +78,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 [`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 @@ -90,4 +93,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..16d454e25 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 5be1ecfea..da602dc34 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", }); @@ -49,4 +52,4 @@ In addition to all arguments above, the following attributes are exported: * `stage` - **Deprecated** Use `stages` instead. * `stages` - Which stages 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 2b6f422a8..235053e56 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,24 +73,26 @@ 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.60.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" { - version = "~> 0.60.0" + version = "~> 0.61.0" ... } ``` @@ -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 HCP Terraform `appTerraformIo` - token = var.token - version = "~> 0.60.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 HCP Terraform or Terraform 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 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` + 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..069e89928 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..db02b1922 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 d83bc9dd9..096632e1d 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 c8629c52c..37d6d4856 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 HCP Terraform. 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/audit_trail_token.html.markdown b/website/docs/cdktf/typescript/r/audit_trail_token.html.markdown new file mode 100644 index 000000000..29fae1e98 --- /dev/null +++ b/website/docs/cdktf/typescript/r/audit_trail_token.html.markdown @@ -0,0 +1,97 @@ +--- +layout: "tfe" +page_title: "Terraform Enterprise: tfe_audit_trail_token" +description: |- + Generates a new audit trail token in organization, replacing any existing token. +--- + + + +# tfe_audit_trail_token + +Generates a new audit trail token in organization, replacing any existing token. + +Note that only organizations that have the [audit-logging entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#audit-logging) may create audit trail tokens. + +## 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 { AuditTrailToken } from "./.gen/providers/tfe/audit-trail-token"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new AuditTrailToken(this, "test", { + 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. +* `forceRegenerate` - (Optional) If set to `true`, a new token will be + generated even if a token already exists. This will invalidate the existing + token! +* `expiredAt` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339 +format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and +never expire. + +## Example Usage + +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 { AuditTrailToken } from "./.gen/providers/tfe/audit-trail-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 AuditTrailToken(this, "test", { + expiredAt: Token.asString(example.rotationRfc3339), + organization: Token.asString(org.name), + }); + } +} + +``` + +## Attributes Reference + +* `id` - The ID of the token. +* `token` - The generated token. + +## Import + +Audit trail tokens can be imported; use `` as the import ID. +For example: + +```shell +terraform import tfe_audit_trail_token.test my-org-name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/data_retention_policy.html.markdown b/website/docs/cdktf/typescript/r/data_retention_policy.html.markdown index 7685f4404..269bb49aa 100644 --- a/website/docs/cdktf/typescript/r/data_retention_policy.html.markdown +++ b/website/docs/cdktf/typescript/r/data_retention_policy.html.markdown @@ -16,39 +16,38 @@ Creates a data retention policy attached to either an organization or workspace. Creating a data retention policy for a 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 tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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 { DataRetentionPolicy } from "./.gen/providers/tfe/data-retention-policy"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +interface MyConfig { + dontDelete: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { 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 - ), - } - ); - new tfe.dataRetentionPolicy.DataRetentionPolicy(this, "foobar", { + 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, + }); + new DataRetentionPolicy(this, "foobar", { deleteOlderThan: [ { days: 42, }, ], - workspaceId: cdktf.Token.asString(tfeWorkspaceTestWorkspace.id), + workspaceId: testWorkspace.id, + dontDelete: config.dontDelete, }); } } @@ -58,29 +57,33 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a data retention policy for an organization: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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 { DataRetentionPolicy } from "./.gen/providers/tfe/data-retention-policy"; +import { Organization } from "./.gen/providers/tfe/organization"; +interface MyConfig { + dontDelete: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { super(scope, name); - const tfeOrganizationTestOrganization = new tfe.organization.Organization( - this, - "test-organization", - { - email: "admin@company.com", - name: "my-org-name", - } - ); - new tfe.dataRetentionPolicy.DataRetentionPolicy(this, "foobar", { + const testOrganization = new Organization(this, "test-organization", { + email: "admin@company.com", + name: "my-org-name", + }); + new DataRetentionPolicy(this, "foobar", { deleteOlderThan: [ { days: 1138, }, ], - organization: cdktf.Token.asString(tfeOrganizationTestOrganization.name), + organization: testOrganization.name, + dontDelete: config.dontDelete, }); } } @@ -89,32 +92,43 @@ class MyConvertedCode extends cdktf.TerraformStack { 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" +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataRetentionPolicy } from "./.gen/providers/tfe/data-retention-policy"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Workspace } from "./.gen/providers/tfe/workspace"; +interface MyConfig { + dontDelete: any; } - -// create data retention policy the organization -resource "tfe_data_retention_policy" "foobar" { - organization = tfe_organization.test-organization.name - - delete_older_than { - days = 1138 +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + 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, + }); + new DataRetentionPolicy(this, "foobar", { + deleteOlderThan: [ + { + days: 1138, + }, + ], + organization: testOrganization.name, + dontDelete: config.dontDelete, + }); } } -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 @@ -135,4 +149,4 @@ A resource can be imported; use `/` or ` \ 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 31e4d9745..c9a622391 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"); } @@ -60,34 +53,52 @@ class MyConvertedCode extends cdktf.TerraformStack { Creating a no-code module with variable options: -```hcl -resource "tfe_organization" "foobar" { - name = "my-org-name" - email = "admin@company.com" -} - -resource "tfe_registry_module" "foobar" { - organization = tfe_organization.foobar.id - module_provider = "my_provider" - name = "test_module" +```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) { + 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, + }); + /*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", + }, + ], + }); + /*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"); + } } -resource "tfe_no_code_module" "foobar" { - organization = tfe_organization.foobar.id - registry_module = tfe_registry_module.foobar.id - - variable_options { - name = "ami" - type = "string" - options = [ "ami-0", "ami-1", "ami-2" ] - } - - variable_options { - name = "region" - type = "string" - options = [ "us-east-1", "us-east-2", "us-west-1"] - } -} ``` ## Argument Reference @@ -116,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 210773094..3f6b48d3b 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 HCP Terraform or Terraform Enterprise v202005-1 or later * `slack` - * `microsoftTeams` available in HCP Terraform 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`, `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`, `assessment:failed`, `workspace:autoDestroyReminder`, or `workspace:autoDestroyRunResults`. + send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying` + `run:completed`, `run:errored`, `assessment:check_failure`, `assessment:drifted`, `assessment:failed`, `workspace:auto_destroy_reminder`, or `workspace:auto_destroy_run_results`. 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 bae635a3f..b7753946f 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", @@ -48,15 +51,18 @@ 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 -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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", @@ -79,15 +85,18 @@ When using Bitbucket Data Center, you must use three required fields: `key`, `se ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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://bbdc.example.com", httpUrl: "https://bbdc.example.com", key: "", @@ -111,23 +120,23 @@ 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 `bitbucketDataCenter`) 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. -* `rsaPublicKey` - (Required for `bitbucketDataCenter`) Required for Bitbucket +* `rsaPublicKey` - (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. * `serviceProvider` - (Required) The VCS provider being connected with. Valid - options are `adoServer`, `adoServices`, `bitbucketDataCenter`, `bitbucketHosted`, `bitbucketServer`(deprecated), `github`, `githubEnterprise`, `gitlabHosted`, - `gitlabCommunityEdition`, or `gitlabEnterpriseEdition`. + 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`. * `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`. @@ -136,4 +145,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/opa_version.html.markdown b/website/docs/cdktf/typescript/r/opa_version.html.markdown index fb467bb53..71e097001 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 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 178e259b1..efbb5ca79 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 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. @@ -66,4 +69,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 0c71810b1..438ead0da 100644 --- a/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_default_settings.html.markdown @@ -9,36 +9,47 @@ 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: -```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 { 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", + }); + } } -resource "tfe_agent_pool" "my_agents" { - name = "agent_smiths" - 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 -} - -resource "tfe_workspace" "my_workspace" { - name = "my-workspace" - # 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] -} ``` ## Argument Reference @@ -59,4 +70,4 @@ Organization default execution mode can be imported; use `` a 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 8a7b3c5d8..4573091e2 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..d741b19b9 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 654ef9ec1..cdd80a71f 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_run_task_global_settings.html.markdown b/website/docs/cdktf/typescript/r/organization_run_task_global_settings.html.markdown index eb0adc3a0..0a68673b8 100644 --- a/website/docs/cdktf/typescript/r/organization_run_task_global_settings.html.markdown +++ b/website/docs/cdktf/typescript/r/organization_run_task_global_settings.html.markdown @@ -11,40 +11,39 @@ description: |- [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 `globalRunTask` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks. +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: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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"; +import { OrganizationRunTaskGlobalSettings } from "./.gen/providers/tfe/organization-run-task-global-settings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const tfeOrganizationRunTaskExample = - new tfe.organizationRunTask.OrganizationRunTask(this, "example", { - description: "An example task", + const example = new OrganizationRunTask(this, "example", { + description: "An example task", + enabled: true, + name: "task-name", + organization: "org-name", + url: "https://external.service.com", + }); + const tfeOrganizationRunTaskGlobalSettingsExample = + new OrganizationRunTaskGlobalSettings(this, "example_1", { enabled: true, - name: "task-name", - organization: "org-name", - url: "https://external.service.com", + enforcementLevel: "advisory", + stages: ["pre_plan", "post_plan"], + taskId: example.id, }); - const tfeOrganizationRunTaskGlobalSettingsExample = - new tfe.organizationRunTaskGlobalSettings.OrganizationRunTaskGlobalSettings( - this, - "example_1", - { - enabled: true, - enforcementLevel: "advisory", - stages: ["pre_plan", "post_plan"], - taskId: cdktf.Token.asString(tfeOrganizationRunTaskExample.id), - } - ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ tfeOrganizationRunTaskGlobalSettingsExample.overrideLogicalId("example"); } @@ -58,7 +57,7 @@ The following arguments are supported: * `enabled` - (Optional) Whether the run task will be applied globally. * `enforcementLevel` - (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 `prePlan`, `postPlan`, `preApply` and `post apply`. +* `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`. * `taskId` - (Required) The id of the Run task which will have the global settings applied. ## Attributes Reference @@ -74,4 +73,4 @@ import ID. For example: terraform import tfe_organization_run_task_global_settings.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..14827b624 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..f1f558b02 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..462a5f3c7 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..3f9b2f545 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 fb6f71b7d..98ee787d1 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, }); } } @@ -65,4 +65,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_oauth_client.html.markdown b/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown index 6bdf50804..82b775661 100644 --- a/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown +++ b/website/docs/cdktf/typescript/r/project_oauth_client.html.markdown @@ -16,42 +16,43 @@ Adds and removes oauth clients 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 { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { Project } from "./.gen/providers/tfe/project"; +import { ProjectOauthClient } from "./.gen/providers/tfe/project-oauth-client"; +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 tfeOauthClientTest = new tfe.oauthClient.OauthClient(this, "test_2", { + const tfeOauthClientTest = new OauthClient(this, "test_2", { apiUrl: "https://api.github.com", httpUrl: "https://github.com", oauthToken: "oauth_token_id", - organization: tfeOrganizationTest, + organization: test, 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), - }); + const tfeProjectOauthClientTest = new ProjectOauthClient(this, "test_3", { + 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"); } @@ -78,4 +79,4 @@ Project OAuth Clients 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_policy_set.html.markdown b/website/docs/cdktf/typescript/r/project_policy_set.html.markdown index 86709c22d..f7f9e4de6 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..af276e54b 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_gpg_key.html.markdown b/website/docs/cdktf/typescript/r/registry_gpg_key.html.markdown index 851e98f10..0902bedb2 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 5bb26c416..ac9531625 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 @@ HCP Terraform's private module registry helps you share Terraform modules across 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, }); } } @@ -275,7 +249,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`. +* `initialVersion` - (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 `testConfig` block supports * `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. @@ -319,4 +293,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..b15138efa 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 cf77d93e0..aa059451d 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..c6fa32d34 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..4f75686b2 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 ebfaa56c0..6a9da7124 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 HCP Terraform and 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 { 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 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/ssh_key.html.markdown b/website/docs/cdktf/typescript/r/ssh_key.html.markdown index 90680d24c..8d307da84 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/stack.html.markdown b/website/docs/cdktf/typescript/r/stack.html.markdown index cdc154eda..11e3f548a 100644 --- a/website/docs/cdktf/typescript/r/stack.html.markdown +++ b/website/docs/cdktf/typescript/r/stack.html.markdown @@ -17,30 +17,46 @@ Defines a Stack resource. Basic usage: -```hcl -resource "tfe_oauth_client" "test" { - organization = "my-example-org" - api_url = "https://api.github.com" - http_url = "https://github.com" - oauth_token = var.github_token - service_provider = "github" -} - -data "tfe_organization" "organization" { - name = "my-example-org" -} - -resource "tfe_stack" "test-stack" { - name = "my-stack" - description = "A Terraform Stack using two components with two environments" - project_id = data.tfe_organization.organization.default_project_id - - vcs_repo { - branch = "main" - identifier = "my-github-org/stack-repo" - 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 { DataTfeOrganization } from "./.gen/providers/tfe/data-tfe-organization"; +import { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Stack } from "./.gen/providers/tfe/stack"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new OauthClient(this, "test", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: githubToken.stringValue, + organization: "my-example-org", + serviceProvider: "github", + }); + const organization = new DataTfeOrganization(this, "organization", { + name: "my-example-org", + }); + new Stack(this, "test-stack", { + description: + "A Terraform Stack using two components with two environments", + name: "my-stack", + projectId: Token.asString(organization.defaultProjectId), + vcsRepo: [ + { + branch: "main", + identifier: "my-github-org/stack-repo", + oauthTokenId: test.oauthTokenId, + }, + ], + }); } } + ``` ## Argument Reference @@ -61,7 +77,7 @@ The `vcsRepo` block supports: * `identifier` - (Required) A reference to your VCS repository in the format `/` where `` and `` refer to the organization and repository 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. -* `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. +* `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. ## Attributes Reference @@ -78,4 +94,4 @@ Example: terraform import tfe_stack.test-stack st-9cs9Vf6Z49Zzrk1t ``` - \ 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 02b62ffe7..5d9483ccc 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", }); @@ -91,4 +94,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..7b9c9c6d3 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..37d7ce013 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..bace78146 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 5c5c81837..5ec83cf7b 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 37b905299..08f774b35 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..b81c367aa 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..2e93525d6 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 ae044a10a..0578d8e59 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 HCP Terraform and 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 { 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 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/tfe_test_variable.html.markdown b/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown index 0ea52ed7c..7538c4d98 100644 --- a/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown +++ b/website/docs/cdktf/typescript/r/tfe_test_variable.html.markdown @@ -13,43 +13,59 @@ Creates, updates and destroys environment variables used for testing in the Priv ## 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 +```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 { OauthClient } from "./.gen/providers/tfe/oauth-client"; +import { Organization } from "./.gen/providers/tfe/organization"; +import { RegistryModule } from "./.gen/providers/tfe/registry-module"; +import { TestVariable } from "./.gen/providers/tfe/test-variable"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new OauthClient(this, "test_client", { + apiUrl: "https://api.github.com", + httpUrl: "https://github.com", + oauthToken: "my-token-123", + organization: test.name, + serviceProvider: "github", + }); + new Organization(this, "test_org", { + email: "admin@company.com", + name: "my-org-name", + }); + new RegistryModule(this, "test_module", { + organization: "test-module", + testConfig: [ + { + testsEnabled: true, + }, + ], + vcsRepo: { + branch: "main", + displayIdentifier: "GH_NAME/REPO_NAME", + identifier: "GH_NAME/REPO_NAME", + oauthTokenId: Token.asString(tfeOauthClientTest.oauthTokenId), + tags: false, + }, + }); + new TestVariable(this, "tf_test_test_variable", { + category: "env", + description: "some description", + key: "key_test", + moduleName: Token.asString(tfeRegistryModuleTest.name), + moduleProvider: Token.asString(tfeRegistryModuleTest.moduleProvider), + organization: test.name, + value: "value_test", + }); } } -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 + \ 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 65115c35e..75c4d4a61 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..498c08e91 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 1ded35e44..b93676094 100644 --- a/website/docs/cdktf/typescript/r/workspace.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace.html.markdown @@ -13,32 +13,30 @@ 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 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 +47,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, }, }); } @@ -100,7 +99,7 @@ The following arguments are supported: * `autoDestroyActivityDuration` - (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 `autoDestroyAt`. * `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"). Conflicts with `autoDestroyActivityDuration`. -~> **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. +~> **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 `ignore_changes` 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. @@ -109,7 +108,7 @@ 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) **Deprecated** Whether the workspace allows all workspaces in the organization to access its state data during runs. Use [tfe_workspace_settings](workspace_settings) instead. * `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 @@ -124,7 +123,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. +* `remoteStateConsumerIds` - (Optional) **Deprecated** The set of workspace IDs set as explicit remote state consumers for the given workspace. Use [tfe_workspace_settings](workspace_settings) instead. * `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 ". @@ -158,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 `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 `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). @@ -177,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 `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 @@ -201,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/typescript/r/workspace_policy_set.html.markdown b/website/docs/cdktf/typescript/r/workspace_policy_set.html.markdown index 08afbc792..6720a1d08 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..67187cc5f 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 61a417d34..93683e8ad 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 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. + * 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 HCP Terraform. - \ 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 b94833c5f..27bc60fcb 100644 --- a/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_run_task.html.markdown @@ -17,13 +17,27 @@ 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" - stages = ["pre_plan"] +```typescript +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } 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", + stages: ["pre_plan"], + taskId: tfeOrganizationRunTask.example.id, + workspaceId: tfeWorkspace.example.id, + }); + } } + ``` ## Argument Reference @@ -34,7 +48,7 @@ The following arguments are supported: * `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` - **Deprecated** Use `stages` instead. -* `stages` - (Optional) The stages to run the task in. Valid values are one or more of `prePlan`, `postPlan`, `preApply` and `post apply`. +* `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 @@ -49,4 +63,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 1551ccdf1..9b077614b 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,89 +49,152 @@ 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 tfeAgentPoolTestAgentPool = new tfe.agentPool.AgentPool( + const testAgentPool = new AgentPool(this, "test-agent-pool", { + name: "my-agent-pool-name", + organization: testOrganization.name, + }); + 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, }); } } ``` -This resource may be used as a data source when no optional arguments are defined: +Using `remoteStateConsumerIds`: ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as tfe from "./.gen/providers/tfe"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.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, + Op, + conditional, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +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 dataTfeWorkspaceTest = new tfe.dataTfeWorkspace.DataTfeWorkspace( - this, - "test", - { - name: "my-workspace-name", - organization: "my-org-name", - } + /*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 testForEachIterator = TerraformIterator.fromList( + Token.asAny(Fn.toset(["qa", "production"])) + ); + const test = new Workspace(this, "test", { + name: "${" + testForEachIterator.value + "}-test", + forEach: testForEachIterator, + }); + /*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 testSettingsForEachIterator = TerraformIterator.fromList( + Token.asAny(Fn.toset(["qa", "production"])) ); - const tfeWorkspaceSettingsTest = - new tfe.workspaceSettings.WorkspaceSettings(this, "test_1", { - workspaceId: cdktf.Token.asString(dataTfeWorkspaceTest.id), - }); + new WorkspaceSettings(this, "test-settings", { + globalRemoteState: false, + remoteStateConsumerIds: Token.asList( + Fn.toset( + Fn.compact( + Token.asList([ + conditional( + Op.eq(testSettingsForEachIterator.value, "production"), + Fn.lookupNested(test, ['"qa"', "id"]), + "" + ), + ]) + ) + ) + ), + workspaceId: Token.asString( + Fn.lookupNested( + Fn.lookupNested(test, [testSettingsForEachIterator.value]), + ["id"] + ) + ), + forEach: testSettingsForEachIterator, + }); + } +} + +``` + +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 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"', ]), @@ -151,6 +215,8 @@ The following arguments are supported: 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`. 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. +* `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`). By default, HashiCorp recommends you do not allow other workspaces to access their state. We recommend that you follow the principle of least privilege and only enable state access between workspaces that specifically need information from each other. +* `remoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace. To set this attribute, global_remote_state must be false. ## Attributes Reference @@ -159,7 +225,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 +240,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 4026bdc60..b7c94f8df 100644 --- a/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown +++ b/website/docs/cdktf/typescript/r/workspace_variable_set.html.markdown @@ -11,33 +11,57 @@ 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: -```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 { 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 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: 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 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 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"); + } } -resource "tfe_workspace" "test" { - name = "my-workspace-name" - organization = tfe_organization.test.name -} - -resource "tfe_variable_set" "test" { - name = "Test Varset" - description = "Some description." - organization = tfe_organization.test.name -} - -resource "tfe_workspace_variable_set" "test" { - variable_set_id = tfe_variable_set.test.id - workspace_id = tfe_workspace.test.id -} ``` ## Argument Reference @@ -59,4 +83,4 @@ Workspace Variable Sets can be imported; use `// \ No newline at end of file + \ No newline at end of file