1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. ecs
  6. DiskEncryptionByDefault
Viewing docs for Alibaba Cloud v3.101.0
published on Tuesday, Apr 28, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.101.0
published on Tuesday, Apr 28, 2026 by Pulumi

    Provides a Ecs Disk Encryption By Default resource.

    Default encryption configuration capability for cloud storage.

    For information about Ecs Disk Encryption By Default and how to use it, see What is Disk Encryption By Default.

    NOTE: Available since v1.277.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.ecs.DiskEncryptionByDefault("default", {encrypted: true});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ecs.DiskEncryptionByDefault("default", encrypted=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.NewDiskEncryptionByDefault(ctx, "default", &ecs.DiskEncryptionByDefaultArgs{
    			Encrypted: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Ecs.DiskEncryptionByDefault("default", new()
        {
            Encrypted = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.DiskEncryptionByDefault;
    import com.pulumi.alicloud.ecs.DiskEncryptionByDefaultArgs;
    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 default_ = new DiskEncryptionByDefault("default", DiskEncryptionByDefaultArgs.builder()
                .encrypted(true)
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:ecs:DiskEncryptionByDefault
        properties:
          encrypted: true
    

    Deleting alicloud.ecs.DiskEncryptionByDefault or removing it from your configuration

    Terraform cannot destroy resource alicloud.ecs.DiskEncryptionByDefault. Terraform will remove this resource from the state file, however resources may remain.

    📚 Need more examples? VIEW MORE EXAMPLES

    Create DiskEncryptionByDefault Resource

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

    Constructor syntax

    new DiskEncryptionByDefault(name: string, args?: DiskEncryptionByDefaultArgs, opts?: CustomResourceOptions);
    @overload
    def DiskEncryptionByDefault(resource_name: str,
                                args: Optional[DiskEncryptionByDefaultArgs] = None,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def DiskEncryptionByDefault(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                encrypted: Optional[bool] = None)
    func NewDiskEncryptionByDefault(ctx *Context, name string, args *DiskEncryptionByDefaultArgs, opts ...ResourceOption) (*DiskEncryptionByDefault, error)
    public DiskEncryptionByDefault(string name, DiskEncryptionByDefaultArgs? args = null, CustomResourceOptions? opts = null)
    public DiskEncryptionByDefault(String name, DiskEncryptionByDefaultArgs args)
    public DiskEncryptionByDefault(String name, DiskEncryptionByDefaultArgs args, CustomResourceOptions options)
    
    type: alicloud:ecs:DiskEncryptionByDefault
    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 DiskEncryptionByDefaultArgs
    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 DiskEncryptionByDefaultArgs
    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 DiskEncryptionByDefaultArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DiskEncryptionByDefaultArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DiskEncryptionByDefaultArgs
    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 diskEncryptionByDefaultResource = new AliCloud.Ecs.DiskEncryptionByDefault("diskEncryptionByDefaultResource", new()
    {
        Encrypted = false,
    });
    
    example, err := ecs.NewDiskEncryptionByDefault(ctx, "diskEncryptionByDefaultResource", &ecs.DiskEncryptionByDefaultArgs{
    	Encrypted: pulumi.Bool(false),
    })
    
    var diskEncryptionByDefaultResource = new DiskEncryptionByDefault("diskEncryptionByDefaultResource", DiskEncryptionByDefaultArgs.builder()
        .encrypted(false)
        .build());
    
    disk_encryption_by_default_resource = alicloud.ecs.DiskEncryptionByDefault("diskEncryptionByDefaultResource", encrypted=False)
    
    const diskEncryptionByDefaultResource = new alicloud.ecs.DiskEncryptionByDefault("diskEncryptionByDefaultResource", {encrypted: false});
    
    type: alicloud:ecs:DiskEncryptionByDefault
    properties:
        encrypted: false
    

    DiskEncryptionByDefault 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 DiskEncryptionByDefault resource accepts the following input properties:

    Encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    Encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted Boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted Boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DiskEncryptionByDefault Resource

    Get an existing DiskEncryptionByDefault 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?: DiskEncryptionByDefaultState, opts?: CustomResourceOptions): DiskEncryptionByDefault
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            encrypted: Optional[bool] = None) -> DiskEncryptionByDefault
    func GetDiskEncryptionByDefault(ctx *Context, name string, id IDInput, state *DiskEncryptionByDefaultState, opts ...ResourceOption) (*DiskEncryptionByDefault, error)
    public static DiskEncryptionByDefault Get(string name, Input<string> id, DiskEncryptionByDefaultState? state, CustomResourceOptions? opts = null)
    public static DiskEncryptionByDefault get(String name, Output<String> id, DiskEncryptionByDefaultState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:ecs:DiskEncryptionByDefault    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:
    Encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    Encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted Boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted bool
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:
    encrypted Boolean
    Indicates whether account-level default encryption of EBS resources is enabled in the region. Valid values:

    Import

    Ecs Disk Encryption By Default can be imported using the id, e.g.

    $ pulumi import alicloud:ecs/diskEncryptionByDefault:DiskEncryptionByDefault example <region_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Viewing docs for Alibaba Cloud v3.101.0
    published on Tuesday, Apr 28, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.