-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1552 from hashicorp/create-pull-request/patch
release: v0.62.0
- Loading branch information
Showing
40 changed files
with
1,307 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
website/docs/cdktf/csharp/r/audit_trail_token.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
layout: "tfe" | ||
page_title: "Terraform Enterprise: tfe_audit_trail_token" | ||
description: |- | ||
Generates a new audit trail token in organization, replacing any existing token. | ||
--- | ||
|
||
|
||
<!-- Please do not edit this file, it is generated. --> | ||
# 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: | ||
|
||
```csharp | ||
using Constructs; | ||
using HashiCorp.Cdktf; | ||
/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
using Gen.Providers.Tfe; | ||
class MyConvertedCode : TerraformStack | ||
{ | ||
public MyConvertedCode(Construct scope, string name) : base(scope, name) | ||
{ | ||
new AuditTrailToken.AuditTrailToken(this, "test", new AuditTrailTokenConfig { | ||
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: | ||
|
||
```hcl | ||
resource "time_rotating" "example" { | ||
rotation_days = 30 | ||
} | ||
resource "tfe_audit_trail_token" "test" { | ||
organization = data.tfe_organization.org.name | ||
expired_at = time_rotating.example.rotation_rfc3339 | ||
} | ||
``` | ||
|
||
## Attributes Reference | ||
|
||
* `Id` - The ID of the token. | ||
* `Token` - The generated token. | ||
|
||
## Import | ||
|
||
Audit trail tokens can be imported; use `<ORGANIZATION NAME>` as the import ID. | ||
For example: | ||
|
||
```shell | ||
terraform import tfe_audit_trail_token.test my-org-name | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-2c87d1201e89a4243d53e9ef85752b50f8797786174b1c7744ecc61fd3ced2cd --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,95 @@ class MyConvertedCode : TerraformStack | |
} | ||
``` | ||
|
||
Creating a project-owned variable set that is applied to all workspaces in the project: | ||
|
||
```csharp | ||
using Constructs; | ||
using HashiCorp.Cdktf; | ||
/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
using Gen.Providers.Tfe; | ||
class MyConvertedCode : TerraformStack | ||
{ | ||
public MyConvertedCode(Construct scope, string name) : base(scope, name) | ||
{ | ||
var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { | ||
Email = "[email protected]", | ||
Name = "my-org-name" | ||
}); | ||
var tfeProjectTest = new Project.Project(this, "test_1", new ProjectConfig { | ||
Name = "projectname", | ||
Organization = Token.AsString(tfeOrganizationTest.Name) | ||
}); | ||
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ | ||
tfeProjectTest.OverrideLogicalId("test"); | ||
var tfeVariableSetTest = new VariableSet.VariableSet(this, "test_2", new VariableSetConfig { | ||
Description = "Varset that is owned and managed by a project.", | ||
Name = "Project-owned Varset", | ||
Organization = Token.AsString(tfeOrganizationTest.Name), | ||
ParentProjectId = 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.*/ | ||
tfeVariableSetTest.OverrideLogicalId("test"); | ||
var tfeProjectVariableSetTest = | ||
new ProjectVariableSet.ProjectVariableSet(this, "test_3", new ProjectVariableSetConfig { | ||
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"); | ||
} | ||
} | ||
``` | ||
|
||
Creating a project-owned variable set that is applied to specific workspaces: | ||
|
||
```csharp | ||
using Constructs; | ||
using HashiCorp.Cdktf; | ||
/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
using Gen.Providers.Tfe; | ||
class MyConvertedCode : TerraformStack | ||
{ | ||
public MyConvertedCode(Construct scope, string name) : base(scope, name) | ||
{ | ||
var tfeOrganizationTest = new Organization.Organization(this, "test", new OrganizationConfig { | ||
Email = "[email protected]", | ||
Name = "my-org-name" | ||
}); | ||
var tfeProjectTest = new Project.Project(this, "test_1", new ProjectConfig { | ||
Name = "projectname", | ||
Organization = Token.AsString(tfeOrganizationTest.Name) | ||
}); | ||
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ | ||
tfeProjectTest.OverrideLogicalId("test"); | ||
var tfeVariableSetTest = new VariableSet.VariableSet(this, "test_2", new VariableSetConfig { | ||
Description = "Varset that is owned and managed by a project.", | ||
Name = "Project-owned Varset", | ||
Organization = Token.AsString(tfeOrganizationTest.Name), | ||
ParentProjectId = 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.*/ | ||
tfeVariableSetTest.OverrideLogicalId("test"); | ||
var tfeWorkspaceTest = new Workspace.Workspace(this, "test_3", new WorkspaceConfig { | ||
Name = "my-workspace-name", | ||
Organization = Token.AsString(tfeOrganizationTest.Name), | ||
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.*/ | ||
tfeWorkspaceTest.OverrideLogicalId("test"); | ||
var tfeWorkspaceVariableSetTest = | ||
new WorkspaceVariableSet.WorkspaceVariableSet(this, "test_4", new WorkspaceVariableSetConfig { | ||
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"); | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
@@ -177,6 +266,8 @@ The following arguments are supported: | |
Must not be set if `Global` is set. This argument is mutually exclusive with using the resource | ||
[tfe_workspace_variable_set](workspace_variable_set.html) which is the preferred method of associating a workspace | ||
with a variable set. | ||
* `ParentProjectId` - (Optional) ID of the project that should own the variable set. If set, than the value of `Global` must be `False`. | ||
To assign whether a variable set should be applied to a project, use the [`TfeProjectVariableSet`](project_variable_set.html) resource. | ||
|
||
## Attributes Reference | ||
|
||
|
@@ -190,4 +281,4 @@ Variable sets can be imported; use `<VARIABLE SET ID>` as the import ID. For exa | |
terraform import tfe_variable_set.test varset-5rTwnSaRPogw6apb | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.17.0-pre.15 input-56c480ce5d76f75a9c6444491a533a03a70a4fb8de37cdeb7ea6b6fdb26d44c4 --> | ||
<!-- cache-key: cdktf-0.17.0-pre.15 input-e43c37b8fda384ac825900c2a05dad46b7405306e02b1151313679fb612e7a61 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.