Try AWS Native preview for resources not in the classic version.
aws.lightsail.Disk
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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=[{
"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
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
The Disk resource accepts the following input properties:
- Availability
Zone string - The Availability Zone in which to create your disk.
- Size
In intGb - The instance port the load balancer will connect.
- Name string
- The name of the Lightsail load balancer.
- 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.
- Availability
Zone string - The Availability Zone in which to create your disk.
- Size
In intGb - The instance port the load balancer will connect.
- Name string
- The name of the Lightsail load balancer.
- 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.
- availability
Zone String - The Availability Zone in which to create your disk.
- size
In IntegerGb - The instance port the load balancer will connect.
- name String
- The name of the Lightsail load balancer.
- 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.
- availability
Zone string - The Availability Zone in which to create your disk.
- size
In numberGb - The instance port the load balancer will connect.
- name string
- The name of the Lightsail load balancer.
- {[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_ intgb - The instance port the load balancer will connect.
- name str
- The name of the Lightsail load balancer.
- 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.
- availability
Zone String - The Availability Zone in which to create your disk.
- size
In NumberGb - The instance port the load balancer will connect.
- name String
- The name of the Lightsail load balancer.
- 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.
- Created
At string - The timestamp when the load balancer was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Support
Code 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.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the Lightsail load balancer.
- Created
At string - The timestamp when the load balancer was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Support
Code 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.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- id String
- The provider-assigned unique ID for this managed resource.
- support
Code 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.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the Lightsail load balancer.
- created
At string - The timestamp when the load balancer was created.
- id string
- The provider-assigned unique ID for this managed resource.
- support
Code 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.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- created
At String - The timestamp when the load balancer was created.
- id String
- The provider-assigned unique ID for this managed resource.
- support
Code 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.
- Map<String>
- A 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)
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.
- Arn string
- The ARN of the Lightsail load balancer.
- Availability
Zone string - The Availability Zone in which to create your disk.
- Created
At string - The timestamp when the load balancer was created.
- Name string
- The name of the Lightsail load balancer.
- Size
In intGb - The instance port the load balancer will connect.
- Support
Code 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.
- 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN of the Lightsail load balancer.
- Availability
Zone string - The Availability Zone in which to create your disk.
- Created
At string - The timestamp when the load balancer was created.
- Name string
- The name of the Lightsail load balancer.
- Size
In intGb - The instance port the load balancer will connect.
- Support
Code 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.
- 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- availability
Zone String - The Availability Zone in which to create your disk.
- created
At String - The timestamp when the load balancer was created.
- name String
- The name of the Lightsail load balancer.
- size
In IntegerGb - The instance port the load balancer will connect.
- support
Code 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.
- 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN of the Lightsail load balancer.
- availability
Zone string - The Availability Zone in which to create your disk.
- created
At string - The timestamp when the load balancer was created.
- name string
- The name of the Lightsail load balancer.
- size
In numberGb - The instance port the load balancer will connect.
- support
Code 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.
- {[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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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_ intgb - 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.
- 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN of the Lightsail load balancer.
- availability
Zone String - The Availability Zone in which to create your disk.
- created
At String - The timestamp when the load balancer was created.
- name String
- The name of the Lightsail load balancer.
- size
In NumberGb - The instance port the load balancer will connect.
- support
Code 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.
- 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. - Map<String>
- A 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 test test
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.
Try AWS Native preview for resources not in the classic version.