1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. Bucket
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

aws.lightsail.Bucket

Explore with Pulumi AI

aws logo
AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi

    Manages a Lightsail bucket. Use this resource to create and manage object storage buckets for storing files, images, and other data in Lightsail.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.lightsail.Bucket("example", {
        name: "example-bucket",
        bundleId: "small_1_0",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lightsail.Bucket("example",
        name="example-bucket",
        bundle_id="small_1_0")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lightsail.NewBucket(ctx, "example", &lightsail.BucketArgs{
    			Name:     pulumi.String("example-bucket"),
    			BundleId: pulumi.String("small_1_0"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.LightSail.Bucket("example", new()
        {
            Name = "example-bucket",
            BundleId = "small_1_0",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lightsail.Bucket;
    import com.pulumi.aws.lightsail.BucketArgs;
    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 Bucket("example", BucketArgs.builder()
                .name("example-bucket")
                .bundleId("small_1_0")
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:lightsail:Bucket
        properties:
          name: example-bucket
          bundleId: small_1_0
    

    Create Bucket Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Bucket(name: string, args: BucketArgs, opts?: CustomResourceOptions);
    @overload
    def Bucket(resource_name: str,
               args: BucketArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Bucket(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               bundle_id: Optional[str] = None,
               force_delete: Optional[bool] = None,
               name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
    func NewBucket(ctx *Context, name string, args BucketArgs, opts ...ResourceOption) (*Bucket, error)
    public Bucket(string name, BucketArgs args, CustomResourceOptions? opts = null)
    public Bucket(String name, BucketArgs args)
    public Bucket(String name, BucketArgs args, CustomResourceOptions options)
    
    type: aws:lightsail:Bucket
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var bucketResource = new Aws.LightSail.Bucket("bucketResource", new()
    {
        BundleId = "string",
        ForceDelete = false,
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := lightsail.NewBucket(ctx, "bucketResource", &lightsail.BucketArgs{
    	BundleId:    pulumi.String("string"),
    	ForceDelete: pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var bucketResource = new com.pulumi.aws.lightsail.Bucket("bucketResource", com.pulumi.aws.lightsail.BucketArgs.builder()
        .bundleId("string")
        .forceDelete(false)
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    bucket_resource = aws.lightsail.Bucket("bucketResource",
        bundle_id="string",
        force_delete=False,
        name="string",
        tags={
            "string": "string",
        })
    
    const bucketResource = new aws.lightsail.Bucket("bucketResource", {
        bundleId: "string",
        forceDelete: false,
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:lightsail:Bucket
    properties:
        bundleId: string
        forceDelete: false
        name: string
        tags:
            string: string
    

    Bucket Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Bucket resource accepts the following input properties:

    BundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    ForceDelete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    Name string

    Name for the bucket.

    The following arguments are optional:

    Tags Dictionary<string, string>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    BundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    ForceDelete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    Name string

    Name for the bucket.

    The following arguments are optional:

    Tags map[string]string
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    bundleId String
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    forceDelete Boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name String

    Name for the bucket.

    The following arguments are optional:

    tags Map<String,String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    bundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    forceDelete boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name string

    Name for the bucket.

    The following arguments are optional:

    tags {[key: string]: string}
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    bundle_id str
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    force_delete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name str

    Name for the bucket.

    The following arguments are optional:

    tags Mapping[str, str]
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    bundleId String
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    forceDelete Boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name String

    Name for the bucket.

    The following arguments are optional:

    tags Map<String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Bucket resource produces the following output properties:

    Arn string
    ARN of the Lightsail bucket.
    AvailabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    CreatedAt string
    Date and time when the bucket was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    AWS Region name.
    SupportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Url string
    URL of the bucket.
    Arn string
    ARN of the Lightsail bucket.
    AvailabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    CreatedAt string
    Date and time when the bucket was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    AWS Region name.
    SupportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Url string
    URL of the bucket.
    arn String
    ARN of the Lightsail bucket.
    availabilityZone String
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    createdAt String
    Date and time when the bucket was created.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    AWS Region name.
    supportCode String
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url String
    URL of the bucket.
    arn string
    ARN of the Lightsail bucket.
    availabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    createdAt string
    Date and time when the bucket was created.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    AWS Region name.
    supportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url string
    URL of the bucket.
    arn str
    ARN of the Lightsail bucket.
    availability_zone str
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    created_at str
    Date and time when the bucket was created.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    AWS Region name.
    support_code str
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url str
    URL of the bucket.
    arn String
    ARN of the Lightsail bucket.
    availabilityZone String
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    createdAt String
    Date and time when the bucket was created.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    AWS Region name.
    supportCode String
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url String
    URL of the bucket.

    Look up Existing Bucket Resource

    Get an existing Bucket resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BucketState, opts?: CustomResourceOptions): Bucket
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            availability_zone: Optional[str] = None,
            bundle_id: Optional[str] = None,
            created_at: Optional[str] = None,
            force_delete: Optional[bool] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            support_code: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            url: Optional[str] = None) -> Bucket
    func GetBucket(ctx *Context, name string, id IDInput, state *BucketState, opts ...ResourceOption) (*Bucket, error)
    public static Bucket Get(string name, Input<string> id, BucketState? state, CustomResourceOptions? opts = null)
    public static Bucket get(String name, Output<String> id, BucketState state, CustomResourceOptions options)
    resources:  _:    type: aws:lightsail:Bucket    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    ARN of the Lightsail bucket.
    AvailabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    BundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    CreatedAt string
    Date and time when the bucket was created.
    ForceDelete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    Name string

    Name for the bucket.

    The following arguments are optional:

    Region string
    AWS Region name.
    SupportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Url string
    URL of the bucket.
    Arn string
    ARN of the Lightsail bucket.
    AvailabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    BundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    CreatedAt string
    Date and time when the bucket was created.
    ForceDelete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    Name string

    Name for the bucket.

    The following arguments are optional:

    Region string
    AWS Region name.
    SupportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    Tags map[string]string
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Url string
    URL of the bucket.
    arn String
    ARN of the Lightsail bucket.
    availabilityZone String
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    bundleId String
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    createdAt String
    Date and time when the bucket was created.
    forceDelete Boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name String

    Name for the bucket.

    The following arguments are optional:

    region String
    AWS Region name.
    supportCode String
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Map<String,String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url String
    URL of the bucket.
    arn string
    ARN of the Lightsail bucket.
    availabilityZone string
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    bundleId string
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    createdAt string
    Date and time when the bucket was created.
    forceDelete boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name string

    Name for the bucket.

    The following arguments are optional:

    region string
    AWS Region name.
    supportCode string
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags {[key: string]: string}
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url string
    URL of the bucket.
    arn str
    ARN of the Lightsail bucket.
    availability_zone str
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    bundle_id str
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    created_at str
    Date and time when the bucket was created.
    force_delete bool
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name str

    Name for the bucket.

    The following arguments are optional:

    region str
    AWS Region name.
    support_code str
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Mapping[str, str]
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url str
    URL of the bucket.
    arn String
    ARN of the Lightsail bucket.
    availabilityZone String
    Availability Zone. Follows the format us-east-2a (case-sensitive).
    bundleId String
    Bundle ID to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the get-bucket-bundles cli command to get a list of bundle IDs that you can specify.
    createdAt String
    Date and time when the bucket was created.
    forceDelete Boolean
    Whether to force delete non-empty buckets using pulumi destroy. AWS by default will not delete a bucket which is not empty, to prevent losing bucket data and affecting other resources in Lightsail. If force_delete is set to true the bucket will be deleted even when not empty.
    name String

    Name for the bucket.

    The following arguments are optional:

    region String
    AWS Region name.
    supportCode String
    Support code for the resource. Include this code in your email to support when you have questions about a resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Map<String>
    Map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    url String
    URL of the bucket.

    Import

    Using pulumi import, import aws_lightsail_bucket using the name attribute. For example:

    $ pulumi import aws:lightsail/bucket:Bucket example example-bucket
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.83.0 published on Monday, Jun 16, 2025 by Pulumi