alicloud.eds.Snapshot
Provides a ECD Snapshot resource.
For information about ECD Snapshot and how to use it, see What is Snapshot.
NOTE: Available in v1.169.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "example_value";
var defaultSimpleOfficeSite = new AliCloud.Eds.SimpleOfficeSite("defaultSimpleOfficeSite", new()
{
CidrBlock = "172.16.0.0/12",
DesktopAccessType = "Internet",
OfficeSiteName = name,
EnableInternetAccess = false,
});
var defaultBundles = AliCloud.Eds.GetBundles.Invoke(new()
{
BundleType = "SYSTEM",
});
var defaultEcdPolicyGroup = new AliCloud.Eds.EcdPolicyGroup("defaultEcdPolicyGroup", new()
{
PolicyGroupName = name,
Clipboard = "readwrite",
LocalDrive = "read",
AuthorizeAccessPolicyRules = new[]
{
new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs
{
Description = "example_value",
CidrIp = "1.2.3.4/24",
},
},
AuthorizeSecurityPolicyRules = new[]
{
new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs
{
Type = "inflow",
Policy = "accept",
Description = "example_value",
PortRange = "80/80",
IpProtocol = "TCP",
Priority = "1",
CidrIp = "0.0.0.0/0",
},
},
});
var defaultDesktop = new AliCloud.Eds.Desktop("defaultDesktop", new()
{
OfficeSiteId = defaultSimpleOfficeSite.Id,
PolicyGroupId = defaultEcdPolicyGroup.Id,
BundleId = defaultBundles.Apply(getBundlesResult => getBundlesResult.Bundles[0]?.Id),
DesktopName = name,
});
var defaultSnapshot = new AliCloud.Eds.Snapshot("defaultSnapshot", new()
{
Description = name,
DesktopId = defaultDesktop.Id,
SnapshotName = name,
SourceDiskType = "SYSTEM",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "example_value"
if param := cfg.Get("name"); param != "" {
name = param
}
defaultSimpleOfficeSite, err := eds.NewSimpleOfficeSite(ctx, "defaultSimpleOfficeSite", &eds.SimpleOfficeSiteArgs{
CidrBlock: pulumi.String("172.16.0.0/12"),
DesktopAccessType: pulumi.String("Internet"),
OfficeSiteName: pulumi.String(name),
EnableInternetAccess: pulumi.Bool(false),
})
if err != nil {
return err
}
defaultBundles, err := eds.GetBundles(ctx, &eds.GetBundlesArgs{
BundleType: pulumi.StringRef("SYSTEM"),
}, nil)
if err != nil {
return err
}
defaultEcdPolicyGroup, err := eds.NewEcdPolicyGroup(ctx, "defaultEcdPolicyGroup", &eds.EcdPolicyGroupArgs{
PolicyGroupName: pulumi.String(name),
Clipboard: pulumi.String("readwrite"),
LocalDrive: pulumi.String("read"),
AuthorizeAccessPolicyRules: eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArray{
&eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs{
Description: pulumi.String("example_value"),
CidrIp: pulumi.String("1.2.3.4/24"),
},
},
AuthorizeSecurityPolicyRules: eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArray{
&eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs{
Type: pulumi.String("inflow"),
Policy: pulumi.String("accept"),
Description: pulumi.String("example_value"),
PortRange: pulumi.String("80/80"),
IpProtocol: pulumi.String("TCP"),
Priority: pulumi.String("1"),
CidrIp: pulumi.String("0.0.0.0/0"),
},
},
})
if err != nil {
return err
}
defaultDesktop, err := eds.NewDesktop(ctx, "defaultDesktop", &eds.DesktopArgs{
OfficeSiteId: defaultSimpleOfficeSite.ID(),
PolicyGroupId: defaultEcdPolicyGroup.ID(),
BundleId: *pulumi.String(defaultBundles.Bundles[0].Id),
DesktopName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = eds.NewSnapshot(ctx, "defaultSnapshot", &eds.SnapshotArgs{
Description: pulumi.String(name),
DesktopId: defaultDesktop.ID(),
SnapshotName: pulumi.String(name),
SourceDiskType: pulumi.String("SYSTEM"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eds.SimpleOfficeSite;
import com.pulumi.alicloud.eds.SimpleOfficeSiteArgs;
import com.pulumi.alicloud.eds.EdsFunctions;
import com.pulumi.alicloud.eds.inputs.GetBundlesArgs;
import com.pulumi.alicloud.eds.EcdPolicyGroup;
import com.pulumi.alicloud.eds.EcdPolicyGroupArgs;
import com.pulumi.alicloud.eds.inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs;
import com.pulumi.alicloud.eds.inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs;
import com.pulumi.alicloud.eds.Desktop;
import com.pulumi.alicloud.eds.DesktopArgs;
import com.pulumi.alicloud.eds.Snapshot;
import com.pulumi.alicloud.eds.SnapshotArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("example_value");
var defaultSimpleOfficeSite = new SimpleOfficeSite("defaultSimpleOfficeSite", SimpleOfficeSiteArgs.builder()
.cidrBlock("172.16.0.0/12")
.desktopAccessType("Internet")
.officeSiteName(name)
.enableInternetAccess(false)
.build());
final var defaultBundles = EdsFunctions.getBundles(GetBundlesArgs.builder()
.bundleType("SYSTEM")
.build());
var defaultEcdPolicyGroup = new EcdPolicyGroup("defaultEcdPolicyGroup", EcdPolicyGroupArgs.builder()
.policyGroupName(name)
.clipboard("readwrite")
.localDrive("read")
.authorizeAccessPolicyRules(EcdPolicyGroupAuthorizeAccessPolicyRuleArgs.builder()
.description("example_value")
.cidrIp("1.2.3.4/24")
.build())
.authorizeSecurityPolicyRules(EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs.builder()
.type("inflow")
.policy("accept")
.description("example_value")
.portRange("80/80")
.ipProtocol("TCP")
.priority("1")
.cidrIp("0.0.0.0/0")
.build())
.build());
var defaultDesktop = new Desktop("defaultDesktop", DesktopArgs.builder()
.officeSiteId(defaultSimpleOfficeSite.id())
.policyGroupId(defaultEcdPolicyGroup.id())
.bundleId(defaultBundles.applyValue(getBundlesResult -> getBundlesResult.bundles()[0].id()))
.desktopName(name)
.build());
var defaultSnapshot = new Snapshot("defaultSnapshot", SnapshotArgs.builder()
.description(name)
.desktopId(defaultDesktop.id())
.snapshotName(name)
.sourceDiskType("SYSTEM")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "example_value"
default_simple_office_site = alicloud.eds.SimpleOfficeSite("defaultSimpleOfficeSite",
cidr_block="172.16.0.0/12",
desktop_access_type="Internet",
office_site_name=name,
enable_internet_access=False)
default_bundles = alicloud.eds.get_bundles(bundle_type="SYSTEM")
default_ecd_policy_group = alicloud.eds.EcdPolicyGroup("defaultEcdPolicyGroup",
policy_group_name=name,
clipboard="readwrite",
local_drive="read",
authorize_access_policy_rules=[alicloud.eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs(
description="example_value",
cidr_ip="1.2.3.4/24",
)],
authorize_security_policy_rules=[alicloud.eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs(
type="inflow",
policy="accept",
description="example_value",
port_range="80/80",
ip_protocol="TCP",
priority="1",
cidr_ip="0.0.0.0/0",
)])
default_desktop = alicloud.eds.Desktop("defaultDesktop",
office_site_id=default_simple_office_site.id,
policy_group_id=default_ecd_policy_group.id,
bundle_id=default_bundles.bundles[0].id,
desktop_name=name)
default_snapshot = alicloud.eds.Snapshot("defaultSnapshot",
description=name,
desktop_id=default_desktop.id,
snapshot_name=name,
source_disk_type="SYSTEM")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "example_value";
const defaultSimpleOfficeSite = new alicloud.eds.SimpleOfficeSite("defaultSimpleOfficeSite", {
cidrBlock: "172.16.0.0/12",
desktopAccessType: "Internet",
officeSiteName: name,
enableInternetAccess: false,
});
const defaultBundles = alicloud.eds.getBundles({
bundleType: "SYSTEM",
});
const defaultEcdPolicyGroup = new alicloud.eds.EcdPolicyGroup("defaultEcdPolicyGroup", {
policyGroupName: name,
clipboard: "readwrite",
localDrive: "read",
authorizeAccessPolicyRules: [{
description: "example_value",
cidrIp: "1.2.3.4/24",
}],
authorizeSecurityPolicyRules: [{
type: "inflow",
policy: "accept",
description: "example_value",
portRange: "80/80",
ipProtocol: "TCP",
priority: "1",
cidrIp: "0.0.0.0/0",
}],
});
const defaultDesktop = new alicloud.eds.Desktop("defaultDesktop", {
officeSiteId: defaultSimpleOfficeSite.id,
policyGroupId: defaultEcdPolicyGroup.id,
bundleId: defaultBundles.then(defaultBundles => defaultBundles.bundles?.[0]?.id),
desktopName: name,
});
const defaultSnapshot = new alicloud.eds.Snapshot("defaultSnapshot", {
description: name,
desktopId: defaultDesktop.id,
snapshotName: name,
sourceDiskType: "SYSTEM",
});
configuration:
name:
type: string
default: example_value
resources:
defaultSimpleOfficeSite:
type: alicloud:eds:SimpleOfficeSite
properties:
cidrBlock: 172.16.0.0/12
desktopAccessType: Internet
officeSiteName: ${name}
enableInternetAccess: false
defaultEcdPolicyGroup:
type: alicloud:eds:EcdPolicyGroup
properties:
policyGroupName: ${name}
clipboard: readwrite
localDrive: read
authorizeAccessPolicyRules:
- description: example_value
cidrIp: 1.2.3.4/24
authorizeSecurityPolicyRules:
- type: inflow
policy: accept
description: example_value
portRange: 80/80
ipProtocol: TCP
priority: '1'
cidrIp: 0.0.0.0/0
defaultDesktop:
type: alicloud:eds:Desktop
properties:
officeSiteId: ${defaultSimpleOfficeSite.id}
policyGroupId: ${defaultEcdPolicyGroup.id}
bundleId: ${defaultBundles.bundles[0].id}
desktopName: ${name}
defaultSnapshot:
type: alicloud:eds:Snapshot
properties:
description: ${name}
desktopId: ${defaultDesktop.id}
snapshotName: ${name}
sourceDiskType: SYSTEM
variables:
defaultBundles:
fn::invoke:
Function: alicloud:eds:getBundles
Arguments:
bundleType: SYSTEM
Create Snapshot Resource
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);
@overload
def Snapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
desktop_id: Optional[str] = None,
snapshot_name: Optional[str] = None,
source_disk_type: Optional[str] = None)
@overload
def Snapshot(resource_name: str,
args: SnapshotArgs,
opts: Optional[ResourceOptions] = None)
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
public Snapshot(String name, SnapshotArgs args)
public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
type: alicloud:eds:Snapshot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- 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 SnapshotArgs
- 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 SnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Snapshot 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 Snapshot resource accepts the following input properties:
- Desktop
Id string The ID of the Desktop.
- Snapshot
Name string The name of the Snapshot.
- Source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- Description string
The description of the Snapshot.
- Desktop
Id string The ID of the Desktop.
- Snapshot
Name string The name of the Snapshot.
- Source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- Description string
The description of the Snapshot.
- desktop
Id String The ID of the Desktop.
- snapshot
Name String The name of the Snapshot.
- source
Disk StringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- description String
The description of the Snapshot.
- desktop
Id string The ID of the Desktop.
- snapshot
Name string The name of the Snapshot.
- source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- description string
The description of the Snapshot.
- desktop_
id str The ID of the Desktop.
- snapshot_
name str The name of the Snapshot.
- source_
disk_ strtype The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- description str
The description of the Snapshot.
- desktop
Id String The ID of the Desktop.
- snapshot
Name String The name of the Snapshot.
- source
Disk StringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- description String
The description of the Snapshot.
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
Look up Existing Snapshot Resource
Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
desktop_id: Optional[str] = None,
snapshot_name: Optional[str] = None,
source_disk_type: Optional[str] = None,
status: Optional[str] = None) -> Snapshot
func GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)
public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)
public static Snapshot get(String name, Output<String> id, SnapshotState 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.
- Description string
The description of the Snapshot.
- Desktop
Id string The ID of the Desktop.
- Snapshot
Name string The name of the Snapshot.
- Source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- Status string
The status of the snapshot.
- Description string
The description of the Snapshot.
- Desktop
Id string The ID of the Desktop.
- Snapshot
Name string The name of the Snapshot.
- Source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- Status string
The status of the snapshot.
- description String
The description of the Snapshot.
- desktop
Id String The ID of the Desktop.
- snapshot
Name String The name of the Snapshot.
- source
Disk StringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- status String
The status of the snapshot.
- description string
The description of the Snapshot.
- desktop
Id string The ID of the Desktop.
- snapshot
Name string The name of the Snapshot.
- source
Disk stringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- status string
The status of the snapshot.
- description str
The description of the Snapshot.
- desktop_
id str The ID of the Desktop.
- snapshot_
name str The name of the Snapshot.
- source_
disk_ strtype The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- status str
The status of the snapshot.
- description String
The description of the Snapshot.
- desktop
Id String The ID of the Desktop.
- snapshot
Name String The name of the Snapshot.
- source
Disk StringType The type of the disk for which to create a snapshot. Valid values:
SYSTEM
,DATA
.- status String
The status of the snapshot.
Import
ECD Snapshot can be imported using the id, e.g.
$ pulumi import alicloud:eds/snapshot:Snapshot example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.