|
1 | 1 | ---
|
2 |
| - |
3 |
| -<!-- Please do not edit this file, it is generated. --> |
4 |
| -# generated by https://github.com/hashicorp/terraform-plugin-docs |
5 | 2 | page_title: "archive_file Resource - terraform-provider-archive"
|
6 | 3 | subcategory: ""
|
7 | 4 | description: |-
|
8 |
| - NOTE: This resource is deprecated, use data source instead. |
| 5 | + Generates an archive from content, a file, or directory of files. |
9 | 6 | ---
|
10 | 7 |
|
11 |
| -# archive_file (Resource) |
12 |
| - |
13 |
| -**NOTE**: This resource is deprecated, use data source instead. |
14 | 8 |
|
| 9 | +<!-- Please do not edit this file, it is generated. --> |
| 10 | +# archive_file (Resource) |
15 | 11 |
|
| 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 | +``` |
16 | 92 |
|
17 | 93 | <!-- schema generated by tfplugindocs -->
|
18 | 94 | ## Schema
|
@@ -52,4 +128,4 @@ Required:
|
52 | 128 | - `content` (String) Add this content to the archive with `filename` as the filename.
|
53 | 129 | - `filename` (String) Set this as the filename when declaring a `source`.
|
54 | 130 |
|
55 |
| -<!-- cache-key: cdktf-0.20.8 input-7fe48dc31101cb76c685aed0cf23657f6683fb390d9633ac73c1b06d4d3bedca --> |
| 131 | +<!-- cache-key: cdktf-0.20.8 input-46508f720325fcf13d4a50acef1fde81a72282d7fe681248eae9aa7318fad025 --> |
0 commit comments