<reponame>Regrau/pulumi-yandex// *** 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.Yandex
{
    public static class GetCdnResource
    {
        /// <summary>
        /// Get information about a Yandex CDN Resource. For more information, see
        /// [the official documentation](https://cloud.yandex.ru/docs/cdn/concepts/resource).
        /// 
        /// &gt; **_NOTE:_**  CDN provider must be activated prior usage of CDN resources, either via UI console or via yc cli command: ```yc cdn provider activate --folder-id &lt;folder-id&gt; --type gcore```
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Yandex = Pulumi.Yandex;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var myResource = Yandex.GetCdnResource.Invoke(new()
        ///     {
        ///         ResourceId = "some resource id",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["resourceCname"] = myResource.Apply(getCdnResourceResult =&gt; getCdnResourceResult.Cname),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetCdnResourceResult> InvokeAsync(GetCdnResourceArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetCdnResourceResult>("yandex:index/getCdnResource:getCdnResource", args ?? new GetCdnResourceArgs(), options.WithDefaults());

        /// <summary>
        /// Get information about a Yandex CDN Resource. For more information, see
        /// [the official documentation](https://cloud.yandex.ru/docs/cdn/concepts/resource).
        /// 
        /// &gt; **_NOTE:_**  CDN provider must be activated prior usage of CDN resources, either via UI console or via yc cli command: ```yc cdn provider activate --folder-id &lt;folder-id&gt; --type gcore```
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Yandex = Pulumi.Yandex;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var myResource = Yandex.GetCdnResource.Invoke(new()
        ///     {
        ///         ResourceId = "some resource id",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["resourceCname"] = myResource.Apply(getCdnResourceResult =&gt; getCdnResourceResult.Cname),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetCdnResourceResult> Invoke(GetCdnResourceInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetCdnResourceResult>("yandex:index/getCdnResource:getCdnResource", args ?? new GetCdnResourceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetCdnResourceArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Flag to create Resource either in active or disabled state. True - the content from CDN is available to clients.
        /// </summary>
        [Input("active")]
        public bool? Active { get; set; }

        /// <summary>
        /// CDN endpoint CNAME, must be unique among resources.
        /// </summary>
        [Input("cname")]
        public string? Cname { get; set; }

        /// <summary>
        /// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
        /// </summary>
        [Input("folderId")]
        public string? FolderId { get; set; }

        /// <summary>
        /// CDN Resource settings and options to tune CDN edge behavior.
        /// </summary>
        [Input("options")]
        public Inputs.GetCdnResourceOptionsArgs? Options { get; set; }

        [Input("originGroupId")]
        public int? OriginGroupId { get; set; }

        [Input("originGroupName")]
        public string? OriginGroupName { get; set; }

        [Input("originProtocol")]
        public string? OriginProtocol { get; set; }

        [Input("resourceId")]
        public string? ResourceId { get; set; }

        [Input("secondaryHostnames")]
        private List<string>? _secondaryHostnames;

        /// <summary>
        /// list of secondary hostname strings.
        /// </summary>
        public List<string> SecondaryHostnames
        {
            get => _secondaryHostnames ?? (_secondaryHostnames = new List<string>());
            set => _secondaryHostnames = value;
        }

        /// <summary>
        /// SSL certificate of CDN resource.
        /// </summary>
        [Input("sslCertificate")]
        public Inputs.GetCdnResourceSslCertificateArgs? SslCertificate { get; set; }

        [Input("updatedAt")]
        public string? UpdatedAt { get; set; }

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

    public sealed class GetCdnResourceInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Flag to create Resource either in active or disabled state. True - the content from CDN is available to clients.
        /// </summary>
        [Input("active")]
        public Input<bool>? Active { get; set; }

        /// <summary>
        /// CDN endpoint CNAME, must be unique among resources.
        /// </summary>
        [Input("cname")]
        public Input<string>? Cname { get; set; }

        /// <summary>
        /// Folder that the resource belongs to. If value is omitted, the default provider folder is used.
        /// </summary>
        [Input("folderId")]
        public Input<string>? FolderId { get; set; }

        /// <summary>
        /// CDN Resource settings and options to tune CDN edge behavior.
        /// </summary>
        [Input("options")]
        public Input<Inputs.GetCdnResourceOptionsInputArgs>? Options { get; set; }

        [Input("originGroupId")]
        public Input<int>? OriginGroupId { get; set; }

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

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

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

        [Input("secondaryHostnames")]
        private InputList<string>? _secondaryHostnames;

        /// <summary>
        /// list of secondary hostname strings.
        /// </summary>
        public InputList<string> SecondaryHostnames
        {
            get => _secondaryHostnames ?? (_secondaryHostnames = new InputList<string>());
            set => _secondaryHostnames = value;
        }

        /// <summary>
        /// SSL certificate of CDN resource.
        /// </summary>
        [Input("sslCertificate")]
        public Input<Inputs.GetCdnResourceSslCertificateInputArgs>? SslCertificate { get; set; }

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

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


    [OutputType]
    public sealed class GetCdnResourceResult
    {
        public readonly bool? Active;
        public readonly string Cname;
        public readonly string CreatedAt;
        public readonly string FolderId;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly Outputs.GetCdnResourceOptionsResult Options;
        public readonly int? OriginGroupId;
        public readonly string? OriginGroupName;
        public readonly string? OriginProtocol;
        public readonly string ResourceId;
        public readonly ImmutableArray<string> SecondaryHostnames;
        public readonly Outputs.GetCdnResourceSslCertificateResult SslCertificate;
        public readonly string UpdatedAt;

        [OutputConstructor]
        private GetCdnResourceResult(
            bool? active,

            string cname,

            string createdAt,

            string folderId,

            string id,

            Outputs.GetCdnResourceOptionsResult options,

            int? originGroupId,

            string? originGroupName,

            string? originProtocol,

            string resourceId,

            ImmutableArray<string> secondaryHostnames,

            Outputs.GetCdnResourceSslCertificateResult sslCertificate,

            string updatedAt)
        {
            Active = active;
            Cname = cname;
            CreatedAt = createdAt;
            FolderId = folderId;
            Id = id;
            Options = options;
            OriginGroupId = originGroupId;
            OriginGroupName = originGroupName;
            OriginProtocol = originProtocol;
            ResourceId = resourceId;
            SecondaryHostnames = secondaryHostnames;
            SslCertificate = sslCertificate;
            UpdatedAt = updatedAt;
        }
    }
}
