1. Packages
  2. AWS Classic
  3. API Docs
  4. lightsail
  5. Disk

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

aws.lightsail.Disk

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

    Provides a Lightsail Disk resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const available = aws.getAvailabilityZones({
        state: "available",
        filters: [{
            name: "opt-in-status",
            values: ["opt-in-not-required"],
        }],
    });
    const test = new aws.lightsail.Disk("test", {
        name: "test",
        sizeInGb: 8,
        availabilityZone: available.then(available => available.names?.[0]),
    });
    
    import pulumi
    import pulumi_aws as aws
    
    available = aws.get_availability_zones(state="available",
        filters=[aws.GetAvailabilityZonesFilterArgs(
            name="opt-in-status",
            values=["opt-in-not-required"],
        )])
    test = aws.lightsail.Disk("test",
        name="test",
        size_in_gb=8,
        availability_zone=available.names[0])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
    			State: pulumi.StringRef("available"),
    			Filters: []aws.GetAvailabilityZonesFilter{
    				{
    					Name: "opt-in-status",
    					Values: []string{
    						"opt-in-not-required",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = lightsail.NewDisk(ctx, "test", &lightsail.DiskArgs{
    			Name:             pulumi.String("test"),
    			SizeInGb:         pulumi.Int(8),
    			AvailabilityZone: *pulumi.String(available.Names[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 available = Aws.GetAvailabilityZones.Invoke(new()
        {
            State = "available",
            Filters = new[]
            {
                new Aws.Inputs.GetAvailabilityZonesFilterInputArgs
                {
                    Name = "opt-in-status",
                    Values = new[]
                    {
                        "opt-in-not-required",
                    },
                },
            },
        });
    
        var test = new Aws.LightSail.Disk("test", new()
        {
            Name = "test",
            SizeInGb = 8,
            AvailabilityZone = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Names[0]),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
    import com.pulumi.aws.lightsail.Disk;
    import com.pulumi.aws.lightsail.DiskArgs;
    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 available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
                .state("available")
                .filters(GetAvailabilityZonesFilterArgs.builder()
                    .name("opt-in-status")
                    .values("opt-in-not-required")
                    .build())
                .build());
    
            var test = new Disk("test", DiskArgs.builder()        
                .name("test")
                .sizeInGb(8)
                .availabilityZone(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.names()[0]))
                .build());
    
        }
    }
    
    resources:
      test:
        type: aws:lightsail:Disk
        properties:
          name: test
          sizeInGb: 8
          availabilityZone: ${available.names[0]}
    variables:
      available:
        fn::invoke:
          Function: aws:getAvailabilityZones
          Arguments:
            state: available
            filters:
              - name: opt-in-status
                values:
                  - opt-in-not-required
    

    Create Disk Resource

    new Disk(name: string, args: DiskArgs, opts?: CustomResourceOptions);
    @overload
    def Disk(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             availability_zone: Optional[str] = None,
             name: Optional[str] = None,
             size_in_gb: Optional[int] = None,
             tags: Optional[Mapping[str, str]] = None)
    @overload
    def Disk(resource_name: str,
             args: DiskArgs,
             opts: Optional[ResourceOptions] = None)
    func NewDisk(ctx *Context, name string, args DiskArgs, opts ...ResourceOption) (*Disk, error)
    public Disk(string name, DiskArgs args, CustomResourceOptions? opts = null)
    public Disk(String name, DiskArgs args)
    public Disk(String name, DiskArgs args, CustomResourceOptions options)
    
    type: aws:lightsail:Disk
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args DiskArgs
    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 DiskArgs
    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 DiskArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DiskArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DiskArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Disk Resource Properties

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

    Inputs

    The Disk resource accepts the following input properties:

    AvailabilityZone string
    The Availability Zone in which to create your disk.
    SizeInGb int
    The instance port the load balancer will connect.
    Name string
    The name of the Lightsail load balancer.
    Tags Dictionary<string, string>
    A 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.
    AvailabilityZone string
    The Availability Zone in which to create your disk.
    SizeInGb int
    The instance port the load balancer will connect.
    Name string
    The name of the Lightsail load balancer.
    Tags map[string]string
    A 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.
    availabilityZone String
    The Availability Zone in which to create your disk.
    sizeInGb Integer
    The instance port the load balancer will connect.
    name String
    The name of the Lightsail load balancer.
    tags Map<String,String>
    A 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.
    availabilityZone string
    The Availability Zone in which to create your disk.
    sizeInGb number
    The instance port the load balancer will connect.
    name string
    The name of the Lightsail load balancer.
    tags {[key: string]: string}
    A 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.
    availability_zone str
    The Availability Zone in which to create your disk.
    size_in_gb int
    The instance port the load balancer will connect.
    name str
    The name of the Lightsail load balancer.
    tags Mapping[str, str]
    A 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.
    availabilityZone String
    The Availability Zone in which to create your disk.
    sizeInGb Number
    The instance port the load balancer will connect.
    name String
    The name of the Lightsail load balancer.
    tags Map<String>
    A 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 Disk resource produces the following output properties:

    Arn string
    The ARN of the Lightsail load balancer.
    CreatedAt string
    The timestamp when the load balancer was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    SupportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Arn string
    The ARN of the Lightsail load balancer.
    CreatedAt string
    The timestamp when the load balancer was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    SupportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the Lightsail load balancer.
    createdAt String
    The timestamp when the load balancer was created.
    id String
    The provider-assigned unique ID for this managed resource.
    supportCode String
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn string
    The ARN of the Lightsail load balancer.
    createdAt string
    The timestamp when the load balancer was created.
    id string
    The provider-assigned unique ID for this managed resource.
    supportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn str
    The ARN of the Lightsail load balancer.
    created_at str
    The timestamp when the load balancer was created.
    id str
    The provider-assigned unique ID for this managed resource.
    support_code str
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the Lightsail load balancer.
    createdAt String
    The timestamp when the load balancer was created.
    id String
    The provider-assigned unique ID for this managed resource.
    supportCode String
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Look up Existing Disk Resource

    Get an existing Disk 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?: DiskState, opts?: CustomResourceOptions): Disk
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            availability_zone: Optional[str] = None,
            created_at: Optional[str] = None,
            name: Optional[str] = None,
            size_in_gb: Optional[int] = None,
            support_code: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> Disk
    func GetDisk(ctx *Context, name string, id IDInput, state *DiskState, opts ...ResourceOption) (*Disk, error)
    public static Disk Get(string name, Input<string> id, DiskState? state, CustomResourceOptions? opts = null)
    public static Disk get(String name, Output<String> id, DiskState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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
    The ARN of the Lightsail load balancer.
    AvailabilityZone string
    The Availability Zone in which to create your disk.
    CreatedAt string
    The timestamp when the load balancer was created.
    Name string
    The name of the Lightsail load balancer.
    SizeInGb int
    The instance port the load balancer will connect.
    SupportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    Tags Dictionary<string, string>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Arn string
    The ARN of the Lightsail load balancer.
    AvailabilityZone string
    The Availability Zone in which to create your disk.
    CreatedAt string
    The timestamp when the load balancer was created.
    Name string
    The name of the Lightsail load balancer.
    SizeInGb int
    The instance port the load balancer will connect.
    SupportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    Tags map[string]string
    A 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
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the Lightsail load balancer.
    availabilityZone String
    The Availability Zone in which to create your disk.
    createdAt String
    The timestamp when the load balancer was created.
    name String
    The name of the Lightsail load balancer.
    sizeInGb Integer
    The instance port the load balancer will connect.
    supportCode String
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Map<String,String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn string
    The ARN of the Lightsail load balancer.
    availabilityZone string
    The Availability Zone in which to create your disk.
    createdAt string
    The timestamp when the load balancer was created.
    name string
    The name of the Lightsail load balancer.
    sizeInGb number
    The instance port the load balancer will connect.
    supportCode string
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags {[key: string]: string}
    A 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}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn str
    The ARN of the Lightsail load balancer.
    availability_zone str
    The Availability Zone in which to create your disk.
    created_at str
    The timestamp when the load balancer was created.
    name str
    The name of the Lightsail load balancer.
    size_in_gb int
    The instance port the load balancer will connect.
    support_code str
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Mapping[str, str]
    A 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]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the Lightsail load balancer.
    availabilityZone String
    The Availability Zone in which to create your disk.
    createdAt String
    The timestamp when the load balancer was created.
    name String
    The name of the Lightsail load balancer.
    sizeInGb Number
    The instance port the load balancer will connect.
    supportCode String
    The support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    tags Map<String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Import

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

    $ pulumi import aws:lightsail/disk:Disk test test
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi