Skip to content

Commit 7cf8053

Browse files
authored
cdktf: update index.md,resources/file.md,data-sources/file.md (hashicorp#388)
1 parent 52fc728 commit 7cf8053

File tree

4 files changed

+163
-22
lines changed

4 files changed

+163
-22
lines changed

docs/cdktf/python/data-sources/file.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
page_title: "archive_file Data Source - terraform-provider-archive"
33
subcategory: ""
44
description: |-
5-
Generates an archive from content, a file, or directory of files.
5+
Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the archive_file resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context.
66
---
77

88

99
<!-- Please do not edit this file, it is generated. -->
1010
# archive_file (Data Source)
1111

12-
Generates an archive from content, a file, or directory of files.
12+
Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the `archive_file` resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context.
1313

1414
## Example Usage
1515

@@ -117,4 +117,4 @@ Required:
117117
- `content` (String) Add this content to the archive with `filename` as the filename.
118118
- `filename` (String) Set this as the filename when declaring a `source`.
119119

120-
<!-- cache-key: cdktf-0.20.8 input-e028531bc97a019f848b3e37c5dde395799324b83b8cd5ea78649ffc9177c542 -->
120+
<!-- cache-key: cdktf-0.20.8 input-58f16fa5c1a288eadc3103ca8daf35401729e7a632b0a84dc82a5c5d959b0602 -->

docs/cdktf/python/resources/file.md

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,83 @@
11
---
2-
3-
<!-- Please do not edit this file, it is generated. -->
4-
# generated by https://github.com/hashicorp/terraform-plugin-docs
52
page_title: "archive_file Resource - terraform-provider-archive"
63
subcategory: ""
74
description: |-
8-
NOTE: This resource is deprecated, use data source instead.
5+
Generates an archive from content, a file, or directory of files.
96
---
107

11-
# archive_file (Resource)
12-
13-
**NOTE**: This resource is deprecated, use data source instead.
148

9+
<!-- Please do not edit this file, it is generated. -->
10+
# archive_file (Resource)
1511

12+
Generates an archive from content, a file, or directory of files.
13+
14+
## Example Usage
15+
16+
```python
17+
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
18+
from constructs import Construct
19+
from cdktf import TerraformStack
20+
#
21+
# Provider bindings are generated by running `cdktf get`.
22+
# See https://cdk.tf/provider-generation for more details.
23+
#
24+
from imports.archive.file import File
25+
class MyConvertedCode(TerraformStack):
26+
def __init__(self, scope, name):
27+
super().__init__(scope, name)
28+
File(self, "init",
29+
output_path="${path.module}/files/init.zip",
30+
source_file="${path.module}/init.tpl",
31+
type="zip"
32+
)
33+
```
34+
35+
```python
36+
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
37+
from constructs import Construct
38+
from cdktf import Token, TerraformStack
39+
#
40+
# Provider bindings are generated by running `cdktf get`.
41+
# See https://cdk.tf/provider-generation for more details.
42+
#
43+
from imports.archive.file import File
44+
class MyConvertedCode(TerraformStack):
45+
def __init__(self, scope, name):
46+
super().__init__(scope, name)
47+
File(self, "dotfiles",
48+
excludes=["${path.module}/unwanted.zip"],
49+
output_path="${path.module}/files/dotfiles.zip",
50+
source=[FileSource(
51+
content=Token.as_string(vimrc.rendered),
52+
filename=".vimrc"
53+
), FileSource(
54+
content=Token.as_string(ssh_config.rendered),
55+
filename=".ssh/config"
56+
)
57+
],
58+
type="zip"
59+
)
60+
```
61+
62+
```python
63+
# DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
64+
from constructs import Construct
65+
from cdktf import TerraformStack
66+
#
67+
# Provider bindings are generated by running `cdktf get`.
68+
# See https://cdk.tf/provider-generation for more details.
69+
#
70+
from imports.archive.file import File
71+
class MyConvertedCode(TerraformStack):
72+
def __init__(self, scope, name):
73+
super().__init__(scope, name)
74+
File(self, "lambda_my_function",
75+
output_file_mode="0666",
76+
output_path="${path.module}/files/lambda-my-function.js.zip",
77+
source_file="${path.module}/../lambda/my-function/index.js",
78+
type="zip"
79+
)
80+
```
1681

1782
<!-- schema generated by tfplugindocs -->
1883
## Schema
@@ -52,4 +117,4 @@ Required:
52117
- `content` (String) Add this content to the archive with `filename` as the filename.
53118
- `filename` (String) Set this as the filename when declaring a `source`.
54119

55-
<!-- cache-key: cdktf-0.20.8 input-7fe48dc31101cb76c685aed0cf23657f6683fb390d9633ac73c1b06d4d3bedca -->
120+
<!-- cache-key: cdktf-0.20.8 input-46508f720325fcf13d4a50acef1fde81a72282d7fe681248eae9aa7318fad025 -->

docs/cdktf/typescript/data-sources/file.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
page_title: "archive_file Data Source - terraform-provider-archive"
33
subcategory: ""
44
description: |-
5-
Generates an archive from content, a file, or directory of files.
5+
Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the archive_file resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context.
66
---
77

88

99
<!-- Please do not edit this file, it is generated. -->
1010
# archive_file (Data Source)
1111

12-
Generates an archive from content, a file, or directory of files.
12+
Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the `archive_file` resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context.
1313

1414
## Example Usage
1515

@@ -128,4 +128,4 @@ Required:
128128
- `content` (String) Add this content to the archive with `filename` as the filename.
129129
- `filename` (String) Set this as the filename when declaring a `source`.
130130

131-
<!-- cache-key: cdktf-0.20.8 input-e028531bc97a019f848b3e37c5dde395799324b83b8cd5ea78649ffc9177c542 -->
131+
<!-- cache-key: cdktf-0.20.8 input-58f16fa5c1a288eadc3103ca8daf35401729e7a632b0a84dc82a5c5d959b0602 -->

docs/cdktf/typescript/resources/file.md

Lines changed: 84 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,94 @@
11
---
2-
3-
<!-- Please do not edit this file, it is generated. -->
4-
# generated by https://github.com/hashicorp/terraform-plugin-docs
52
page_title: "archive_file Resource - terraform-provider-archive"
63
subcategory: ""
74
description: |-
8-
NOTE: This resource is deprecated, use data source instead.
5+
Generates an archive from content, a file, or directory of files.
96
---
107

11-
# archive_file (Resource)
12-
13-
**NOTE**: This resource is deprecated, use data source instead.
148

9+
<!-- Please do not edit this file, it is generated. -->
10+
# archive_file (Resource)
1511

12+
Generates an archive from content, a file, or directory of files.
13+
14+
## Example Usage
15+
16+
```typescript
17+
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
18+
import { Construct } from "constructs";
19+
import { TerraformStack } from "cdktf";
20+
/*
21+
* Provider bindings are generated by running `cdktf get`.
22+
* See https://cdk.tf/provider-generation for more details.
23+
*/
24+
import { File } from "./.gen/providers/archive/file";
25+
class MyConvertedCode extends TerraformStack {
26+
constructor(scope: Construct, name: string) {
27+
super(scope, name);
28+
new File(this, "init", {
29+
outputPath: "${path.module}/files/init.zip",
30+
sourceFile: "${path.module}/init.tpl",
31+
type: "zip",
32+
});
33+
}
34+
}
35+
36+
```
37+
38+
```typescript
39+
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
40+
import { Construct } from "constructs";
41+
import { Token, TerraformStack } from "cdktf";
42+
/*
43+
* Provider bindings are generated by running `cdktf get`.
44+
* See https://cdk.tf/provider-generation for more details.
45+
*/
46+
import { File } from "./.gen/providers/archive/file";
47+
class MyConvertedCode extends TerraformStack {
48+
constructor(scope: Construct, name: string) {
49+
super(scope, name);
50+
new File(this, "dotfiles", {
51+
excludes: ["${path.module}/unwanted.zip"],
52+
outputPath: "${path.module}/files/dotfiles.zip",
53+
source: [
54+
{
55+
content: Token.asString(vimrc.rendered),
56+
filename: ".vimrc",
57+
},
58+
{
59+
content: Token.asString(sshConfig.rendered),
60+
filename: ".ssh/config",
61+
},
62+
],
63+
type: "zip",
64+
});
65+
}
66+
}
67+
68+
```
69+
70+
```typescript
71+
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
72+
import { Construct } from "constructs";
73+
import { TerraformStack } from "cdktf";
74+
/*
75+
* Provider bindings are generated by running `cdktf get`.
76+
* See https://cdk.tf/provider-generation for more details.
77+
*/
78+
import { File } from "./.gen/providers/archive/file";
79+
class MyConvertedCode extends TerraformStack {
80+
constructor(scope: Construct, name: string) {
81+
super(scope, name);
82+
new File(this, "lambda_my_function", {
83+
outputFileMode: "0666",
84+
outputPath: "${path.module}/files/lambda-my-function.js.zip",
85+
sourceFile: "${path.module}/../lambda/my-function/index.js",
86+
type: "zip",
87+
});
88+
}
89+
}
90+
91+
```
1692

1793
<!-- schema generated by tfplugindocs -->
1894
## Schema
@@ -52,4 +128,4 @@ Required:
52128
- `content` (String) Add this content to the archive with `filename` as the filename.
53129
- `filename` (String) Set this as the filename when declaring a `source`.
54130

55-
<!-- cache-key: cdktf-0.20.8 input-7fe48dc31101cb76c685aed0cf23657f6683fb390d9633ac73c1b06d4d3bedca -->
131+
<!-- cache-key: cdktf-0.20.8 input-46508f720325fcf13d4a50acef1fde81a72282d7fe681248eae9aa7318fad025 -->

0 commit comments

Comments
 (0)