BucketV2Args

data class BucketV2Args(val accelerationStatus: Output<String>? = null, val acl: Output<String>? = null, val bucket: Output<String>? = null, val bucketPrefix: Output<String>? = null, val corsRules: Output<List<BucketV2CorsRuleArgs>>? = null, val forceDestroy: Output<Boolean>? = null, val grants: Output<List<BucketV2GrantArgs>>? = null, val lifecycleRules: Output<List<BucketV2LifecycleRuleArgs>>? = null, val loggings: Output<List<BucketV2LoggingArgs>>? = null, val objectLockConfiguration: Output<BucketV2ObjectLockConfigurationArgs>? = null, val objectLockEnabled: Output<Boolean>? = null, val policy: Output<String>? = null, val replicationConfigurations: Output<List<BucketV2ReplicationConfigurationArgs>>? = null, val requestPayer: Output<String>? = null, val serverSideEncryptionConfigurations: Output<List<BucketV2ServerSideEncryptionConfigurationArgs>>? = null, val tags: Output<Map<String, String>>? = null, val versionings: Output<List<BucketV2VersioningArgs>>? = null, val websites: Output<List<BucketV2WebsiteArgs>>? = null) : ConvertibleToJava<BucketV2Args>

Provides a S3 bucket resource.

This functionality is for managing S3 in an AWS Partition. To manage S3 on Outposts, see the aws.s3control.Bucket resource. In April 2023, AWS introduced updated security defaults for new S3 buckets. See this issue for a information on how this affects the aws.s3.BucketV2 resource.

Example Usage

Private Bucket With Tags

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
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) {
var example = new BucketV2("example", BucketV2Args.builder()
.tags(Map.ofEntries(
Map.entry("Environment", "Dev"),
Map.entry("Name", "My bucket")
))
.build());
}
}

Import

S3 bucket can be imported using the bucket, e.g.,

$ pulumi import aws:s3/bucketV2:BucketV2 bucket bucket-name

Constructors

Link copied to clipboard
constructor(accelerationStatus: Output<String>? = null, acl: Output<String>? = null, bucket: Output<String>? = null, bucketPrefix: Output<String>? = null, corsRules: Output<List<BucketV2CorsRuleArgs>>? = null, forceDestroy: Output<Boolean>? = null, grants: Output<List<BucketV2GrantArgs>>? = null, lifecycleRules: Output<List<BucketV2LifecycleRuleArgs>>? = null, loggings: Output<List<BucketV2LoggingArgs>>? = null, objectLockConfiguration: Output<BucketV2ObjectLockConfigurationArgs>? = null, objectLockEnabled: Output<Boolean>? = null, policy: Output<String>? = null, replicationConfigurations: Output<List<BucketV2ReplicationConfigurationArgs>>? = null, requestPayer: Output<String>? = null, serverSideEncryptionConfigurations: Output<List<BucketV2ServerSideEncryptionConfigurationArgs>>? = null, tags: Output<Map<String, String>>? = null, versionings: Output<List<BucketV2VersioningArgs>>? = null, websites: Output<List<BucketV2WebsiteArgs>>? = null)

Properties

Link copied to clipboard
val accelerationStatus: Output<String>? = null

Sets the accelerate configuration of an existing bucket. Can be Enabled or Suspended. Cannot be used in cn-north-1 or us-gov-west-1. This provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketAccelerateConfigurationV2 instead.

Link copied to clipboard
val acl: Output<String>? = null

The canned ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, and log-delivery-write. Defaults to private. Conflicts with grant. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketAclV2 instead.

Link copied to clipboard
val bucket: Output<String>? = null

Name of the bucket. If omitted, the provider will assign a random, unique name. Must be lowercase and less than or equal to 63 characters in length. A full list of bucket naming rules may be found here.

Link copied to clipboard
val bucketPrefix: Output<String>? = null

Creates a unique bucket name beginning with the specified prefix. Conflicts with bucket. Must be lowercase and less than or equal to 37 characters in length. A full list of bucket naming rules may be found here.

Link copied to clipboard
val corsRules: Output<List<BucketV2CorsRuleArgs>>? = null

Rule of Cross-Origin Resource Sharing. See CORS rule below for details. This provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketCorsConfigurationV2 instead.

Link copied to clipboard
val forceDestroy: Output<Boolean>? = null

Boolean that indicates all objects (including any locked objects) should be deleted from the bucket when the bucket is destroyed so that the bucket can be destroyed without error. These objects are not recoverable. This only deletes objects when the bucket is destroyed, not when setting this parameter to true. Once this parameter is set to true, there must be a successful pulumi up run before a destroy is required to update this value in the resource state. Without a successful pulumi up after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the bucket or destroying the bucket, this flag will not work. Additionally when importing a bucket, a successful pulumi up is required to set this value in state before it will take effect on a destroy operation.

Link copied to clipboard
val grants: Output<List<BucketV2GrantArgs>>? = null

An ACL policy grant. See Grant below for details. Conflicts with acl. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketAclV2 instead.

Link copied to clipboard

Configuration of object lifecycle management. See Lifecycle Rule below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketLifecycleConfigurationV2 instead.

Link copied to clipboard
val loggings: Output<List<BucketV2LoggingArgs>>? = null

Configuration of S3 bucket logging parameters. See Logging below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketLoggingV2 instead.

Link copied to clipboard

Configuration of S3 object locking. See Object Lock Configuration below for details. The provider wil only perform drift detection if a configuration value is provided. Use the object_lock_enabled parameter and the resource aws.s3.BucketObjectLockConfigurationV2 instead.

Link copied to clipboard
val objectLockEnabled: Output<Boolean>? = null

Indicates whether this bucket has an Object Lock configuration enabled. Valid values are true or false. This argument is not supported in all regions or partitions.

Link copied to clipboard
val policy: Output<String>? = null

Valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), this provider may view the policy as constantly changing. In this case, please make sure you use the verbose/specific version of the policy. For more information about building AWS IAM policy documents with this provider, see the AWS IAM Policy Document Guide. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketPolicy instead.

Link copied to clipboard

Configuration of replication configuration. See Replication Configuration below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketReplicationConfig instead.

Link copied to clipboard
val requestPayer: Output<String>? = null

Specifies who should bear the cost of Amazon S3 data transfer. Can be either BucketOwner or Requester. By default, the owner of the S3 bucket would incur the costs of any data transfer. See Requester Pays Buckets developer guide for more information. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketRequestPaymentConfigurationV2 instead.

Link copied to clipboard

Configuration of server-side encryption configuration. See Server Side Encryption Configuration below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketServerSideEncryptionConfigurationV2 instead.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Map of tags to assign to the bucket. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. The following arguments are deprecated, and will be removed in a future major version:

Link copied to clipboard

Configuration of the S3 bucket versioning state. See Versioning below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketVersioningV2 instead.

Link copied to clipboard
val websites: Output<List<BucketV2WebsiteArgs>>? = null

Configuration of the S3 bucket website. See Website below for details. The provider will only perform drift detection if a configuration value is provided. Use the resource aws.s3.BucketWebsiteConfigurationV2 instead.

Functions

Link copied to clipboard
open override fun toJava(): BucketV2Args