Skip to content

Commit

Permalink
Add examples to README for usage of upload and saveFile endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishu Goel committed Jan 23, 2024
1 parent 1643fe1 commit c22211a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 10 deletions.
28 changes: 27 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# TODO
## Upload file to S3

```
resource "epilot-file_upload_file" "my_uploadfile" {
filename = "pumpkin.png"
mime_type = "image/png"
}
```

```
output "val" {
value = epilot-file_upload_file.my_uploadfile
}
```

## Save uploaded file

```
resource "epilot-file_file" "my_file" {
access_control = "private"
filename = epilot-file_upload_file.my_uploadfile.filename
bucket = epilot-file_upload_file.my_uploadfile.s3ref.bucket
key = epilot-file_upload_file.my_uploadfile.s3ref.key
}
```

8 changes: 4 additions & 4 deletions examples/resources/epilot-file_file/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "epilot-file_file" "my_file" {
access_control = "private"
filename = "blaaa.png"
bucket = "epilot-prod-user-content"
key = "66/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/nishu.png"
access_control = "private"
filename = epilot-file_upload_file.my_uploadfile.filename
bucket = epilot-file_upload_file.my_uploadfile.s3ref.bucket
key = epilot-file_upload_file.my_uploadfile.s3ref.key
}
2 changes: 1 addition & 1 deletion examples/resources/epilot-file_upload_file/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
epilot-file = {
source = "epilot-dev/epilot-file"
version = "2.0.2"
version = "2.1.1"
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions examples/resources/epilot-file_upload_file/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Upload file to S3
resource "epilot-file_upload_file" "my_uploadfile" {
file_entity_id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
filename = "document.pdf"
mime_type = "application/pdf"
}
filename = "pumpkin.png"
mime_type = "image/png"
}

output "val" {
value = epilot-file_upload_file.my_uploadfile
}


# Save uploaded file
resource "epilot-file_file" "my_file" {
access_control = "private"
filename = epilot-file_upload_file.my_uploadfile.filename
bucket = epilot-file_upload_file.my_uploadfile.s3ref.bucket
key = epilot-file_upload_file.my_uploadfile.s3ref.key
}


0 comments on commit c22211a

Please sign in to comment.