<filename>sdk/dotnet/Vpc/Ipv6EgressRule.cs<gh_stars>0// *** 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.Vpc
{
    /// <summary>
    /// Provides a VPC Ipv6 Egress Rule resource.
    /// 
    /// For information about VPC Ipv6 Egress Rule and how to use it, see [What is Ipv6 Egress Rule](https://www.alibabacloud.com/help/doc-detail/102200.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.142.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    ///     {
    ///         VpcName = "example_value",
    ///         EnableIpv6 = true,
    ///     });
    /// 
    ///     var exampleIpv6Gateway = new AliCloud.Vpc.Ipv6Gateway("exampleIpv6Gateway", new()
    ///     {
    ///         Ipv6GatewayName = "example_value",
    ///         VpcId = defaultNetwork.Id,
    ///     });
    /// 
    ///     var defaultInstances = AliCloud.Ecs.GetInstances.Invoke(new()
    ///     {
    ///         NameRegex = "ecs_with_ipv6_address",
    ///         Status = "Running",
    ///     });
    /// 
    ///     var defaultIpv6Addresses = AliCloud.Vpc.GetIpv6Addresses.Invoke(new()
    ///     {
    ///         AssociatedInstanceId = defaultInstances.Apply(getInstancesResult =&gt; getInstancesResult.Instances[0]?.Id),
    ///         Status = "Available",
    ///     });
    /// 
    ///     var exampleIpv6EgressRule = new AliCloud.Vpc.Ipv6EgressRule("exampleIpv6EgressRule", new()
    ///     {
    ///         InstanceId = defaultIpv6Addresses.Apply(getIpv6AddressesResult =&gt; getIpv6AddressesResult.Ids[0]),
    ///         Ipv6EgressRuleName = "example_value",
    ///         Description = "example_value",
    ///         Ipv6GatewayId = exampleIpv6Gateway.Id,
    ///         InstanceType = "Ipv6Address",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// VPC Ipv6 Egress Rule can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:vpc/ipv6EgressRule:Ipv6EgressRule example &lt;ipv6_gateway_id&gt;:&lt;ipv6_egress_rule_id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:vpc/ipv6EgressRule:Ipv6EgressRule")]
    public partial class Ipv6EgressRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The description of the egress-only rule. The description must be `2` to `256` characters in length. It cannot start with `http://` or `https://`.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The ID of the IPv6 address to which you want to apply the egress-only rule.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The type of instance to which you want to apply the egress-only rule. Valid values: `Ipv6Address`. `Ipv6Address` (default): an IPv6 address.
        /// </summary>
        [Output("instanceType")]
        public Output<string> InstanceType { get; private set; } = null!;

        /// <summary>
        /// The name of the egress-only rule. The name must be `2` to `128` characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with `http://` or `https://`.
        /// </summary>
        [Output("ipv6EgressRuleName")]
        public Output<string?> Ipv6EgressRuleName { get; private set; } = null!;

        /// <summary>
        /// The ID of the IPv6 gateway.
        /// </summary>
        [Output("ipv6GatewayId")]
        public Output<string> Ipv6GatewayId { get; private set; } = null!;

        /// <summary>
        /// The status of the resource. Valid values: `Available`, `Pending` and `Deleting`.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;


        /// <summary>
        /// Create a Ipv6EgressRule resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Ipv6EgressRule(string name, Ipv6EgressRuleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:vpc/ipv6EgressRule:Ipv6EgressRule", name, args ?? new Ipv6EgressRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Ipv6EgressRule(string name, Input<string> id, Ipv6EgressRuleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:vpc/ipv6EgressRule:Ipv6EgressRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Ipv6EgressRule resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Ipv6EgressRule Get(string name, Input<string> id, Ipv6EgressRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new Ipv6EgressRule(name, id, state, options);
        }
    }

    public sealed class Ipv6EgressRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of the egress-only rule. The description must be `2` to `256` characters in length. It cannot start with `http://` or `https://`.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The ID of the IPv6 address to which you want to apply the egress-only rule.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The type of instance to which you want to apply the egress-only rule. Valid values: `Ipv6Address`. `Ipv6Address` (default): an IPv6 address.
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// The name of the egress-only rule. The name must be `2` to `128` characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with `http://` or `https://`.
        /// </summary>
        [Input("ipv6EgressRuleName")]
        public Input<string>? Ipv6EgressRuleName { get; set; }

        /// <summary>
        /// The ID of the IPv6 gateway.
        /// </summary>
        [Input("ipv6GatewayId", required: true)]
        public Input<string> Ipv6GatewayId { get; set; } = null!;

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

    public sealed class Ipv6EgressRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of the egress-only rule. The description must be `2` to `256` characters in length. It cannot start with `http://` or `https://`.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The ID of the IPv6 address to which you want to apply the egress-only rule.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The type of instance to which you want to apply the egress-only rule. Valid values: `Ipv6Address`. `Ipv6Address` (default): an IPv6 address.
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// The name of the egress-only rule. The name must be `2` to `128` characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with `http://` or `https://`.
        /// </summary>
        [Input("ipv6EgressRuleName")]
        public Input<string>? Ipv6EgressRuleName { get; set; }

        /// <summary>
        /// The ID of the IPv6 gateway.
        /// </summary>
        [Input("ipv6GatewayId")]
        public Input<string>? Ipv6GatewayId { get; set; }

        /// <summary>
        /// The status of the resource. Valid values: `Available`, `Pending` and `Deleting`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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