All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.s3.S3Functions Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.s3;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockPlainArgs;
import com.pulumi.aws.s3.inputs.GetBucketArgs;
import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
import com.pulumi.aws.s3.inputs.GetBucketObjectPlainArgs;
import com.pulumi.aws.s3.inputs.GetBucketObjectsArgs;
import com.pulumi.aws.s3.inputs.GetBucketObjectsPlainArgs;
import com.pulumi.aws.s3.inputs.GetBucketPlainArgs;
import com.pulumi.aws.s3.inputs.GetBucketPolicyArgs;
import com.pulumi.aws.s3.inputs.GetBucketPolicyPlainArgs;
import com.pulumi.aws.s3.inputs.GetObjectArgs;
import com.pulumi.aws.s3.inputs.GetObjectPlainArgs;
import com.pulumi.aws.s3.inputs.GetObjectsArgs;
import com.pulumi.aws.s3.inputs.GetObjectsPlainArgs;
import com.pulumi.aws.s3.outputs.GetAccountPublicAccessBlockResult;
import com.pulumi.aws.s3.outputs.GetBucketObjectResult;
import com.pulumi.aws.s3.outputs.GetBucketObjectsResult;
import com.pulumi.aws.s3.outputs.GetBucketPolicyResult;
import com.pulumi.aws.s3.outputs.GetBucketResult;
import com.pulumi.aws.s3.outputs.GetCanonicalUserIdResult;
import com.pulumi.aws.s3.outputs.GetDirectoryBucketsResult;
import com.pulumi.aws.s3.outputs.GetObjectResult;
import com.pulumi.aws.s3.outputs.GetObjectsResult;
import com.pulumi.core.Output;
import com.pulumi.core.TypeShape;
import com.pulumi.deployment.Deployment;
import com.pulumi.deployment.InvokeOptions;
import com.pulumi.resources.InvokeArgs;
import java.util.concurrent.CompletableFuture;

public final class S3Functions {
    /**
     * The S3 account public access block data source returns account-level public access block configuration.
     * 
     * ## Example Usage
     * 
     * <!--Start PulumiCodeChooser -->
     * 
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getAccountPublicAccessBlock() { return getAccountPublicAccessBlock(GetAccountPublicAccessBlockArgs.Empty, InvokeOptions.Empty); } /** * The S3 account public access block data source returns account-level public access block configuration. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getAccountPublicAccessBlockPlain() { return getAccountPublicAccessBlockPlain(GetAccountPublicAccessBlockPlainArgs.Empty, InvokeOptions.Empty); } /** * The S3 account public access block data source returns account-level public access block configuration. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getAccountPublicAccessBlock(GetAccountPublicAccessBlockArgs args) { return getAccountPublicAccessBlock(args, InvokeOptions.Empty); } /** * The S3 account public access block data source returns account-level public access block configuration. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getAccountPublicAccessBlockPlain(GetAccountPublicAccessBlockPlainArgs args) { return getAccountPublicAccessBlockPlain(args, InvokeOptions.Empty); } /** * The S3 account public access block data source returns account-level public access block configuration. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getAccountPublicAccessBlock(GetAccountPublicAccessBlockArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getAccountPublicAccessBlock:getAccountPublicAccessBlock", TypeShape.of(GetAccountPublicAccessBlockResult.class), args, Utilities.withVersion(options)); } /** * The S3 account public access block data source returns account-level public access block configuration. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
     * 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 example = S3Functions.getAccountPublicAccessBlock();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getAccountPublicAccessBlockPlain(GetAccountPublicAccessBlockPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getAccountPublicAccessBlock:getAccountPublicAccessBlock", TypeShape.of(GetAccountPublicAccessBlockResult.class), args, Utilities.withVersion(options)); } /** * Provides details about a specific S3 bucket. * * This resource may prove useful when setting up a Route53 record, or an origin for a CloudFront * Distribution. * * ## Example Usage * * ### Route53 Record * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.route53.Route53Functions;
     * import com.pulumi.aws.route53.inputs.GetZoneArgs;
     * import com.pulumi.aws.route53.Record;
     * import com.pulumi.aws.route53.RecordArgs;
     * import com.pulumi.aws.route53.inputs.RecordAliasArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("bucket.test.com")
     *             .build());
     * 
     *         final var testZone = Route53Functions.getZone(GetZoneArgs.builder()
     *             .name("test.com.")
     *             .build());
     * 
     *         var example = new Record("example", RecordArgs.builder()
     *             .zoneId(testZone.applyValue(getZoneResult -> getZoneResult.id()))
     *             .name("bucket")
     *             .type("A")
     *             .aliases(RecordAliasArgs.builder()
     *                 .name(selected.applyValue(getBucketResult -> getBucketResult.websiteDomain()))
     *                 .zoneId(selected.applyValue(getBucketResult -> getBucketResult.hostedZoneId()))
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * ### CloudFront Origin * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.cloudfront.Distribution;
     * import com.pulumi.aws.cloudfront.DistributionArgs;
     * import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("a-test-bucket")
     *             .build());
     * 
     *         var test = new Distribution("test", DistributionArgs.builder()
     *             .origins(DistributionOriginArgs.builder()
     *                 .domainName(selected.applyValue(getBucketResult -> getBucketResult.bucketDomainName()))
     *                 .originId("s3-selected-bucket")
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucket(GetBucketArgs args) { return getBucket(args, InvokeOptions.Empty); } /** * Provides details about a specific S3 bucket. * * This resource may prove useful when setting up a Route53 record, or an origin for a CloudFront * Distribution. * * ## Example Usage * * ### Route53 Record * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.route53.Route53Functions;
     * import com.pulumi.aws.route53.inputs.GetZoneArgs;
     * import com.pulumi.aws.route53.Record;
     * import com.pulumi.aws.route53.RecordArgs;
     * import com.pulumi.aws.route53.inputs.RecordAliasArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("bucket.test.com")
     *             .build());
     * 
     *         final var testZone = Route53Functions.getZone(GetZoneArgs.builder()
     *             .name("test.com.")
     *             .build());
     * 
     *         var example = new Record("example", RecordArgs.builder()
     *             .zoneId(testZone.applyValue(getZoneResult -> getZoneResult.id()))
     *             .name("bucket")
     *             .type("A")
     *             .aliases(RecordAliasArgs.builder()
     *                 .name(selected.applyValue(getBucketResult -> getBucketResult.websiteDomain()))
     *                 .zoneId(selected.applyValue(getBucketResult -> getBucketResult.hostedZoneId()))
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * ### CloudFront Origin * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.cloudfront.Distribution;
     * import com.pulumi.aws.cloudfront.DistributionArgs;
     * import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("a-test-bucket")
     *             .build());
     * 
     *         var test = new Distribution("test", DistributionArgs.builder()
     *             .origins(DistributionOriginArgs.builder()
     *                 .domainName(selected.applyValue(getBucketResult -> getBucketResult.bucketDomainName()))
     *                 .originId("s3-selected-bucket")
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketPlain(GetBucketPlainArgs args) { return getBucketPlain(args, InvokeOptions.Empty); } /** * Provides details about a specific S3 bucket. * * This resource may prove useful when setting up a Route53 record, or an origin for a CloudFront * Distribution. * * ## Example Usage * * ### Route53 Record * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.route53.Route53Functions;
     * import com.pulumi.aws.route53.inputs.GetZoneArgs;
     * import com.pulumi.aws.route53.Record;
     * import com.pulumi.aws.route53.RecordArgs;
     * import com.pulumi.aws.route53.inputs.RecordAliasArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("bucket.test.com")
     *             .build());
     * 
     *         final var testZone = Route53Functions.getZone(GetZoneArgs.builder()
     *             .name("test.com.")
     *             .build());
     * 
     *         var example = new Record("example", RecordArgs.builder()
     *             .zoneId(testZone.applyValue(getZoneResult -> getZoneResult.id()))
     *             .name("bucket")
     *             .type("A")
     *             .aliases(RecordAliasArgs.builder()
     *                 .name(selected.applyValue(getBucketResult -> getBucketResult.websiteDomain()))
     *                 .zoneId(selected.applyValue(getBucketResult -> getBucketResult.hostedZoneId()))
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * ### CloudFront Origin * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.cloudfront.Distribution;
     * import com.pulumi.aws.cloudfront.DistributionArgs;
     * import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("a-test-bucket")
     *             .build());
     * 
     *         var test = new Distribution("test", DistributionArgs.builder()
     *             .origins(DistributionOriginArgs.builder()
     *                 .domainName(selected.applyValue(getBucketResult -> getBucketResult.bucketDomainName()))
     *                 .originId("s3-selected-bucket")
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucket(GetBucketArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getBucket:getBucket", TypeShape.of(GetBucketResult.class), args, Utilities.withVersion(options)); } /** * Provides details about a specific S3 bucket. * * This resource may prove useful when setting up a Route53 record, or an origin for a CloudFront * Distribution. * * ## Example Usage * * ### Route53 Record * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.route53.Route53Functions;
     * import com.pulumi.aws.route53.inputs.GetZoneArgs;
     * import com.pulumi.aws.route53.Record;
     * import com.pulumi.aws.route53.RecordArgs;
     * import com.pulumi.aws.route53.inputs.RecordAliasArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("bucket.test.com")
     *             .build());
     * 
     *         final var testZone = Route53Functions.getZone(GetZoneArgs.builder()
     *             .name("test.com.")
     *             .build());
     * 
     *         var example = new Record("example", RecordArgs.builder()
     *             .zoneId(testZone.applyValue(getZoneResult -> getZoneResult.id()))
     *             .name("bucket")
     *             .type("A")
     *             .aliases(RecordAliasArgs.builder()
     *                 .name(selected.applyValue(getBucketResult -> getBucketResult.websiteDomain()))
     *                 .zoneId(selected.applyValue(getBucketResult -> getBucketResult.hostedZoneId()))
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * ### CloudFront Origin * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketArgs;
     * import com.pulumi.aws.cloudfront.Distribution;
     * import com.pulumi.aws.cloudfront.DistributionArgs;
     * import com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs;
     * 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 selected = S3Functions.getBucket(GetBucketArgs.builder()
     *             .bucket("a-test-bucket")
     *             .build());
     * 
     *         var test = new Distribution("test", DistributionArgs.builder()
     *             .origins(DistributionOriginArgs.builder()
     *                 .domainName(selected.applyValue(getBucketResult -> getBucketResult.bucketDomainName()))
     *                 .originId("s3-selected-bucket")
     *                 .build())
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketPlain(GetBucketPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getBucket:getBucket", TypeShape.of(GetBucketResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE:** The `aws.s3.BucketObject` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.BucketObjectv2` instead, where new features and fixes will be added. * * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getBucketObjectResult -> getBucketObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.id()))
     *             .s3Key(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucketObject(GetBucketObjectArgs args) { return getBucketObject(args, InvokeOptions.Empty); } /** * > **NOTE:** The `aws.s3.BucketObject` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.BucketObjectv2` instead, where new features and fixes will be added. * * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getBucketObjectResult -> getBucketObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.id()))
     *             .s3Key(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketObjectPlain(GetBucketObjectPlainArgs args) { return getBucketObjectPlain(args, InvokeOptions.Empty); } /** * > **NOTE:** The `aws.s3.BucketObject` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.BucketObjectv2` instead, where new features and fixes will be added. * * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getBucketObjectResult -> getBucketObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.id()))
     *             .s3Key(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucketObject(GetBucketObjectArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getBucketObject:getBucketObject", TypeShape.of(GetBucketObjectResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE:** The `aws.s3.BucketObject` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.BucketObjectv2` instead, where new features and fixes will be added. * * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getBucketObjectResult -> getBucketObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getBucketObject(GetBucketObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.id()))
     *             .s3Key(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getBucketObjectResult -> getBucketObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketObjectPlain(GetBucketObjectPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getBucketObject:getBucketObject", TypeShape.of(GetBucketObjectResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE:** The `aws.s3.getBucketObjects` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.getObjects` instead, where new features and fixes will be added. * * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect this provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static Output getBucketObjects(GetBucketObjectsArgs args) { return getBucketObjects(args, InvokeOptions.Empty); } /** * > **NOTE:** The `aws.s3.getBucketObjects` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.getObjects` instead, where new features and fixes will be added. * * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect this provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static CompletableFuture getBucketObjectsPlain(GetBucketObjectsPlainArgs args) { return getBucketObjectsPlain(args, InvokeOptions.Empty); } /** * > **NOTE:** The `aws.s3.getBucketObjects` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.getObjects` instead, where new features and fixes will be added. * * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect this provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static Output getBucketObjects(GetBucketObjectsArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getBucketObjects:getBucketObjects", TypeShape.of(GetBucketObjectsResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE:** The `aws.s3.getBucketObjects` data source is DEPRECATED and will be removed in a future version! Use `aws.s3.getObjects` instead, where new features and fixes will be added. * * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect this provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static CompletableFuture getBucketObjectsPlain(GetBucketObjectsPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getBucketObjects:getBucketObjects", TypeShape.of(GetBucketObjectsResult.class), args, Utilities.withVersion(options)); } /** * The bucket policy data source returns IAM policy of an S3 bucket. * * ## Example Usage * * The following example retrieves IAM policy of a specified S3 bucket. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketPolicyArgs;
     * 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 example = S3Functions.getBucketPolicy(GetBucketPolicyArgs.builder()
     *             .bucket("example-bucket-name")
     *             .build());
     * 
     *         ctx.export("foo", example.applyValue(getBucketPolicyResult -> getBucketPolicyResult.policy()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucketPolicy(GetBucketPolicyArgs args) { return getBucketPolicy(args, InvokeOptions.Empty); } /** * The bucket policy data source returns IAM policy of an S3 bucket. * * ## Example Usage * * The following example retrieves IAM policy of a specified S3 bucket. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketPolicyArgs;
     * 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 example = S3Functions.getBucketPolicy(GetBucketPolicyArgs.builder()
     *             .bucket("example-bucket-name")
     *             .build());
     * 
     *         ctx.export("foo", example.applyValue(getBucketPolicyResult -> getBucketPolicyResult.policy()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketPolicyPlain(GetBucketPolicyPlainArgs args) { return getBucketPolicyPlain(args, InvokeOptions.Empty); } /** * The bucket policy data source returns IAM policy of an S3 bucket. * * ## Example Usage * * The following example retrieves IAM policy of a specified S3 bucket. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketPolicyArgs;
     * 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 example = S3Functions.getBucketPolicy(GetBucketPolicyArgs.builder()
     *             .bucket("example-bucket-name")
     *             .build());
     * 
     *         ctx.export("foo", example.applyValue(getBucketPolicyResult -> getBucketPolicyResult.policy()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getBucketPolicy(GetBucketPolicyArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getBucketPolicy:getBucketPolicy", TypeShape.of(GetBucketPolicyResult.class), args, Utilities.withVersion(options)); } /** * The bucket policy data source returns IAM policy of an S3 bucket. * * ## Example Usage * * The following example retrieves IAM policy of a specified S3 bucket. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetBucketPolicyArgs;
     * 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 example = S3Functions.getBucketPolicy(GetBucketPolicyArgs.builder()
     *             .bucket("example-bucket-name")
     *             .build());
     * 
     *         ctx.export("foo", example.applyValue(getBucketPolicyResult -> getBucketPolicyResult.policy()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getBucketPolicyPlain(GetBucketPolicyPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getBucketPolicy:getBucketPolicy", TypeShape.of(GetBucketPolicyResult.class), args, Utilities.withVersion(options)); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getCanonicalUserId() { return getCanonicalUserId(InvokeArgs.Empty, InvokeOptions.Empty); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getCanonicalUserIdPlain() { return getCanonicalUserIdPlain(InvokeArgs.Empty, InvokeOptions.Empty); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getCanonicalUserId(InvokeArgs args) { return getCanonicalUserId(args, InvokeOptions.Empty); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getCanonicalUserIdPlain(InvokeArgs args) { return getCanonicalUserIdPlain(args, InvokeOptions.Empty); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getCanonicalUserId(InvokeArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getCanonicalUserId:getCanonicalUserId", TypeShape.of(GetCanonicalUserIdResult.class), args, Utilities.withVersion(options)); } /** * The Canonical User ID data source allows access to the [canonical user ID](http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) * for the effective account in which this provider is working. * * > **NOTE:** To use this data source, you must have the `s3:ListAllMyBuckets` permission. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 current = S3Functions.getCanonicalUserId();
     * 
     *         ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getCanonicalUserIdPlain(InvokeArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getCanonicalUserId:getCanonicalUserId", TypeShape.of(GetCanonicalUserIdResult.class), args, Utilities.withVersion(options)); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getDirectoryBuckets() { return getDirectoryBuckets(InvokeArgs.Empty, InvokeOptions.Empty); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getDirectoryBucketsPlain() { return getDirectoryBucketsPlain(InvokeArgs.Empty, InvokeOptions.Empty); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getDirectoryBuckets(InvokeArgs args) { return getDirectoryBuckets(args, InvokeOptions.Empty); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getDirectoryBucketsPlain(InvokeArgs args) { return getDirectoryBucketsPlain(args, InvokeOptions.Empty); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getDirectoryBuckets(InvokeArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getDirectoryBuckets:getDirectoryBuckets", TypeShape.of(GetDirectoryBucketsResult.class), args, Utilities.withVersion(options)); } /** * Lists Amazon S3 Express directory buckets. * * ## Example Usage * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * 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 example = S3Functions.getDirectoryBuckets();
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getDirectoryBucketsPlain(InvokeArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getDirectoryBuckets:getDirectoryBuckets", TypeShape.of(GetDirectoryBucketsResult.class), args, Utilities.withVersion(options)); } /** * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getObjectResult -> getObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getObjectResult -> getObjectResult.bucket()))
     *             .s3Key(lambda.applyValue(getObjectResult -> getObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getObjectResult -> getObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getObject(GetObjectArgs args) { return getObject(args, InvokeOptions.Empty); } /** * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getObjectResult -> getObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getObjectResult -> getObjectResult.bucket()))
     *             .s3Key(lambda.applyValue(getObjectResult -> getObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getObjectResult -> getObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getObjectPlain(GetObjectPlainArgs args) { return getObjectPlain(args, InvokeOptions.Empty); } /** * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getObjectResult -> getObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getObjectResult -> getObjectResult.bucket()))
     *             .s3Key(lambda.applyValue(getObjectResult -> getObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getObjectResult -> getObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static Output getObject(GetObjectArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getObject:getObject", TypeShape.of(GetObjectResult.class), args, Utilities.withVersion(options)); } /** * 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/*` * * `application/json` * * `application/ld+json` * * `application/x-httpd-php` * * `application/xhtml+xml` * * `application/x-csh` * * `application/x-sh` * * `application/xml` * * `application/atom+xml` * * `application/x-sql` * * 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 * * The following example retrieves a text object (which must have a `Content-Type` * value starting with `text/`) and uses it as the `user_data` for an EC2 instance: * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.ec2.Instance;
     * import com.pulumi.aws.ec2.InstanceArgs;
     * 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 bootstrapScript = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-deploy-config")
     *             .key("ec2-bootstrap-script.sh")
     *             .build());
     * 
     *         var example = new Instance("example", InstanceArgs.builder()
     *             .instanceType("t2.micro")
     *             .ami("ami-2757f631")
     *             .userData(bootstrapScript.applyValue(getObjectResult -> getObjectResult.body()))
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * * The following, more-complex example retrieves only the metadata for a zip * file stored in S3, which is then used to pass the most recent `version_id` * to AWS Lambda for use as a function implementation. More information about * Lambda functions is available in the documentation for * `aws.lambda.Function`. * * <!--Start PulumiCodeChooser --> *
     * {@code
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.aws.s3.S3Functions;
     * import com.pulumi.aws.s3.inputs.GetObjectArgs;
     * import com.pulumi.aws.lambda.Function;
     * import com.pulumi.aws.lambda.FunctionArgs;
     * 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 lambda = S3Functions.getObject(GetObjectArgs.builder()
     *             .bucket("ourcorp-lambda-functions")
     *             .key("hello-world.zip")
     *             .build());
     * 
     *         var testLambda = new Function("testLambda", FunctionArgs.builder()
     *             .s3Bucket(lambda.applyValue(getObjectResult -> getObjectResult.bucket()))
     *             .s3Key(lambda.applyValue(getObjectResult -> getObjectResult.key()))
     *             .s3ObjectVersion(lambda.applyValue(getObjectResult -> getObjectResult.versionId()))
     *             .name("lambda_function_name")
     *             .role(iamForLambda.arn())
     *             .handler("exports.test")
     *             .build());
     * 
     *     }
     * }
     * }
     * 
* <!--End PulumiCodeChooser --> * */ public static CompletableFuture getObjectPlain(GetObjectPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getObject:getObject", TypeShape.of(GetObjectResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect the provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static Output getObjects(GetObjectsArgs args) { return getObjects(args, InvokeOptions.Empty); } /** * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect the provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static CompletableFuture getObjectsPlain(GetObjectsPlainArgs args) { return getObjectsPlain(args, InvokeOptions.Empty); } /** * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect the provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static Output getObjects(GetObjectsArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("aws:s3/getObjects:getObjects", TypeShape.of(GetObjectsResult.class), args, Utilities.withVersion(options)); } /** * > **NOTE on `max_keys`:** Retrieving very large numbers of keys can adversely affect the provider's performance. * * The objects data source returns keys (i.e., file names) and other metadata about objects in an S3 bucket. * */ public static CompletableFuture getObjectsPlain(GetObjectsPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("aws:s3/getObjects:getObjects", TypeShape.of(GetObjectsResult.class), args, Utilities.withVersion(options)); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy