--- layout: "aws" page_title: "AWS: aws_s3_bucket_object" sidebar_current: "docs-aws-datasource-s3-bucket-object" description: |- Provides metadata and optionally content of an S3 object --- # aws\_s3\_bucket\_object The S3 object data source allows access to the metadata and _optionally_ (see below) content of an object stored inside S3 bucket. ~> **Note:** The content of an object (`body` field) is available only for objects which have a human-readable `Content-Type` (`text/*` and `application/json`). This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favour of metadata. ## Example Usage ```hcl data "aws_s3_bucket_object" "lambda" { bucket = "my-lambda-functions" key = "hello-world.zip" } resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" assume_role_policy = <