1. Packages
  2. MinIO
  3. API Docs
  4. IlmPolicy
MinIO v0.15.4 published on Monday, Jun 24, 2024 by Pulumi

minio.IlmPolicy

Explore with Pulumi AI

minio logo
MinIO v0.15.4 published on Monday, Jun 24, 2024 by Pulumi

    minio.IlmPolicy handles lifecycle settings for a given minio.S3Bucket.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as minio from "@pulumi/minio";
    
    const bucket = new minio.S3Bucket("bucket", {bucket: "bucket"});
    const bucket_lifecycle_rules = new minio.IlmPolicy("bucket-lifecycle-rules", {
        bucket: bucket.bucket,
        rules: [{
            id: "expire-7d",
            expiration: "7d",
        }],
    });
    
    import pulumi
    import pulumi_minio as minio
    
    bucket = minio.S3Bucket("bucket", bucket="bucket")
    bucket_lifecycle_rules = minio.IlmPolicy("bucket-lifecycle-rules",
        bucket=bucket.bucket,
        rules=[minio.IlmPolicyRuleArgs(
            id="expire-7d",
            expiration="7d",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-minio/sdk/go/minio"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		bucket, err := minio.NewS3Bucket(ctx, "bucket", &minio.S3BucketArgs{
    			Bucket: pulumi.String("bucket"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = minio.NewIlmPolicy(ctx, "bucket-lifecycle-rules", &minio.IlmPolicyArgs{
    			Bucket: bucket.Bucket,
    			Rules: minio.IlmPolicyRuleArray{
    				&minio.IlmPolicyRuleArgs{
    					Id:         pulumi.String("expire-7d"),
    					Expiration: pulumi.String("7d"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Minio = Pulumi.Minio;
    
    return await Deployment.RunAsync(() => 
    {
        var bucket = new Minio.S3Bucket("bucket", new()
        {
            Bucket = "bucket",
        });
    
        var bucket_lifecycle_rules = new Minio.IlmPolicy("bucket-lifecycle-rules", new()
        {
            Bucket = bucket.Bucket,
            Rules = new[]
            {
                new Minio.Inputs.IlmPolicyRuleArgs
                {
                    Id = "expire-7d",
                    Expiration = "7d",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.minio.S3Bucket;
    import com.pulumi.minio.S3BucketArgs;
    import com.pulumi.minio.IlmPolicy;
    import com.pulumi.minio.IlmPolicyArgs;
    import com.pulumi.minio.inputs.IlmPolicyRuleArgs;
    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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
                .bucket("bucket")
                .build());
    
            var bucket_lifecycle_rules = new IlmPolicy("bucket-lifecycle-rules", IlmPolicyArgs.builder()
                .bucket(bucket.bucket())
                .rules(IlmPolicyRuleArgs.builder()
                    .id("expire-7d")
                    .expiration("7d")
                    .build())
                .build());
    
        }
    }
    
    resources:
      bucket:
        type: minio:S3Bucket
        properties:
          bucket: bucket
      bucket-lifecycle-rules:
        type: minio:IlmPolicy
        properties:
          bucket: ${bucket.bucket}
          rules:
            - id: expire-7d
              expiration: 7d
    

    Create IlmPolicy Resource

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

    Constructor syntax

    new IlmPolicy(name: string, args: IlmPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def IlmPolicy(resource_name: str,
                  args: IlmPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def IlmPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  bucket: Optional[str] = None,
                  rules: Optional[Sequence[IlmPolicyRuleArgs]] = None)
    func NewIlmPolicy(ctx *Context, name string, args IlmPolicyArgs, opts ...ResourceOption) (*IlmPolicy, error)
    public IlmPolicy(string name, IlmPolicyArgs args, CustomResourceOptions? opts = null)
    public IlmPolicy(String name, IlmPolicyArgs args)
    public IlmPolicy(String name, IlmPolicyArgs args, CustomResourceOptions options)
    
    type: minio:IlmPolicy
    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 IlmPolicyArgs
    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 IlmPolicyArgs
    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 IlmPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IlmPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IlmPolicyArgs
    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 ilmPolicyResource = new Minio.IlmPolicy("ilmPolicyResource", new()
    {
        Bucket = "string",
        Rules = new[]
        {
            new Minio.Inputs.IlmPolicyRuleArgs
            {
                Id = "string",
                Expiration = "string",
                Filter = "string",
                NoncurrentVersionExpirationDays = 0,
                Status = "string",
                Tags = 
                {
                    { "string", "any" },
                },
            },
        },
    });
    
    example, err := minio.NewIlmPolicy(ctx, "ilmPolicyResource", &minio.IlmPolicyArgs{
    	Bucket: pulumi.String("string"),
    	Rules: minio.IlmPolicyRuleArray{
    		&minio.IlmPolicyRuleArgs{
    			Id:                              pulumi.String("string"),
    			Expiration:                      pulumi.String("string"),
    			Filter:                          pulumi.String("string"),
    			NoncurrentVersionExpirationDays: pulumi.Int(0),
    			Status:                          pulumi.String("string"),
    			Tags: pulumi.Map{
    				"string": pulumi.Any("any"),
    			},
    		},
    	},
    })
    
    var ilmPolicyResource = new IlmPolicy("ilmPolicyResource", IlmPolicyArgs.builder()
        .bucket("string")
        .rules(IlmPolicyRuleArgs.builder()
            .id("string")
            .expiration("string")
            .filter("string")
            .noncurrentVersionExpirationDays(0)
            .status("string")
            .tags(Map.of("string", "any"))
            .build())
        .build());
    
    ilm_policy_resource = minio.IlmPolicy("ilmPolicyResource",
        bucket="string",
        rules=[minio.IlmPolicyRuleArgs(
            id="string",
            expiration="string",
            filter="string",
            noncurrent_version_expiration_days=0,
            status="string",
            tags={
                "string": "any",
            },
        )])
    
    const ilmPolicyResource = new minio.IlmPolicy("ilmPolicyResource", {
        bucket: "string",
        rules: [{
            id: "string",
            expiration: "string",
            filter: "string",
            noncurrentVersionExpirationDays: 0,
            status: "string",
            tags: {
                string: "any",
            },
        }],
    });
    
    type: minio:IlmPolicy
    properties:
        bucket: string
        rules:
            - expiration: string
              filter: string
              id: string
              noncurrentVersionExpirationDays: 0
              status: string
              tags:
                string: any
    

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

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IlmPolicy 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 IlmPolicy Resource

    Get an existing IlmPolicy 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?: IlmPolicyState, opts?: CustomResourceOptions): IlmPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            rules: Optional[Sequence[IlmPolicyRuleArgs]] = None) -> IlmPolicy
    func GetIlmPolicy(ctx *Context, name string, id IDInput, state *IlmPolicyState, opts ...ResourceOption) (*IlmPolicy, error)
    public static IlmPolicy Get(string name, Input<string> id, IlmPolicyState? state, CustomResourceOptions? opts = null)
    public static IlmPolicy get(String name, Output<String> id, IlmPolicyState 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.

    Supporting Types

    IlmPolicyRule, IlmPolicyRuleArgs

    Id string
    The ID of this resource.
    Expiration string
    Filter string
    NoncurrentVersionExpirationDays int
    Status string
    Tags Dictionary<string, object>
    Id string
    The ID of this resource.
    Expiration string
    Filter string
    NoncurrentVersionExpirationDays int
    Status string
    Tags map[string]interface{}
    id String
    The ID of this resource.
    expiration String
    filter String
    noncurrentVersionExpirationDays Integer
    status String
    tags Map<String,Object>
    id string
    The ID of this resource.
    expiration string
    filter string
    noncurrentVersionExpirationDays number
    status string
    tags {[key: string]: any}
    id str
    The ID of this resource.
    expiration str
    filter str
    noncurrent_version_expiration_days int
    status str
    tags Mapping[str, Any]
    id String
    The ID of this resource.
    expiration String
    filter String
    noncurrentVersionExpirationDays Number
    status String
    tags Map<Any>

    Package Details

    Repository
    MinIO pulumi/pulumi-minio
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the minio Terraform Provider.
    minio logo
    MinIO v0.15.4 published on Monday, Jun 24, 2024 by Pulumi