// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Oss
{
    [Obsolete(@"alicloud.oss.getInstanceAttachments has been deprecated in favor of alicloud.ots.getInstanceAttachments")]
    public static class GetInstanceAttachments
    {
        /// <summary>
        /// This data source provides the ots instance attachments of the current Alibaba Cloud user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var attachmentsDs = AliCloud.Ots.GetInstanceAttachments.Invoke(new()
        ///     {
        ///         InstanceName = "sample-instance",
        ///         NameRegex = "testvpc",
        ///         OutputFile = "attachments.txt",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstOtsAttachmentId"] = attachmentsDs.Apply(getInstanceAttachmentsResult =&gt; getInstanceAttachmentsResult.Attachments[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetInstanceAttachmentsResult> InvokeAsync(GetInstanceAttachmentsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetInstanceAttachmentsResult>("alicloud:oss/getInstanceAttachments:getInstanceAttachments", args ?? new GetInstanceAttachmentsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the ots instance attachments of the current Alibaba Cloud user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var attachmentsDs = AliCloud.Ots.GetInstanceAttachments.Invoke(new()
        ///     {
        ///         InstanceName = "sample-instance",
        ///         NameRegex = "testvpc",
        ///         OutputFile = "attachments.txt",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstOtsAttachmentId"] = attachmentsDs.Apply(getInstanceAttachmentsResult =&gt; getInstanceAttachmentsResult.Attachments[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetInstanceAttachmentsResult> Invoke(GetInstanceAttachmentsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetInstanceAttachmentsResult>("alicloud:oss/getInstanceAttachments:getInstanceAttachments", args ?? new GetInstanceAttachmentsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetInstanceAttachmentsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The name of OTS instance.
        /// </summary>
        [Input("instanceName", required: true)]
        public string InstanceName { get; set; } = null!;

        /// <summary>
        /// A regex string to filter results by vpc name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        public GetInstanceAttachmentsArgs()
        {
        }
        public static new GetInstanceAttachmentsArgs Empty => new GetInstanceAttachmentsArgs();
    }

    public sealed class GetInstanceAttachmentsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The name of OTS instance.
        /// </summary>
        [Input("instanceName", required: true)]
        public Input<string> InstanceName { get; set; } = null!;

        /// <summary>
        /// A regex string to filter results by vpc name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        public GetInstanceAttachmentsInvokeArgs()
        {
        }
        public static new GetInstanceAttachmentsInvokeArgs Empty => new GetInstanceAttachmentsInvokeArgs();
    }


    [OutputType]
    public sealed class GetInstanceAttachmentsResult
    {
        /// <summary>
        /// A list of instance attachments. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetInstanceAttachmentsAttachmentResult> Attachments;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// The instance name.
        /// </summary>
        public readonly string InstanceName;
        public readonly string? NameRegex;
        /// <summary>
        /// A list of vpc names.
        /// </summary>
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;
        /// <summary>
        /// A list of vpc ids.
        /// </summary>
        public readonly ImmutableArray<string> VpcIds;

        [OutputConstructor]
        private GetInstanceAttachmentsResult(
            ImmutableArray<Outputs.GetInstanceAttachmentsAttachmentResult> attachments,

            string id,

            string instanceName,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            ImmutableArray<string> vpcIds)
        {
            Attachments = attachments;
            Id = id;
            InstanceName = instanceName;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            VpcIds = vpcIds;
        }
    }
}
