flexibleengine.getS3BucketObject
Explore with Pulumi AI
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 (
bodyfield) is available only for objects which have a human-readableContent-Type(text/*andapplication/json). This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const s3BucketObject = flexibleengine.getS3BucketObject({
    bucket: "my-test-bucket",
    key: "hello-world.zip",
});
import pulumi
import pulumi_flexibleengine as flexibleengine
s3_bucket_object = flexibleengine.get_s3_bucket_object(bucket="my-test-bucket",
    key="hello-world.zip")
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := flexibleengine.LookupS3BucketObject(ctx, &flexibleengine.LookupS3BucketObjectArgs{
			Bucket: "my-test-bucket",
			Key:    "hello-world.zip",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() => 
{
    var s3BucketObject = Flexibleengine.GetS3BucketObject.Invoke(new()
    {
        Bucket = "my-test-bucket",
        Key = "hello-world.zip",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.FlexibleengineFunctions;
import com.pulumi.flexibleengine.inputs.GetS3BucketObjectArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var s3BucketObject = FlexibleengineFunctions.getS3BucketObject(GetS3BucketObjectArgs.builder()
            .bucket("my-test-bucket")
            .key("hello-world.zip")
            .build());
    }
}
variables:
  s3BucketObject:
    fn::invoke:
      function: flexibleengine:getS3BucketObject
      arguments:
        bucket: my-test-bucket
        key: hello-world.zip
Using getS3BucketObject
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getS3BucketObject(args: GetS3BucketObjectArgs, opts?: InvokeOptions): Promise<GetS3BucketObjectResult>
function getS3BucketObjectOutput(args: GetS3BucketObjectOutputArgs, opts?: InvokeOptions): Output<GetS3BucketObjectResult>def get_s3_bucket_object(bucket: Optional[str] = None,
                         id: Optional[str] = None,
                         key: Optional[str] = None,
                         range: Optional[str] = None,
                         version_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetS3BucketObjectResult
def get_s3_bucket_object_output(bucket: Optional[pulumi.Input[str]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         key: Optional[pulumi.Input[str]] = None,
                         range: Optional[pulumi.Input[str]] = None,
                         version_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetS3BucketObjectResult]func LookupS3BucketObject(ctx *Context, args *LookupS3BucketObjectArgs, opts ...InvokeOption) (*LookupS3BucketObjectResult, error)
func LookupS3BucketObjectOutput(ctx *Context, args *LookupS3BucketObjectOutputArgs, opts ...InvokeOption) LookupS3BucketObjectResultOutput> Note: This function is named LookupS3BucketObject in the Go SDK.
public static class GetS3BucketObject 
{
    public static Task<GetS3BucketObjectResult> InvokeAsync(GetS3BucketObjectArgs args, InvokeOptions? opts = null)
    public static Output<GetS3BucketObjectResult> Invoke(GetS3BucketObjectInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetS3BucketObjectResult> getS3BucketObject(GetS3BucketObjectArgs args, InvokeOptions options)
public static Output<GetS3BucketObjectResult> getS3BucketObject(GetS3BucketObjectArgs args, InvokeOptions options)
fn::invoke:
  function: flexibleengine:index/getS3BucketObject:getS3BucketObject
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Bucket string
 - The name of the bucket to read the object from.
 - Key string
 - The full path to the object inside the bucket.
 - Id string
 - Range string
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - Version
Id string - Specific version ID of the object returned (defaults to latest version).
 
- Bucket string
 - The name of the bucket to read the object from.
 - Key string
 - The full path to the object inside the bucket.
 - Id string
 - Range string
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - Version
Id string - Specific version ID of the object returned (defaults to latest version).
 
- bucket String
 - The name of the bucket to read the object from.
 - key String
 - The full path to the object inside the bucket.
 - id String
 - range String
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - version
Id String - Specific version ID of the object returned (defaults to latest version).
 
- bucket string
 - The name of the bucket to read the object from.
 - key string
 - The full path to the object inside the bucket.
 - id string
 - range string
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - version
Id string - Specific version ID of the object returned (defaults to latest version).
 
- bucket str
 - The name of the bucket to read the object from.
 - key str
 - The full path to the object inside the bucket.
 - id str
 - range str
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - version_
id str - Specific version ID of the object returned (defaults to latest version).
 
- bucket String
 - The name of the bucket to read the object from.
 - key String
 - The full path to the object inside the bucket.
 - id String
 - range String
 - Obtains the specified range bytes of an object. The value is a range starting from 0 to maximum object length minus one. If the range is invalid, all object data is returned.
 - version
Id String - Specific version ID of the object returned (defaults to latest version).
 
getS3BucketObject Result
The following output properties are available:
- Body string
 - Object data (see limitations above to understand cases in which this field is actually available).
 - Bucket string
 - Cache
Control string - Specifies caching behavior along the request/reply chain.
 - Content
Disposition string - Specifies presentational information for the object.
 - Content
Encoding string - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - Content
Language string - The language the content is in.
 - Content
Length double - Size of the body in bytes.
 - Content
Type string - A standard MIME type describing the format of the object data.
 - Etag string
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - Expiration string
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - Expires string
 - The date and time at which the object is no longer cacheable.
 - Id string
 - Key string
 - Last
Modified string - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - Metadata Dictionary<string, string>
 - A map of metadata stored with the object in S3.
 - Server
Side stringEncryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - Sse
Kms stringKey Id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - Version
Id string - Website
Redirect stringLocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - Range string
 
- Body string
 - Object data (see limitations above to understand cases in which this field is actually available).
 - Bucket string
 - Cache
Control string - Specifies caching behavior along the request/reply chain.
 - Content
Disposition string - Specifies presentational information for the object.
 - Content
Encoding string - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - Content
Language string - The language the content is in.
 - Content
Length float64 - Size of the body in bytes.
 - Content
Type string - A standard MIME type describing the format of the object data.
 - Etag string
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - Expiration string
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - Expires string
 - The date and time at which the object is no longer cacheable.
 - Id string
 - Key string
 - Last
Modified string - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - Metadata map[string]string
 - A map of metadata stored with the object in S3.
 - Server
Side stringEncryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - Sse
Kms stringKey Id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - Version
Id string - Website
Redirect stringLocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - Range string
 
- body String
 - Object data (see limitations above to understand cases in which this field is actually available).
 - bucket String
 - cache
Control String - Specifies caching behavior along the request/reply chain.
 - content
Disposition String - Specifies presentational information for the object.
 - content
Encoding String - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - content
Language String - The language the content is in.
 - content
Length Double - Size of the body in bytes.
 - content
Type String - A standard MIME type describing the format of the object data.
 - etag String
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - expiration String
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - expires String
 - The date and time at which the object is no longer cacheable.
 - id String
 - key String
 - last
Modified String - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - metadata Map<String,String>
 - A map of metadata stored with the object in S3.
 - server
Side StringEncryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - sse
Kms StringKey Id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - version
Id String - website
Redirect StringLocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - range String
 
- body string
 - Object data (see limitations above to understand cases in which this field is actually available).
 - bucket string
 - cache
Control string - Specifies caching behavior along the request/reply chain.
 - content
Disposition string - Specifies presentational information for the object.
 - content
Encoding string - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - content
Language string - The language the content is in.
 - content
Length number - Size of the body in bytes.
 - content
Type string - A standard MIME type describing the format of the object data.
 - etag string
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - expiration string
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - expires string
 - The date and time at which the object is no longer cacheable.
 - id string
 - key string
 - last
Modified string - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - metadata {[key: string]: string}
 - A map of metadata stored with the object in S3.
 - server
Side stringEncryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - sse
Kms stringKey Id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - version
Id string - website
Redirect stringLocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - range string
 
- body str
 - Object data (see limitations above to understand cases in which this field is actually available).
 - bucket str
 - cache_
control str - Specifies caching behavior along the request/reply chain.
 - content_
disposition str - Specifies presentational information for the object.
 - content_
encoding str - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - content_
language str - The language the content is in.
 - content_
length float - Size of the body in bytes.
 - content_
type str - A standard MIME type describing the format of the object data.
 - etag str
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - expiration str
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - expires str
 - The date and time at which the object is no longer cacheable.
 - id str
 - key str
 - last_
modified str - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - metadata Mapping[str, str]
 - A map of metadata stored with the object in S3.
 - server_
side_ strencryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - sse_
kms_ strkey_ id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - version_
id str - website_
redirect_ strlocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - range str
 
- body String
 - Object data (see limitations above to understand cases in which this field is actually available).
 - bucket String
 - cache
Control String - Specifies caching behavior along the request/reply chain.
 - content
Disposition String - Specifies presentational information for the object.
 - content
Encoding String - Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
 - content
Language String - The language the content is in.
 - content
Length Number - Size of the body in bytes.
 - content
Type String - A standard MIME type describing the format of the object data.
 - etag String
 - ETag generated for the object (an MD5 sum of the object content in case it's not encrypted).
 - expiration String
 - If the object expiration is configured, the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
 - expires String
 - The date and time at which the object is no longer cacheable.
 - id String
 - key String
 - last
Modified String - Last modified date of the object in RFC1123 format (e.g. 
Mon, 02 Jan 2006 15:04:05 MST). - metadata Map<String>
 - A map of metadata stored with the object in S3.
 - server
Side StringEncryption  - If the object is stored using server-side encryption (KMS or Amazon S3-managed encryption key), this field includes the chosen encryption and algorithm used.
 - sse
Kms StringKey Id  - If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
 - version
Id String - website
Redirect StringLocation  - If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. S3 stores the value of this header in the object metadata.
 - range String
 
Package Details
- Repository
 - flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
 - License
 - Notes
 - This Pulumi package is based on the 
flexibleengineTerraform Provider.