aws.lightsail.Disk
Explore with Pulumi AI
Manages a Lightsail disk. Use this resource to create additional block storage that can be attached to Lightsail instances for extra storage capacity.
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 example = new aws.lightsail.Disk("example", {
name: "example-disk",
sizeInGb: 8,
availabilityZone: available.then(available => available.names?.[0]),
});
import pulumi
import pulumi_aws as aws
available = aws.get_availability_zones(state="available",
filters=[{
"name": "opt-in-status",
"values": ["opt-in-not-required"],
}])
example = aws.lightsail.Disk("example",
name="example-disk",
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, "example", &lightsail.DiskArgs{
Name: pulumi.String("example-disk"),
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 example = new Aws.LightSail.Disk("example", new()
{
Name = "example-disk",
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 example = new Disk("example", DiskArgs.builder()
.name("example-disk")
.sizeInGb(8)
.availabilityZone(available.names()[0])
.build());
}
}
resources:
example:
type: aws:lightsail:Disk
properties:
name: example-disk
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Disk(name: string, args: DiskArgs, opts?: CustomResourceOptions);
@overload
def Disk(resource_name: str,
args: DiskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Disk(resource_name: str,
opts: Optional[ResourceOptions] = None,
availability_zone: Optional[str] = None,
size_in_gb: Optional[int] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewDisk(ctx *Context, name string, args DiskArgs, opts ...ResourceOption) (*Disk, error)
public Disk(string name, DiskArgs args, CustomResourceOptions? opts = null)
type: aws:lightsail:Disk
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 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var diskResource = new Aws.LightSail.Disk("diskResource", new()
{
AvailabilityZone = "string",
SizeInGb = 0,
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := lightsail.NewDisk(ctx, "diskResource", &lightsail.DiskArgs{
AvailabilityZone: pulumi.String("string"),
SizeInGb: pulumi.Int(0),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var diskResource = new Disk("diskResource", DiskArgs.builder()
.availabilityZone("string")
.sizeInGb(0)
.name("string")
.tags(Map.of("string", "string"))
.build());
disk_resource = aws.lightsail.Disk("diskResource",
availability_zone="string",
size_in_gb=0,
name="string",
tags={
"string": "string",
})
const diskResource = new aws.lightsail.Disk("diskResource", {
availabilityZone: "string",
sizeInGb: 0,
name: "string",
tags: {
string: "string",
},
});
type: aws:lightsail:Disk
properties:
availabilityZone: string
name: string
sizeInGb: 0
tags:
string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Disk resource accepts the following input properties:
- Availability
Zone string - Availability Zone in which to create the disk.
- Size
In intGb Size of the disk in GB.
The following arguments are optional:
- Name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- 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.
- Availability
Zone string - Availability Zone in which to create the disk.
- Size
In intGb Size of the disk in GB.
The following arguments are optional:
- Name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- 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.
- availability
Zone String - Availability Zone in which to create the disk.
- size
In IntegerGb Size of the disk in GB.
The following arguments are optional:
- name String
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- 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.
- availability
Zone string - Availability Zone in which to create the disk.
- size
In numberGb Size of the disk in GB.
The following arguments are optional:
- name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- {[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.
- availability_
zone str - Availability Zone in which to create the disk.
- size_
in_ intgb Size of the disk in GB.
The following arguments are optional:
- name str
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- 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.
- availability
Zone String - Availability Zone in which to create the disk.
- size
In NumberGb Size of the disk in GB.
The following arguments are optional:
- name String
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- 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 Disk resource produces the following output properties:
- Arn string
- ARN of the disk.
- Created
At string - Date and time when the disk was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN of the disk.
- Created
At string - Date and time when the disk was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the disk.
- created
At String - Date and time when the disk was created.
- id String
- The provider-assigned unique ID for this managed resource.
- support
Code String - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN of the disk.
- created
At string - Date and time when the disk was created.
- id string
- The provider-assigned unique ID for this managed resource.
- support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN of the disk.
- created_
at str - Date and time when the disk was created.
- id str
- The provider-assigned unique ID for this managed resource.
- support_
code str - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the disk.
- created
At String - Date and time when the disk was created.
- id String
- The provider-assigned unique ID for this managed resource.
- support
Code String - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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)
resources: _: type: aws:lightsail:Disk 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.
- Arn string
- ARN of the disk.
- Availability
Zone string - Availability Zone in which to create the disk.
- Created
At string - Date and time when the disk was created.
- Name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- Size
In intGb Size of the disk in GB.
The following arguments are optional:
- Support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- 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. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN of the disk.
- Availability
Zone string - Availability Zone in which to create the disk.
- Created
At string - Date and time when the disk was created.
- Name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- Size
In intGb Size of the disk in GB.
The following arguments are optional:
- Support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- 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. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the disk.
- availability
Zone String - Availability Zone in which to create the disk.
- created
At String - Date and time when the disk was created.
- name String
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- size
In IntegerGb Size of the disk in GB.
The following arguments are optional:
- support
Code String - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- 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. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN of the disk.
- availability
Zone string - Availability Zone in which to create the disk.
- created
At string - Date and time when the disk was created.
- name string
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- size
In numberGb Size of the disk in GB.
The following arguments are optional:
- support
Code string - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- {[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. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN of the disk.
- availability_
zone str - Availability Zone in which to create the disk.
- created_
at str - Date and time when the disk was created.
- name str
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- size_
in_ intgb Size of the disk in GB.
The following arguments are optional:
- support_
code str - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- 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. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the disk.
- availability
Zone String - Availability Zone in which to create the disk.
- created
At String - Date and time when the disk was created.
- name String
- Name of the disk. Must begin with an alphabetic character and contain only alphanumeric characters, underscores, hyphens, and dots.
- size
In NumberGb Size of the disk in GB.
The following arguments are optional:
- support
Code String - Support code for the disk. Include this code in your email to support when you have questions about a disk in Lightsail.
- 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. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import aws_lightsail_disk
using the name attribute. For example:
$ pulumi import aws:lightsail/disk:Disk example example-disk
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.