// *** 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;
using Pulumi;

namespace Cuemby.Equinix
{
    /// <summary>
    /// Provides a resource to attach elastic IP subnets to devices.
    /// 
    /// To attach an IP subnet from a reserved block to a provisioned device, you must derive a subnet CIDR
    /// belonging to one of your reserved blocks in the same project and facility as the target device.
    /// 
    /// For example, you have reserved IPv4 address block `147.229.10.152/30`, you can choose to assign
    /// either the whole block as one subnet to a device; or 2 subnets with CIDRs `147.229.10.152/31` and
    /// `147.229.10.154/31`; or 4 subnets with mask prefix length `32`. More about the elastic IP subnets
    /// is [here](https://metal.equinix.com/developers/docs/networking/elastic-ips/).
    /// 
    /// Device and reserved block must be in the same facility.
    /// </summary>
    [EquinixResourceType("equinix:index/metalIPAttachment:MetalIPAttachment")]
    public partial class MetalIPAttachment : Pulumi.CustomResource
    {
        [Output("address")]
        public Output<string> Address { get; private set; } = null!;

        /// <summary>
        /// Address family as integer. One of `4` or `6`.
        /// </summary>
        [Output("addressFamily")]
        public Output<int> AddressFamily { get; private set; } = null!;

        /// <summary>
        /// Length of CIDR prefix of the subnet as integer.
        /// </summary>
        [Output("cidr")]
        public Output<int> Cidr { get; private set; } = null!;

        /// <summary>
        /// CIDR notation of subnet from block reserved in the same project
        /// and facility as the device.
        /// </summary>
        [Output("cidrNotation")]
        public Output<string> CidrNotation { get; private set; } = null!;

        /// <summary>
        /// ID of device to which to assign the subnet.
        /// </summary>
        [Output("deviceId")]
        public Output<string> DeviceId { get; private set; } = null!;

        /// <summary>
        /// IP address of gateway for the subnet.
        /// </summary>
        [Output("gateway")]
        public Output<string> Gateway { get; private set; } = null!;

        /// <summary>
        /// Flag indicating whether IP block is global, i.e. assignable in any location
        /// </summary>
        [Output("global")]
        public Output<bool> Global { get; private set; } = null!;

        [Output("manageable")]
        public Output<bool> Manageable { get; private set; } = null!;

        [Output("management")]
        public Output<bool> Management { get; private set; } = null!;

        /// <summary>
        /// Subnet mask in decimal notation, e.g., `255.255.255.0`.
        /// </summary>
        [Output("netmask")]
        public Output<string> Netmask { get; private set; } = null!;

        /// <summary>
        /// Subnet network address.
        /// </summary>
        [Output("network")]
        public Output<string> Network { get; private set; } = null!;

        /// <summary>
        /// Boolean flag whether subnet is reachable from the Internet.
        /// </summary>
        [Output("public")]
        public Output<bool> Public { get; private set; } = null!;

        [Output("vrfId")]
        public Output<string> VrfId { get; private set; } = null!;


        /// <summary>
        /// Create a MetalIPAttachment 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 MetalIPAttachment(string name, MetalIPAttachmentArgs args, CustomResourceOptions? options = null)
            : base("equinix:index/metalIPAttachment:MetalIPAttachment", name, args ?? new MetalIPAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

        private MetalIPAttachment(string name, Input<string> id, MetalIPAttachmentState? state = null, CustomResourceOptions? options = null)
            : base("equinix:index/metalIPAttachment:MetalIPAttachment", 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/cuemby",
            };
            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 MetalIPAttachment 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 MetalIPAttachment Get(string name, Input<string> id, MetalIPAttachmentState? state = null, CustomResourceOptions? options = null)
        {
            return new MetalIPAttachment(name, id, state, options);
        }
    }

    public sealed class MetalIPAttachmentArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// CIDR notation of subnet from block reserved in the same project
        /// and facility as the device.
        /// </summary>
        [Input("cidrNotation", required: true)]
        public Input<string> CidrNotation { get; set; } = null!;

        /// <summary>
        /// ID of device to which to assign the subnet.
        /// </summary>
        [Input("deviceId", required: true)]
        public Input<string> DeviceId { get; set; } = null!;

        public MetalIPAttachmentArgs()
        {
        }
    }

    public sealed class MetalIPAttachmentState : Pulumi.ResourceArgs
    {
        [Input("address")]
        public Input<string>? Address { get; set; }

        /// <summary>
        /// Address family as integer. One of `4` or `6`.
        /// </summary>
        [Input("addressFamily")]
        public Input<int>? AddressFamily { get; set; }

        /// <summary>
        /// Length of CIDR prefix of the subnet as integer.
        /// </summary>
        [Input("cidr")]
        public Input<int>? Cidr { get; set; }

        /// <summary>
        /// CIDR notation of subnet from block reserved in the same project
        /// and facility as the device.
        /// </summary>
        [Input("cidrNotation")]
        public Input<string>? CidrNotation { get; set; }

        /// <summary>
        /// ID of device to which to assign the subnet.
        /// </summary>
        [Input("deviceId")]
        public Input<string>? DeviceId { get; set; }

        /// <summary>
        /// IP address of gateway for the subnet.
        /// </summary>
        [Input("gateway")]
        public Input<string>? Gateway { get; set; }

        /// <summary>
        /// Flag indicating whether IP block is global, i.e. assignable in any location
        /// </summary>
        [Input("global")]
        public Input<bool>? Global { get; set; }

        [Input("manageable")]
        public Input<bool>? Manageable { get; set; }

        [Input("management")]
        public Input<bool>? Management { get; set; }

        /// <summary>
        /// Subnet mask in decimal notation, e.g., `255.255.255.0`.
        /// </summary>
        [Input("netmask")]
        public Input<string>? Netmask { get; set; }

        /// <summary>
        /// Subnet network address.
        /// </summary>
        [Input("network")]
        public Input<string>? Network { get; set; }

        /// <summary>
        /// Boolean flag whether subnet is reachable from the Internet.
        /// </summary>
        [Input("public")]
        public Input<bool>? Public { get; set; }

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

        public MetalIPAttachmentState()
        {
        }
    }
}
