
com.pulumi.aws.s3.DirectoryBucket Maven / Gradle / Ivy
// *** 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.DirectoryBucketArgs;
import com.pulumi.aws.s3.inputs.DirectoryBucketState;
import com.pulumi.aws.s3.outputs.DirectoryBucketLocation;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides an Amazon S3 Express directory bucket resource.
*
* ## 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.DirectoryBucket;
* import com.pulumi.aws.s3.DirectoryBucketArgs;
* import com.pulumi.aws.s3.inputs.DirectoryBucketLocationArgs;
* 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 DirectoryBucket("example", DirectoryBucketArgs.builder()
* .bucket("example--usw2-az1--x-s3")
* .location(DirectoryBucketLocationArgs.builder()
* .name("usw2-az1")
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import S3 bucket using `bucket`. For example:
*
* ```sh
* $ pulumi import aws:s3/directoryBucket:DirectoryBucket example example--usw2-az1--x-s3
* ```
*
*/
@ResourceType(type="aws:s3/directoryBucket:DirectoryBucket")
public class DirectoryBucket extends com.pulumi.resources.CustomResource {
/**
* ARN of the bucket.
*
*/
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
/**
* @return ARN of the bucket.
*
*/
public Output arn() {
return this.arn;
}
/**
* Name of the bucket. The name must be in the format `[bucket_name]--[azid]--x-s3`. Use the `aws.s3.BucketV2` resource to manage general purpose buckets.
*
*/
@Export(name="bucket", refs={String.class}, tree="[0]")
private Output bucket;
/**
* @return Name of the bucket. The name must be in the format `[bucket_name]--[azid]--x-s3`. Use the `aws.s3.BucketV2` resource to manage general purpose buckets.
*
*/
public Output bucket() {
return this.bucket;
}
/**
* Data redundancy. Valid values: `SingleAvailabilityZone`.
*
*/
@Export(name="dataRedundancy", refs={String.class}, tree="[0]")
private Output dataRedundancy;
/**
* @return Data redundancy. Valid values: `SingleAvailabilityZone`.
*
*/
public Output dataRedundancy() {
return this.dataRedundancy;
}
/**
* Boolean that indicates all 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.
*
*/
@Export(name="forceDestroy", refs={Boolean.class}, tree="[0]")
private Output forceDestroy;
/**
* @return Boolean that indicates all 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.
*
*/
public Output forceDestroy() {
return this.forceDestroy;
}
/**
* Bucket location. See Location below for more details.
*
*/
@Export(name="location", refs={DirectoryBucketLocation.class}, tree="[0]")
private Output* @Nullable */ DirectoryBucketLocation> location;
/**
* @return Bucket location. See Location below for more details.
*
*/
public Output> location() {
return Codegen.optional(this.location);
}
/**
* Bucket type. Valid values: `Directory`.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return Bucket type. Valid values: `Directory`.
*
*/
public Output type() {
return this.type;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public DirectoryBucket(java.lang.String name) {
this(name, DirectoryBucketArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public DirectoryBucket(java.lang.String name, DirectoryBucketArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public DirectoryBucket(java.lang.String name, DirectoryBucketArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:s3/directoryBucket:DirectoryBucket", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private DirectoryBucket(java.lang.String name, Output id, @Nullable DirectoryBucketState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:s3/directoryBucket:DirectoryBucket", name, state, makeResourceOptions(options, id), false);
}
private static DirectoryBucketArgs makeArgs(DirectoryBucketArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? DirectoryBucketArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static DirectoryBucket get(java.lang.String name, Output id, @Nullable DirectoryBucketState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new DirectoryBucket(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy