Skip to content

Commit 343aca1

Browse files
authored
Merge pull request #1552 from hashicorp/create-pull-request/patch
release: v0.62.0
2 parents 8125e71 + 3d4ff89 commit 343aca1

40 files changed

+1307
-139
lines changed

website/docs/cdktf/csharp/d/variable_set.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ The following arguments are supported:
5151
* `WorkspaceIds` - IDs of the workspaces that use the variable set.
5252
* `VariableIds` - IDs of the variables attached to the variable set.
5353
* `ProjectIds` - IDs of the projects that use the variable set.
54+
* `ParentProjectId` - ID of the project that owns the variable set.
5455

55-
<!-- cache-key: cdktf-0.17.0-pre.15 input-69cc7771506b3265795fe469ee556bc13e62b7222aa6d0f36adeae7b5aa799c2 -->
56+
<!-- cache-key: cdktf-0.17.0-pre.15 input-bf1bfbd6988140f428db72c174b6b91d124e83198e36d64ed719ce367b5f38fe -->

website/docs/cdktf/csharp/index.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ automatically installed by `terraform init` in the future:
7777
terraform {
7878
required_providers {
7979
tfe = {
80-
version = "~> 0.60.0"
80+
version = "~> 0.62.0"
8181
}
8282
}
8383
}
@@ -90,7 +90,7 @@ The above snippet using `RequiredProviders` is for Terraform 0.13+; if you are u
9090

9191
```hcl
9292
provider "tfe" {
93-
version = "~> 0.60.0"
93+
version = "~> 0.62.0"
9494
...
9595
}
9696
```
@@ -103,7 +103,7 @@ For more information on provider installation and constraining provider versions
103103
provider "tfe" {
104104
hostname = var.hostname # Optional, defaults to HCP Terraform `AppTerraformIo`
105105
token = var.token
106-
version = "~> 0.60.0"
106+
version = "~> 0.62.0"
107107
}
108108
109109
# Create an organization
@@ -129,4 +129,4 @@ The following arguments are supported:
129129
arguments. Ensure that the organization already exists prior to using this argument.
130130
This can also be specified using the `TfeOrganization` environment variable.
131131

132-
<!-- cache-key: cdktf-0.17.0-pre.15 input-a77df58c9615ebcb917fe58dd81f9e798ce819182034bd2e639ba91520a1ccad -->
132+
<!-- cache-key: cdktf-0.17.0-pre.15 input-c53fd50c149df357cf3dca9ae2dec851fb9e70077b6d8995cede275a4c0c61f6 -->
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
layout: "tfe"
3+
page_title: "Terraform Enterprise: tfe_audit_trail_token"
4+
description: |-
5+
Generates a new audit trail token in organization, replacing any existing token.
6+
---
7+
8+
9+
<!-- Please do not edit this file, it is generated. -->
10+
# tfe_audit_trail_token
11+
12+
Generates a new audit trail token in organization, replacing any existing token.
13+
14+
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.
15+
16+
## Example Usage
17+
18+
Basic usage:
19+
20+
```csharp
21+
using Constructs;
22+
using HashiCorp.Cdktf;
23+
/*Provider bindings are generated by running cdktf get.
24+
See https://cdk.tf/provider-generation for more details.*/
25+
using Gen.Providers.Tfe;
26+
class MyConvertedCode : TerraformStack
27+
{
28+
public MyConvertedCode(Construct scope, string name) : base(scope, name)
29+
{
30+
new AuditTrailToken.AuditTrailToken(this, "test", new AuditTrailTokenConfig {
31+
Organization = "my-org-name"
32+
});
33+
}
34+
}
35+
```
36+
37+
## Argument Reference
38+
39+
The following arguments are supported:
40+
41+
* `Organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config.
42+
* `ForceRegenerate` - (Optional) If set to `True`, a new token will be
43+
generated even if a token already exists. This will invalidate the existing
44+
token!
45+
* `ExpiredAt` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339
46+
format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and
47+
never expire.
48+
49+
## Example Usage
50+
51+
When a token has an expiry:
52+
53+
```hcl
54+
resource "time_rotating" "example" {
55+
rotation_days = 30
56+
}
57+
58+
resource "tfe_audit_trail_token" "test" {
59+
organization = data.tfe_organization.org.name
60+
expired_at = time_rotating.example.rotation_rfc3339
61+
}
62+
```
63+
64+
## Attributes Reference
65+
66+
* `Id` - The ID of the token.
67+
* `Token` - The generated token.
68+
69+
## Import
70+
71+
Audit trail tokens can be imported; use `<ORGANIZATION NAME>` as the import ID.
72+
For example:
73+
74+
```shell
75+
terraform import tfe_audit_trail_token.test my-org-name
76+
```
77+
78+
<!-- cache-key: cdktf-0.17.0-pre.15 input-2c87d1201e89a4243d53e9ef85752b50f8797786174b1c7744ecc61fd3ced2cd -->

website/docs/cdktf/csharp/r/project_variable_set.html.markdown

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ description: |-
55
Add a variable set to a project
66
---
77

8+
9+
<!-- Please do not edit this file, it is generated. -->
810
# tfe_project_variable_set
911

10-
Adds and removes variable sets from a project
12+
Adds and removes a project from a variable set's scope.
13+
14+
-> **Note:** This resource controls whether a project has access to a variable set, not whether
15+
a project owns the variable set. Ownership is specified by setting the `ParentProjectId` on the
16+
`TfeVariableSet` resource.
1117

1218
## Example Usage
1319

@@ -70,4 +76,4 @@ Project Variable Sets can be imported; use `<ORGANIZATION>/<PROJECT ID>/<VARIABL
7076
terraform import tfe_project_variable_set.test 'my-org-name/prj-F1NpdVBuCF3xc5Rp/Test Varset'
7177
```
7278

73-
<!-- cache-key: cdktf-0.17.0-pre.15 input-3ed7efa700c9f0adbd77edbead72946a667e2f16005af09d2a97b4351f63db90 -->
79+
<!-- cache-key: cdktf-0.17.0-pre.15 input-daf47945bcce294b7bb84fb1557fe718d31e19868ca6657bf229429e9d6bb394 -->

website/docs/cdktf/csharp/r/variable_set.html.markdown

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,95 @@ class MyConvertedCode : TerraformStack
164164
}
165165
```
166166

167+
Creating a project-owned variable set that is applied to all workspaces in the project:
168+
169+
```csharp
170+
using Constructs;
171+
using HashiCorp.Cdktf;
172+
/*Provider bindings are generated by running cdktf get.
173+
See https://cdk.tf/provider-generation for more details.*/
174+
using Gen.Providers.Tfe;
175+
class MyConvertedCode : TerraformStack
176+
{
177+
public MyConvertedCode(Construct scope, string name) : base(scope, name)
178+
{
179+
var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig {
180+
Email = "[email protected]",
181+
Name = "my-org-name"
182+
});
183+
var tfeProjectTest = new Project.Project(this, "test_1", new ProjectConfig {
184+
Name = "projectname",
185+
Organization = Token.AsString(tfeOrganizationTest.Name)
186+
});
187+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
188+
tfeProjectTest.OverrideLogicalId("test");
189+
var tfeVariableSetTest = new VariableSet.VariableSet(this, "test_2", new VariableSetConfig {
190+
Description = "Varset that is owned and managed by a project.",
191+
Name = "Project-owned Varset",
192+
Organization = Token.AsString(tfeOrganizationTest.Name),
193+
ParentProjectId = Token.AsString(tfeProjectTest.Id)
194+
});
195+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
196+
tfeVariableSetTest.OverrideLogicalId("test");
197+
var tfeProjectVariableSetTest =
198+
new ProjectVariableSet.ProjectVariableSet(this, "test_3", new ProjectVariableSetConfig {
199+
ProjectId = Token.AsString(tfeProjectTest.Id),
200+
VariableSetId = Token.AsString(tfeVariableSetTest.Id)
201+
});
202+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
203+
tfeProjectVariableSetTest.OverrideLogicalId("test");
204+
}
205+
}
206+
```
207+
208+
Creating a project-owned variable set that is applied to specific workspaces:
209+
210+
```csharp
211+
using Constructs;
212+
using HashiCorp.Cdktf;
213+
/*Provider bindings are generated by running cdktf get.
214+
See https://cdk.tf/provider-generation for more details.*/
215+
using Gen.Providers.Tfe;
216+
class MyConvertedCode : TerraformStack
217+
{
218+
public MyConvertedCode(Construct scope, string name) : base(scope, name)
219+
{
220+
var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig {
221+
Email = "[email protected]",
222+
Name = "my-org-name"
223+
});
224+
var tfeProjectTest = new Project.Project(this, "test_1", new ProjectConfig {
225+
Name = "projectname",
226+
Organization = Token.AsString(tfeOrganizationTest.Name)
227+
});
228+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
229+
tfeProjectTest.OverrideLogicalId("test");
230+
var tfeVariableSetTest = new VariableSet.VariableSet(this, "test_2", new VariableSetConfig {
231+
Description = "Varset that is owned and managed by a project.",
232+
Name = "Project-owned Varset",
233+
Organization = Token.AsString(tfeOrganizationTest.Name),
234+
ParentProjectId = Token.AsString(tfeProjectTest.Id)
235+
});
236+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
237+
tfeVariableSetTest.OverrideLogicalId("test");
238+
var tfeWorkspaceTest = new Workspace.Workspace(this, "test_3", new WorkspaceConfig {
239+
Name = "my-workspace-name",
240+
Organization = Token.AsString(tfeOrganizationTest.Name),
241+
ProjectId = Token.AsString(tfeProjectTest.Id)
242+
});
243+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
244+
tfeWorkspaceTest.OverrideLogicalId("test");
245+
var tfeWorkspaceVariableSetTest =
246+
new WorkspaceVariableSet.WorkspaceVariableSet(this, "test_4", new WorkspaceVariableSetConfig {
247+
VariableSetId = Token.AsString(tfeVariableSetTest.Id),
248+
WorkspaceId = Token.AsString(tfeWorkspaceTest.Id)
249+
});
250+
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
251+
tfeWorkspaceVariableSetTest.OverrideLogicalId("test");
252+
}
253+
}
254+
```
255+
167256
## Argument Reference
168257

169258
The following arguments are supported:
@@ -177,6 +266,8 @@ The following arguments are supported:
177266
Must not be set if `Global` is set. This argument is mutually exclusive with using the resource
178267
[tfe_workspace_variable_set](workspace_variable_set.html) which is the preferred method of associating a workspace
179268
with a variable set.
269+
* `ParentProjectId` - (Optional) ID of the project that should own the variable set. If set, than the value of `Global` must be `False`.
270+
To assign whether a variable set should be applied to a project, use the [`TfeProjectVariableSet`](project_variable_set.html) resource.
180271

181272
## Attributes Reference
182273

@@ -190,4 +281,4 @@ Variable sets can be imported; use `<VARIABLE SET ID>` as the import ID. For exa
190281
terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb
191282
```
192283

193-
<!-- cache-key: cdktf-0.17.0-pre.15 input-56c480ce5d76f75a9c6444491a533a03a70a4fb8de37cdeb7ea6b6fdb26d44c4 -->
284+
<!-- cache-key: cdktf-0.17.0-pre.15 input-e43c37b8fda384ac825900c2a05dad46b7405306e02b1151313679fb612e7a61 -->

website/docs/cdktf/csharp/r/workspace.html.markdown

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Provides a workspace resource.
1313

1414
~> **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"`.
1515

16-
~> **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.
17-
1816
## Example Usage
1917

2018
Basic usage:
@@ -101,7 +99,7 @@ The following arguments are supported:
10199
trigger prefixes describe a set of paths which must contain changes for a
102100
VCS push to trigger a run. If disabled, any push will trigger a run.
103101
* `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.
104-
* `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`).
102+
* `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.
105103
* `Operations` - **Deprecated** Whether to use remote execution mode.
106104
Defaults to `True`. When set to `False`, the workspace will be used for
107105
state storage only. This value _must not_ be provided if `ExecutionMode` is
@@ -116,7 +114,7 @@ The following arguments are supported:
116114
is `False`. The provider uses `True` as any workspace provisioned with
117115
`False` would need to then have a run manually queued out-of-band before
118116
accepting webhooks.
119-
* `RemoteStateConsumerIds` - (Optional) The set of workspace IDs set as explicit remote state consumers for the given workspace.
117+
* `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.
120118
* `SourceName` - (Optional) A friendly name for the application or client
121119
creating this workspace. If set, this will be displayed on the workspace as
122120
"Created via <SOURCE NAME>".
@@ -193,4 +191,4 @@ terraform import tfe_workspace.test ws-CH5in3chf8RJjrVd
193191
terraform import tfe_workspace.test my-org-name/my-wkspace-name
194192
```
195193

196-
<!-- cache-key: cdktf-0.17.0-pre.15 input-d77de336a5a7ff992f384172426e4a08194946368dc6e0a8c28f78a10116913f -->
194+
<!-- cache-key: cdktf-0.17.0-pre.15 input-2359c8613d3559ab7c7a4c6129993314e7d1492991970cbde73305dbd190c688 -->

website/docs/cdktf/csharp/r/workspace_settings.markdown

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,42 @@ class MyConvertedCode : TerraformStack
8181
}
8282
```
8383

84+
Using `RemoteStateConsumerIds`:
85+
86+
```csharp
87+
using Constructs;
88+
using HashiCorp.Cdktf;
89+
/*Provider bindings are generated by running cdktf get.
90+
See https://cdk.tf/provider-generation for more details.*/
91+
using Gen.Providers.Tfe;
92+
class MyConvertedCode : TerraformStack
93+
{
94+
public MyConvertedCode(Construct scope, string name) : base(scope, name)
95+
{
96+
/*In most cases loops should be handled in the programming language context and
97+
not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input
98+
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
99+
you need to keep this like it is.*/
100+
var tfeWorkspaceTestForEachIterator = TerraformIterator.FromList(Token.AsAny(Fn.Toset(new [] { "qa", "production" })));
101+
var tfeWorkspaceTest = new Workspace.Workspace(this, "test", new WorkspaceConfig {
102+
Name = "${" + tfeWorkspaceTestForEachIterator.Value + "}-test",
103+
ForEach = tfeWorkspaceTestForEachIterator
104+
});
105+
/*In most cases loops should be handled in the programming language context and
106+
not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input
107+
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
108+
you need to keep this like it is.*/
109+
var tfeWorkspaceSettingsTestSettingsForEachIterator = TerraformIterator.FromList(Token.AsAny(Fn.Toset(new [] { "qa", "production" })));
110+
new WorkspaceSettings.WorkspaceSettings(this, "test-settings", new WorkspaceSettingsConfig {
111+
GlobalRemoteState = false,
112+
RemoteStateConsumerIds = Token.AsList(Fn.Toset(Fn.Compact(Token.AsList(new [] { Conditional(Op.Eq(tfeWorkspaceSettingsTestSettingsForEachIterator.Value, "production"), PropertyAccess(tfeWorkspaceTest, new [] { "\"qa\"", "id" }), "") })))),
113+
WorkspaceId = Token.AsString(PropertyAccess(PropertyAccess(tfeWorkspaceTest, new [] { tfeWorkspaceSettingsTestSettingsForEachIterator.Value }), new [] { "id" })),
114+
ForEach = tfeWorkspaceSettingsTestSettingsForEachIterator
115+
});
116+
}
117+
}
118+
```
119+
84120
This resource may be used as a data source when no optional arguments are defined:
85121

86122
```csharp
@@ -119,6 +155,8 @@ The following arguments are supported:
119155
to be set to `Agent`. This value _must not_ be provided if `ExecutionMode` is set to any other value.
120156
* `ExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode)
121157
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.
158+
* `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.
159+
* `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.
122160

123161
## Attributes Reference
124162

@@ -142,4 +180,4 @@ terraform import tfe_workspace_settings.test ws-CH5in3chf8RJjrVd
142180
terraform import tfe_workspace_settings.test my-org-name/my-wkspace-name
143181
```
144182

145-
<!-- cache-key: cdktf-0.17.0-pre.15 input-e567651e80d935c1297d2d63ac7bf6052ff86525f29c4e5f59a3395787d5761b -->
183+
<!-- cache-key: cdktf-0.17.0-pre.15 input-a714b9c49f712177772ab35d2cee545ccc98acb4ad551946c130f0e00257d4d5 -->

website/docs/cdktf/csharp/r/workspace_variable_set.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: |-
99
<!-- Please do not edit this file, it is generated. -->
1010
# tfe_workspace_variable_set
1111

12-
Adds and removes variable sets from a workspace
12+
Adds and removes a workspace from a variable set's scope.
1313

1414
-> **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.
1515

@@ -74,4 +74,4 @@ Workspace Variable Sets can be imported; use `<ORGANIZATION>/<WORKSPACE NAME>/<V
7474
terraform import tfe_workspace_variable_set.test 'my-org-name/workspace/My Variable Set'
7575
```
7676

77-
<!-- cache-key: cdktf-0.17.0-pre.15 input-0e93a89fc33e5f30b980a6183974fb86043d6296ff2c7122f52cfeca3fdd3ba4 -->
77+
<!-- cache-key: cdktf-0.17.0-pre.15 input-6dfe4c82273213a8c39d4cf9a21f083a573d571789d1952df673e7cfe729ed8d -->

website/docs/cdktf/go/d/variable_set.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ The following arguments are supported:
5454
* `WorkspaceIds` - IDs of the workspaces that use the variable set.
5555
* `VariableIds` - IDs of the variables attached to the variable set.
5656
* `ProjectIds` - IDs of the projects that use the variable set.
57+
* `ParentProjectId` - ID of the project that owns the variable set.
5758

58-
<!-- cache-key: cdktf-0.17.0-pre.15 input-69cc7771506b3265795fe469ee556bc13e62b7222aa6d0f36adeae7b5aa799c2 -->
59+
<!-- cache-key: cdktf-0.17.0-pre.15 input-bf1bfbd6988140f428db72c174b6b91d124e83198e36d64ed719ce367b5f38fe -->

0 commit comments

Comments
 (0)