Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
This data source provides the ENS Bucket Lifecycle rules of the current Alibaba Cloud user.
NOTE: Available since v1.291.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.ens.getBucketLifecycles({
bucketName: "your-bucket-name",
});
export const lifecycleRuleId = _default.then(_default => _default.rules?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.ens.get_bucket_lifecycles(bucket_name="your-bucket-name")
pulumi.export("lifecycleRuleId", default.rules[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ens"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := ens.GetBucketLifecycles(ctx, &ens.GetBucketLifecyclesArgs{
BucketName: "your-bucket-name",
}, nil)
if err != nil {
return err
}
ctx.Export("lifecycleRuleId", _default.Rules[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Ens.GetBucketLifecycles.Invoke(new()
{
BucketName = "your-bucket-name",
});
return new Dictionary<string, object?>
{
["lifecycleRuleId"] = @default.Apply(@default => @default.Apply(getBucketLifecyclesResult => getBucketLifecyclesResult.Rules[0]?.Id)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ens.EnsFunctions;
import com.pulumi.alicloud.ens.inputs.GetBucketLifecyclesArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default = EnsFunctions.getBucketLifecycles(GetBucketLifecyclesArgs.builder()
.bucketName("your-bucket-name")
.build());
ctx.export("lifecycleRuleId", default_.rules()[0].id());
}
}
variables:
default:
fn::invoke:
function: alicloud:ens:getBucketLifecycles
arguments:
bucketName: your-bucket-name
outputs:
lifecycleRuleId: ${default.rules[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_ens_getbucketlifecycles" "default" {
bucket_name = "your-bucket-name"
}
output "lifecycleRuleId" {
value = data.alicloud_ens_getbucketlifecycles.default.rules[0].id
}
Using getBucketLifecycles
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 getBucketLifecycles(args: GetBucketLifecyclesArgs, opts?: InvokeOptions): Promise<GetBucketLifecyclesResult>
function getBucketLifecyclesOutput(args: GetBucketLifecyclesOutputArgs, opts?: InvokeOutputOptions): Output<GetBucketLifecyclesResult>def get_bucket_lifecycles(bucket_name: Optional[str] = None,
output_file: Optional[str] = None,
rule_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBucketLifecyclesResult
def get_bucket_lifecycles_output(bucket_name: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
rule_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetBucketLifecyclesResult]func GetBucketLifecycles(ctx *Context, args *GetBucketLifecyclesArgs, opts ...InvokeOption) (*GetBucketLifecyclesResult, error)
func GetBucketLifecyclesOutput(ctx *Context, args *GetBucketLifecyclesOutputArgs, opts ...InvokeOption) GetBucketLifecyclesResultOutput> Note: This function is named GetBucketLifecycles in the Go SDK.
public static class GetBucketLifecycles
{
public static Task<GetBucketLifecyclesResult> InvokeAsync(GetBucketLifecyclesArgs args, InvokeOptions? opts = null)
public static Output<GetBucketLifecyclesResult> Invoke(GetBucketLifecyclesInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetBucketLifecyclesResult> Invoke(GetBucketLifecyclesInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetBucketLifecyclesResult> getBucketLifecycles(GetBucketLifecyclesArgs args, InvokeOptions options)
public static Output<GetBucketLifecyclesResult> getBucketLifecycles(GetBucketLifecyclesArgs args, InvokeOptions options)
public static Output<GetBucketLifecyclesResult> getBucketLifecycles(GetBucketLifecyclesArgs args, InvokeOutputOptions options)
fn::invoke:
function: alicloud:ens/getBucketLifecycles:getBucketLifecycles
arguments:
# arguments dictionarydata "alicloud_ens_get_bucket_lifecycles" "name" {
# arguments
}The following arguments are supported:
- Bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Rule
Id string - A specific rule ID used to filter results to a single rule.
- Bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Rule
Id string - A specific rule ID used to filter results to a single rule.
- bucket_
name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- output_
file string - File name where to save data source results (after running
pulumi preview). - rule_
id string - A specific rule ID used to filter results to a single rule.
- bucket
Name String - The name of the ENS bucket whose lifecycle rules are to be listed.
- output
File String - File name where to save data source results (after running
pulumi preview). - rule
Id String - A specific rule ID used to filter results to a single rule.
- bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- output
File string - File name where to save data source results (after running
pulumi preview). - rule
Id string - A specific rule ID used to filter results to a single rule.
- bucket_
name str - The name of the ENS bucket whose lifecycle rules are to be listed.
- output_
file str - File name where to save data source results (after running
pulumi preview). - rule_
id str - A specific rule ID used to filter results to a single rule.
- bucket
Name String - The name of the ENS bucket whose lifecycle rules are to be listed.
- output
File String - File name where to save data source results (after running
pulumi preview). - rule
Id String - A specific rule ID used to filter results to a single rule.
getBucketLifecycles Result
The following output properties are available:
- Bucket
Name string - The name of the ENS bucket.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - Rules
List<Pulumi.
Ali Cloud. Ens. Outputs. Get Bucket Lifecycles Rule> - A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- Output
File string - Rule
Id string - The unique ID of the rule.
- Bucket
Name string - The name of the ENS bucket.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - Rules
[]Get
Bucket Lifecycles Rule - A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- Output
File string - Rule
Id string - The unique ID of the rule.
- bucket_
name string - The name of the ENS bucket.
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - rules list(object)
- A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- output_
file string - rule_
id string - The unique ID of the rule.
- bucket
Name String - The name of the ENS bucket.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - rules
List<Get
Bucket Lifecycles Rule> - A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- output
File String - rule
Id String - The unique ID of the rule.
- bucket
Name string - The name of the ENS bucket.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - rules
Get
Bucket Lifecycles Rule[] - A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- output
File string - rule
Id string - The unique ID of the rule.
- bucket_
name str - The name of the ENS bucket.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - rules
Sequence[Get
Bucket Lifecycles Rule] - A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- output_
file str - rule_
id str - The unique ID of the rule.
- bucket
Name String - The name of the ENS bucket.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Bucket Lifecycle IDs, formatted as
<bucket_name>:<rule_id>. - rules List<Property Map>
- A list of ENS Bucket Lifecycle rules. Each element contains the following attributes:
- output
File String - rule
Id String - The unique ID of the rule.
Supporting Types
GetBucketLifecyclesRule
- Bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- Expiration
Days int - The number of days after the last update of the object before the lifecycle rule takes effect.
- Id string
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - Prefix string
- The prefix that the rule applies to.
- Rule
Id string - A specific rule ID used to filter results to a single rule.
- Status string
- The rule status. Valid values:
Enabled,Disabled.
- Bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- Expiration
Days int - The number of days after the last update of the object before the lifecycle rule takes effect.
- Id string
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - Prefix string
- The prefix that the rule applies to.
- Rule
Id string - A specific rule ID used to filter results to a single rule.
- Status string
- The rule status. Valid values:
Enabled,Disabled.
- bucket_
name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- expiration_
days number - The number of days after the last update of the object before the lifecycle rule takes effect.
- id string
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - prefix string
- The prefix that the rule applies to.
- rule_
id string - A specific rule ID used to filter results to a single rule.
- status string
- The rule status. Valid values:
Enabled,Disabled.
- bucket
Name String - The name of the ENS bucket whose lifecycle rules are to be listed.
- expiration
Days Integer - The number of days after the last update of the object before the lifecycle rule takes effect.
- id String
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - prefix String
- The prefix that the rule applies to.
- rule
Id String - A specific rule ID used to filter results to a single rule.
- status String
- The rule status. Valid values:
Enabled,Disabled.
- bucket
Name string - The name of the ENS bucket whose lifecycle rules are to be listed.
- expiration
Days number - The number of days after the last update of the object before the lifecycle rule takes effect.
- id string
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - prefix string
- The prefix that the rule applies to.
- rule
Id string - A specific rule ID used to filter results to a single rule.
- status string
- The rule status. Valid values:
Enabled,Disabled.
- bucket_
name str - The name of the ENS bucket whose lifecycle rules are to be listed.
- expiration_
days int - The number of days after the last update of the object before the lifecycle rule takes effect.
- id str
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - prefix str
- The prefix that the rule applies to.
- rule_
id str - A specific rule ID used to filter results to a single rule.
- status str
- The rule status. Valid values:
Enabled,Disabled.
- bucket
Name String - The name of the ENS bucket whose lifecycle rules are to be listed.
- expiration
Days Number - The number of days after the last update of the object before the lifecycle rule takes effect.
- id String
- The ID of the lifecycle rule, formatted as
<bucket_name>:<rule_id>. - prefix String
- The prefix that the rule applies to.
- rule
Id String - A specific rule ID used to filter results to a single rule.
- status String
- The rule status. Valid values:
Enabled,Disabled.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi