1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. getS3BucketObject
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.getS3BucketObject

Explore with Pulumi AI

flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

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 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",
});
Copy
import pulumi
import pulumi_flexibleengine as flexibleengine

s3_bucket_object = flexibleengine.get_s3_bucket_object(bucket="my-test-bucket",
    key="hello-world.zip")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  s3BucketObject:
    fn::invoke:
      function: flexibleengine:getS3BucketObject
      arguments:
        bucket: my-test-bucket
        key: hello-world.zip
Copy

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>
Copy
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]
Copy
func LookupS3BucketObject(ctx *Context, args *LookupS3BucketObjectArgs, opts ...InvokeOption) (*LookupS3BucketObjectResult, error)
func LookupS3BucketObjectOutput(ctx *Context, args *LookupS3BucketObjectOutputArgs, opts ...InvokeOption) LookupS3BucketObjectResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetS3BucketObjectResult> getS3BucketObject(GetS3BucketObjectArgs args, InvokeOptions options)
public static Output<GetS3BucketObjectResult> getS3BucketObject(GetS3BucketObjectArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: flexibleengine:index/getS3BucketObject:getS3BucketObject
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Bucket This property is required. string
The name of the bucket to read the object from.
Key This property is required. 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.
VersionId string
Specific version ID of the object returned (defaults to latest version).
Bucket This property is required. string
The name of the bucket to read the object from.
Key This property is required. 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.
VersionId string
Specific version ID of the object returned (defaults to latest version).
bucket This property is required. String
The name of the bucket to read the object from.
key This property is required. 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.
versionId String
Specific version ID of the object returned (defaults to latest version).
bucket This property is required. string
The name of the bucket to read the object from.
key This property is required. 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.
versionId string
Specific version ID of the object returned (defaults to latest version).
bucket This property is required. str
The name of the bucket to read the object from.
key This property is required. 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 This property is required. String
The name of the bucket to read the object from.
key This property is required. 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.
versionId 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
CacheControl string
Specifies caching behavior along the request/reply chain.
ContentDisposition string
Specifies presentational information for the object.
ContentEncoding 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.
ContentLanguage string
The language the content is in.
ContentLength double
Size of the body in bytes.
ContentType 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
LastModified 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.
ServerSideEncryption string
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.
SseKmsKeyId string
If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
VersionId string
WebsiteRedirectLocation string
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
CacheControl string
Specifies caching behavior along the request/reply chain.
ContentDisposition string
Specifies presentational information for the object.
ContentEncoding 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.
ContentLanguage string
The language the content is in.
ContentLength float64
Size of the body in bytes.
ContentType 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
LastModified 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.
ServerSideEncryption string
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.
SseKmsKeyId string
If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
VersionId string
WebsiteRedirectLocation string
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
cacheControl String
Specifies caching behavior along the request/reply chain.
contentDisposition String
Specifies presentational information for the object.
contentEncoding 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.
contentLanguage String
The language the content is in.
contentLength Double
Size of the body in bytes.
contentType 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
lastModified 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.
serverSideEncryption String
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.
sseKmsKeyId String
If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
versionId String
websiteRedirectLocation String
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
cacheControl string
Specifies caching behavior along the request/reply chain.
contentDisposition string
Specifies presentational information for the object.
contentEncoding 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.
contentLanguage string
The language the content is in.
contentLength number
Size of the body in bytes.
contentType 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
lastModified 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.
serverSideEncryption string
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.
sseKmsKeyId string
If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
versionId string
websiteRedirectLocation string
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_encryption str
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_key_id str
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_location str
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
cacheControl String
Specifies caching behavior along the request/reply chain.
contentDisposition String
Specifies presentational information for the object.
contentEncoding 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.
contentLanguage String
The language the content is in.
contentLength Number
Size of the body in bytes.
contentType 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
lastModified 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.
serverSideEncryption String
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.
sseKmsKeyId String
If present, specifies the ID of the Key Management Service (KMS) master encryption key that was used for the object.
versionId String
websiteRedirectLocation String
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 flexibleengine Terraform Provider.
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud