-
Notifications
You must be signed in to change notification settings - Fork 156
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 #1153 from hashicorp/d-cdktf-docs-6998888439-46
cdktf: update documentation
- Loading branch information
Showing
4 changed files
with
104 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,47 @@ class MyConvertedCode(TerraformStack): | |
) | ||
``` | ||
|
||
Create private registry module with tests enabled: | ||
|
||
```python | ||
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug | ||
from constructs import Construct | ||
from cdktf import TerraformStack | ||
# | ||
# Provider bindings are generated by running `cdktf get`. | ||
# See https://cdk.tf/provider-generation for more details. | ||
# | ||
from imports.tfe.oauth_client import OauthClient | ||
from imports.tfe.organization import Organization | ||
from imports.tfe.registry_module import RegistryModule | ||
class MyConvertedCode(TerraformStack): | ||
def __init__(self, scope, name): | ||
super().__init__(scope, name) | ||
test_organization = Organization(self, "test-organization", | ||
email="[email protected]", | ||
name="my-org-name" | ||
) | ||
test_oauth_client = OauthClient(self, "test-oauth-client", | ||
api_url="https://api.github.com", | ||
http_url="https://github.com", | ||
oauth_token="my-vcs-provider-token", | ||
organization=test_organization.name, | ||
service_provider="github" | ||
) | ||
RegistryModule(self, "test-registry-module", | ||
test_config=[{ | ||
"tests_enabled": True | ||
} | ||
], | ||
vcs_repo=RegistryModuleVcsRepo( | ||
branch="main", | ||
display_identifier="my-org-name/terraform-provider-name", | ||
identifier="my-org-name/terraform-provider-name", | ||
oauth_token_id=test_oauth_client.oauth_token_id | ||
) | ||
) | ||
``` | ||
|
||
Create private registry module with GitHub App: | ||
|
||
```python | ||
|
@@ -182,6 +223,9 @@ The following arguments are supported: | |
* `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. | ||
* `registry_name` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. | ||
|
||
The `test_config` block supports | ||
* `tests_enabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. | ||
|
||
The `vcs_repo` block supports: | ||
|
||
* `display_identifier` - (Required) The display identifier for your VCS repository. | ||
|
@@ -192,6 +236,8 @@ The `vcs_repo` block supports: | |
and repository in your VCS provider. The format for Azure DevOps is `<ado organization>/<ado project>/_git/<ado repository>`. | ||
* `oauth_token_id` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. | ||
* `github_app_installation_id` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. | ||
* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. | ||
* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. | ||
|
||
## Attributes Reference | ||
|
||
|
@@ -200,6 +246,7 @@ The `vcs_repo` block supports: | |
* `name` - The name of registry module. | ||
* `organization` - The name of the organization associated with the registry module. | ||
* `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. | ||
* `publishing_mechanism` - The publishing mechanism used when releasing new versions of the module. | ||
* `registry_name` - The registry name of the registry module depicting whether the registry module is private or public. | ||
* `no_code` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. | ||
Use the tfe_no_code_module resource instead. | ||
|
@@ -218,4 +265,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov | |
terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.19.0 input-d0184f94e79f432f50dea11aef3a9b7449006807fb197c05220e48a2f1f3f71e --> | ||
<!-- cache-key: cdktf-0.19.0 input-456a79854887a1ea146b73701b97c25121ac10198e434b748c3268fc7de9d53f --> |
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 |
---|---|---|
|
@@ -52,6 +52,51 @@ class MyConvertedCode extends TerraformStack { | |
|
||
``` | ||
|
||
Create private registry module with tests enabled: | ||
|
||
```typescript | ||
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug | ||
import { Construct } from "constructs"; | ||
import { TerraformStack } from "cdktf"; | ||
/* | ||
* Provider bindings are generated by running `cdktf get`. | ||
* See https://cdk.tf/provider-generation for more details. | ||
*/ | ||
import { OauthClient } from "./.gen/providers/tfe/oauth-client"; | ||
import { Organization } from "./.gen/providers/tfe/organization"; | ||
import { RegistryModule } from "./.gen/providers/tfe/registry-module"; | ||
class MyConvertedCode extends TerraformStack { | ||
constructor(scope: Construct, name: string) { | ||
super(scope, name); | ||
const testOrganization = new Organization(this, "test-organization", { | ||
email: "[email protected]", | ||
name: "my-org-name", | ||
}); | ||
const testOauthClient = new OauthClient(this, "test-oauth-client", { | ||
apiUrl: "https://api.github.com", | ||
httpUrl: "https://github.com", | ||
oauthToken: "my-vcs-provider-token", | ||
organization: testOrganization.name, | ||
serviceProvider: "github", | ||
}); | ||
new RegistryModule(this, "test-registry-module", { | ||
test_config: [ | ||
{ | ||
tests_enabled: true, | ||
}, | ||
], | ||
vcsRepo: { | ||
branch: "main", | ||
displayIdentifier: "my-org-name/terraform-provider-name", | ||
identifier: "my-org-name/terraform-provider-name", | ||
oauthTokenId: testOauthClient.oauthTokenId, | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
``` | ||
|
||
Create private registry module with GitHub App: | ||
|
||
```typescript | ||
|
@@ -205,6 +250,9 @@ The following arguments are supported: | |
* `namespace` - (Optional) The namespace of a public registry module. It can be used if `module_provider` is set and `registry_name` is public. | ||
* `registryName` - (Optional) Whether the registry module is private or public. It can be used if `module_provider` is set. | ||
|
||
The `testConfig` block supports | ||
* `testsEnabled` - (Optional) Specifies whether tests run for the registry module. Tests are only supported for branch-based publishing. | ||
|
||
The `vcsRepo` block supports: | ||
|
||
* `displayIdentifier` - (Required) The display identifier for your VCS repository. | ||
|
@@ -215,6 +263,8 @@ The `vcsRepo` block supports: | |
and repository in your VCS provider. The format for Azure DevOps is `<ado organization>/<ado project>/_git/<ado repository>`. | ||
* `oauthTokenId` - (Optional) Token ID of the VCS Connection (OAuth Connection Token) to use. This conflicts with `github_app_installation_id` and can only be used if `github_app_installation_id` is not used. | ||
* `githubAppInstallationId` - (Optional) The installation id of the Github App. This conflicts with `oauth_token_id` and can only be used if `oauth_token_id` is not used. | ||
* `branch` - (Optional) The git branch used for publishing when using branch-based publishing for the registry module. When a `branch` is set, `tags` will be returned as `false`. | ||
* `tags` - (Optional) Specifies whether tag based publishing is enabled for the registry module. When `tags` is set to `true`, the `branch` must be set to an empty value. | ||
|
||
## Attributes Reference | ||
|
||
|
@@ -223,6 +273,7 @@ The `vcsRepo` block supports: | |
* `name` - The name of registry module. | ||
* `organization` - The name of the organization associated with the registry module. | ||
* `namespace` - The namespace of the module. For private modules this is the name of the organization that owns the module. | ||
* `publishingMechanism` - The publishing mechanism used when releasing new versions of the module. | ||
* `registryName` - The registry name of the registry module depicting whether the registry module is private or public. | ||
* `noCode` - **Deprecated** The property that will enable or disable a module as no-code provisioning ready. | ||
Use the tfe_no_code_module resource instead. | ||
|
@@ -241,4 +292,4 @@ terraform import tfe_registry_module.test my-org-name/public/namespace/name/prov | |
terraform import tfe_registry_module.test my-org-name/name/provider/mod-qV9JnKRkmtMa4zcA | ||
``` | ||
|
||
<!-- cache-key: cdktf-0.19.0 input-d0184f94e79f432f50dea11aef3a9b7449006807fb197c05220e48a2f1f3f71e --> | ||
<!-- cache-key: cdktf-0.19.0 input-456a79854887a1ea146b73701b97c25121ac10198e434b748c3268fc7de9d53f --> |