Difference between revisions of "Terraform resource: aws s3 object"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
[[aws_s3_object]] | [[aws_s3_object]] | ||
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object | * https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object | ||
+ | |||
+ | == Official example == | ||
+ | resource "aws_s3_object" "object" { | ||
+ | bucket = "your_bucket_name" | ||
+ | key = "new_object_key" | ||
+ | source = "path/to/file" | ||
+ | |||
+ | # The filemd5() function is available in Terraform 0.11.12 and later | ||
+ | # For Terraform 0.11.11 and earlier, use the md5() function and the file() function: | ||
+ | # etag = "${md5(file("path/to/file"))}" | ||
+ | [[etag]] = [[filemd5]]("path/to/file") | ||
+ | } | ||
== See also == | == See also == |
Revision as of 09:34, 4 January 2024
aws_s3_object
Official example
resource "aws_s3_object" "object" { bucket = "your_bucket_name" key = "new_object_key" source = "path/to/file"
# The filemd5() function is available in Terraform 0.11.12 and later # For Terraform 0.11.11 and earlier, use the md5() function and the file() function: # etag = "${md5(file("path/to/file"))}" etag = filemd5("path/to/file") }
See also
- Terraform S3 resources:
aws_s3_bucket, aws_s3_object, aws_s3_bucket_policy, aws_s3_bucket_acl, aws_s3_bucket_website_configuration, aws_s3_bucket cors_configuration, aws_s3_account_public_access_block
, Terraform module: s3-bucket,aws_s3_bucket_versioning, aws_s3_bucket_server_side_encryption_configuration, aws_s3_bucket_logging
Advertising: