Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine
volcengine.ebs.AutoSnapshotPolicies
Explore with Pulumi AI
Use this data source to query detailed information of ebs auto snapshot policies
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooAutoSnapshotPolicy: volcengine.ebs.AutoSnapshotPolicy[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
    fooAutoSnapshotPolicy.push(new volcengine.ebs.AutoSnapshotPolicy(`fooAutoSnapshotPolicy-${range.value}`, {
        autoSnapshotPolicyName: "acc-test-auto-snapshot-policy",
        timePoints: [
            "1",
            "5",
            "9",
        ],
        retentionDays: -1,
        repeatWeekdays: [
            "2",
            "6",
        ],
        projectName: "default",
        tags: [{
            key: "k1",
            value: "v1",
        }],
    }));
}
const fooAutoSnapshotPolicies = volcengine.ebs.AutoSnapshotPoliciesOutput({
    ids: fooAutoSnapshotPolicy.map(__item => __item.id),
});
import pulumi
import pulumi_volcengine as volcengine
foo_auto_snapshot_policy = []
for range in [{"value": i} for i in range(0, 2)]:
    foo_auto_snapshot_policy.append(volcengine.ebs.AutoSnapshotPolicy(f"fooAutoSnapshotPolicy-{range['value']}",
        auto_snapshot_policy_name="acc-test-auto-snapshot-policy",
        time_points=[
            "1",
            "5",
            "9",
        ],
        retention_days=-1,
        repeat_weekdays=[
            "2",
            "6",
        ],
        project_name="default",
        tags=[volcengine.ebs.AutoSnapshotPolicyTagArgs(
            key="k1",
            value="v1",
        )]))
foo_auto_snapshot_policies = volcengine.ebs.auto_snapshot_policies_output(ids=[__item.id for __item in foo_auto_snapshot_policy])
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ebs"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var fooAutoSnapshotPolicy []*ebs.AutoSnapshotPolicy
for index := 0; index < 2; index++ {
    key0 := index
    _ := index
__res, err := ebs.NewAutoSnapshotPolicy(ctx, fmt.Sprintf("fooAutoSnapshotPolicy-%v", key0), &ebs.AutoSnapshotPolicyArgs{
AutoSnapshotPolicyName: pulumi.String("acc-test-auto-snapshot-policy"),
TimePoints: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("5"),
pulumi.String("9"),
},
RetentionDays: -1,
RepeatWeekdays: pulumi.StringArray{
pulumi.String("2"),
pulumi.String("6"),
},
ProjectName: pulumi.String("default"),
Tags: ebs.AutoSnapshotPolicyTagArray{
&ebs.AutoSnapshotPolicyTagArgs{
Key: pulumi.String("k1"),
Value: pulumi.String("v1"),
},
},
})
if err != nil {
return err
}
fooAutoSnapshotPolicy = append(fooAutoSnapshotPolicy, __res)
}
_ = ebs.AutoSnapshotPoliciesOutput(ctx, ebs.AutoSnapshotPoliciesOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:ebs-autoSnapshotPolicies:AutoSnapshotPolicies.pp:16,9-36),
}, nil);
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() => 
{
    var fooAutoSnapshotPolicy = new List<Volcengine.Ebs.AutoSnapshotPolicy>();
    for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        fooAutoSnapshotPolicy.Add(new Volcengine.Ebs.AutoSnapshotPolicy($"fooAutoSnapshotPolicy-{range.Value}", new()
        {
            AutoSnapshotPolicyName = "acc-test-auto-snapshot-policy",
            TimePoints = new[]
            {
                "1",
                "5",
                "9",
            },
            RetentionDays = -1,
            RepeatWeekdays = new[]
            {
                "2",
                "6",
            },
            ProjectName = "default",
            Tags = new[]
            {
                new Volcengine.Ebs.Inputs.AutoSnapshotPolicyTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        }));
    }
    var fooAutoSnapshotPolicies = Volcengine.Ebs.AutoSnapshotPolicies.Invoke(new()
    {
        Ids = fooAutoSnapshotPolicy.Select(__item => __item.Id).ToList(),
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ebs.AutoSnapshotPolicy;
import com.pulumi.volcengine.ebs.AutoSnapshotPolicyArgs;
import com.pulumi.volcengine.ebs.inputs.AutoSnapshotPolicyTagArgs;
import com.pulumi.volcengine.ebs.EbsFunctions;
import com.pulumi.volcengine.ebs.inputs.AutoSnapshotPoliciesArgs;
import com.pulumi.codegen.internal.KeyedValue;
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) {
        for (var i = 0; i < 2; i++) {
            new AutoSnapshotPolicy("fooAutoSnapshotPolicy-" + i, AutoSnapshotPolicyArgs.builder()            
                .autoSnapshotPolicyName("acc-test-auto-snapshot-policy")
                .timePoints(                
                    1,
                    5,
                    9)
                .retentionDays("TODO: GenUnaryOpExpression")
                .repeatWeekdays(                
                    2,
                    6)
                .projectName("default")
                .tags(AutoSnapshotPolicyTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());
        
}
        final var fooAutoSnapshotPolicies = EbsFunctions.AutoSnapshotPolicies(AutoSnapshotPoliciesArgs.builder()
            .ids(fooAutoSnapshotPolicy.stream().map(element -> element.id()).collect(toList()))
            .build());
    }
}
Coming soon!
Using AutoSnapshotPolicies
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function autoSnapshotPolicies(args: AutoSnapshotPoliciesArgs, opts?: InvokeOptions): Promise<AutoSnapshotPoliciesResult>
function autoSnapshotPoliciesOutput(args: AutoSnapshotPoliciesOutputArgs, opts?: InvokeOptions): Output<AutoSnapshotPoliciesResult>def auto_snapshot_policies(ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           project_name: Optional[str] = None,
                           tags: Optional[Sequence[AutoSnapshotPoliciesTag]] = None,
                           opts: Optional[InvokeOptions] = None) -> AutoSnapshotPoliciesResult
def auto_snapshot_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           name_regex: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           project_name: Optional[pulumi.Input[str]] = None,
                           tags: Optional[pulumi.Input[Sequence[pulumi.Input[AutoSnapshotPoliciesTagArgs]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[AutoSnapshotPoliciesResult]func AutoSnapshotPolicies(ctx *Context, args *AutoSnapshotPoliciesArgs, opts ...InvokeOption) (*AutoSnapshotPoliciesResult, error)
func AutoSnapshotPoliciesOutput(ctx *Context, args *AutoSnapshotPoliciesOutputArgs, opts ...InvokeOption) AutoSnapshotPoliciesResultOutputpublic static class AutoSnapshotPolicies 
{
    public static Task<AutoSnapshotPoliciesResult> InvokeAsync(AutoSnapshotPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<AutoSnapshotPoliciesResult> Invoke(AutoSnapshotPoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<AutoSnapshotPoliciesResult> autoSnapshotPolicies(AutoSnapshotPoliciesArgs args, InvokeOptions options)
public static Output<AutoSnapshotPoliciesResult> autoSnapshotPolicies(AutoSnapshotPoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:ebs:AutoSnapshotPolicies
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Ids List<string>
- A list of auto snapshot policy IDs.
- NameRegex string
- A Name Regex of Resource.
- OutputFile string
- File name where to save data source results.
- ProjectName string
- The project name of auto snapshot policy.
- 
List<AutoSnapshot Policies Tag> 
- Tags.
- Ids []string
- A list of auto snapshot policy IDs.
- NameRegex string
- A Name Regex of Resource.
- OutputFile string
- File name where to save data source results.
- ProjectName string
- The project name of auto snapshot policy.
- 
[]AutoSnapshot Policies Tag 
- Tags.
- ids List<String>
- A list of auto snapshot policy IDs.
- nameRegex String
- A Name Regex of Resource.
- outputFile String
- File name where to save data source results.
- projectName String
- The project name of auto snapshot policy.
- 
List<AutoSnapshot Policies Tag> 
- Tags.
- ids string[]
- A list of auto snapshot policy IDs.
- nameRegex string
- A Name Regex of Resource.
- outputFile string
- File name where to save data source results.
- projectName string
- The project name of auto snapshot policy.
- 
AutoSnapshot Policies Tag[] 
- Tags.
- ids Sequence[str]
- A list of auto snapshot policy IDs.
- name_regex str
- A Name Regex of Resource.
- output_file str
- File name where to save data source results.
- project_name str
- The project name of auto snapshot policy.
- 
Sequence[AutoSnapshot Policies Tag] 
- Tags.
- ids List<String>
- A list of auto snapshot policy IDs.
- nameRegex String
- A Name Regex of Resource.
- outputFile String
- File name where to save data source results.
- projectName String
- The project name of auto snapshot policy.
- List<Property Map>
- Tags.
AutoSnapshotPolicies Result
The following output properties are available:
- AutoSnapshot List<AutoPolicies Snapshot Policies Auto Snapshot Policy> 
- The collection of query.
- Id string
- The provider-assigned unique ID for this managed resource.
- TotalCount int
- The total count of query.
- Ids List<string>
- NameRegex string
- OutputFile string
- ProjectName string
- The project name of the auto snapshot policy.
- 
List<AutoSnapshot Policies Tag> 
- Tags.
- AutoSnapshot []AutoPolicies Snapshot Policies Auto Snapshot Policy 
- The collection of query.
- Id string
- The provider-assigned unique ID for this managed resource.
- TotalCount int
- The total count of query.
- Ids []string
- NameRegex string
- OutputFile string
- ProjectName string
- The project name of the auto snapshot policy.
- 
[]AutoSnapshot Policies Tag 
- Tags.
- autoSnapshot List<AutoPolicies Snapshot Policies Auto Snapshot Policy> 
- The collection of query.
- id String
- The provider-assigned unique ID for this managed resource.
- totalCount Integer
- The total count of query.
- ids List<String>
- nameRegex String
- outputFile String
- projectName String
- The project name of the auto snapshot policy.
- 
List<AutoSnapshot Policies Tag> 
- Tags.
- autoSnapshot AutoPolicies Snapshot Policies Auto Snapshot Policy[] 
- The collection of query.
- id string
- The provider-assigned unique ID for this managed resource.
- totalCount number
- The total count of query.
- ids string[]
- nameRegex string
- outputFile string
- projectName string
- The project name of the auto snapshot policy.
- 
AutoSnapshot Policies Tag[] 
- Tags.
- auto_snapshot_ Sequence[Autopolicies Snapshot Policies Auto Snapshot Policy] 
- The collection of query.
- id str
- The provider-assigned unique ID for this managed resource.
- total_count int
- The total count of query.
- ids Sequence[str]
- name_regex str
- output_file str
- project_name str
- The project name of the auto snapshot policy.
- 
Sequence[AutoSnapshot Policies Tag] 
- Tags.
- autoSnapshot List<Property Map>Policies 
- The collection of query.
- id String
- The provider-assigned unique ID for this managed resource.
- totalCount Number
- The total count of query.
- ids List<String>
- nameRegex String
- outputFile String
- projectName String
- The project name of the auto snapshot policy.
- List<Property Map>
- Tags.
Supporting Types
AutoSnapshotPoliciesAutoSnapshotPolicy     
- AutoSnapshot stringPolicy Id 
- The id of the auto snapshot policy.
- AutoSnapshot stringPolicy Name 
- The name of the auto snapshot policy.
- CreatedAt string
- The creation time of the auto snapshot policy.
- Id string
- The id of the auto snapshot policy.
- ProjectName string
- The project name of auto snapshot policy.
- RepeatDays int
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- RepeatWeekdays List<string>
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- RetentionDays int
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- Status string
- The status of the auto snapshot policy.
- 
List<AutoSnapshot Policies Auto Snapshot Policy Tag> 
- Tags.
- TimePoints List<string>
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- UpdatedAt string
- The updated time of the auto snapshot policy.
- int
- The number of volumes associated with the auto snapshot policy.
- AutoSnapshot stringPolicy Id 
- The id of the auto snapshot policy.
- AutoSnapshot stringPolicy Name 
- The name of the auto snapshot policy.
- CreatedAt string
- The creation time of the auto snapshot policy.
- Id string
- The id of the auto snapshot policy.
- ProjectName string
- The project name of auto snapshot policy.
- RepeatDays int
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- RepeatWeekdays []string
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- RetentionDays int
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- Status string
- The status of the auto snapshot policy.
- 
[]AutoSnapshot Policies Auto Snapshot Policy Tag 
- Tags.
- TimePoints []string
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- UpdatedAt string
- The updated time of the auto snapshot policy.
- int
- The number of volumes associated with the auto snapshot policy.
- autoSnapshot StringPolicy Id 
- The id of the auto snapshot policy.
- autoSnapshot StringPolicy Name 
- The name of the auto snapshot policy.
- createdAt String
- The creation time of the auto snapshot policy.
- id String
- The id of the auto snapshot policy.
- projectName String
- The project name of auto snapshot policy.
- repeatDays Integer
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- repeatWeekdays List<String>
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- retentionDays Integer
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- status String
- The status of the auto snapshot policy.
- 
List<AutoSnapshot Policies Auto Snapshot Policy Tag> 
- Tags.
- timePoints List<String>
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- updatedAt String
- The updated time of the auto snapshot policy.
- Integer
- The number of volumes associated with the auto snapshot policy.
- autoSnapshot stringPolicy Id 
- The id of the auto snapshot policy.
- autoSnapshot stringPolicy Name 
- The name of the auto snapshot policy.
- createdAt string
- The creation time of the auto snapshot policy.
- id string
- The id of the auto snapshot policy.
- projectName string
- The project name of auto snapshot policy.
- repeatDays number
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- repeatWeekdays string[]
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- retentionDays number
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- status string
- The status of the auto snapshot policy.
- 
AutoSnapshot Policies Auto Snapshot Policy Tag[] 
- Tags.
- timePoints string[]
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- updatedAt string
- The updated time of the auto snapshot policy.
- number
- The number of volumes associated with the auto snapshot policy.
- auto_snapshot_ strpolicy_ id 
- The id of the auto snapshot policy.
- auto_snapshot_ strpolicy_ name 
- The name of the auto snapshot policy.
- created_at str
- The creation time of the auto snapshot policy.
- id str
- The id of the auto snapshot policy.
- project_name str
- The project name of auto snapshot policy.
- repeat_days int
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- repeat_weekdays Sequence[str]
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- retention_days int
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- status str
- The status of the auto snapshot policy.
- 
Sequence[AutoSnapshot Policies Auto Snapshot Policy Tag] 
- Tags.
- time_points Sequence[str]
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- updated_at str
- The updated time of the auto snapshot policy.
- volume_nums int
- The number of volumes associated with the auto snapshot policy.
- autoSnapshot StringPolicy Id 
- The id of the auto snapshot policy.
- autoSnapshot StringPolicy Name 
- The name of the auto snapshot policy.
- createdAt String
- The creation time of the auto snapshot policy.
- id String
- The id of the auto snapshot policy.
- projectName String
- The project name of auto snapshot policy.
- repeatDays Number
- Create snapshots repeatedly on a daily basis, with intervals of a certain number of days between each snapshot.
- repeatWeekdays List<String>
- The date of creating snapshot repeatedly by week. The value range is 1-7, for example, 1 represents Monday.
- retentionDays Number
- The retention days of the auto snapshot. -1means permanently preserving the snapshot.
- status String
- The status of the auto snapshot policy.
- List<Property Map>
- Tags.
- timePoints List<String>
- The creation time points of the auto snapshot policy. The value range is 0~23, representing a total of 24 time points from 00:00 to 23:00, for example, 1 represents 01:00.
- updatedAt String
- The updated time of the auto snapshot policy.
- Number
- The number of volumes associated with the auto snapshot policy.
AutoSnapshotPoliciesAutoSnapshotPolicyTag      
AutoSnapshotPoliciesTag   
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the volcengineTerraform Provider.