// *** WARNING: this file was generated by pulumigen. ***
// *** 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.ScalewayInstances.Rules
{
    [ScalewayInstancesResourceType("scaleway-instances:rules:SecurityGroupRule")]
    public partial class SecurityGroupRule : global::Pulumi.CustomResource
    {
        [Output("action")]
        public Output<Pulumi.ScalewayInstances.Rules.Action> Action { get; private set; } = null!;

        /// <summary>
        /// The beginning of the range of ports to apply this rule to (inclusive)
        /// </summary>
        [Output("dest_port_from")]
        public Output<double?> Dest_port_from { get; private set; } = null!;

        /// <summary>
        /// The end of the range of ports to apply this rule to (inclusive)
        /// </summary>
        [Output("dest_port_to")]
        public Output<double?> Dest_port_to { get; private set; } = null!;

        [Output("direction")]
        public Output<Pulumi.ScalewayInstances.Rules.Direction> Direction { get; private set; } = null!;

        /// <summary>
        /// Indicates if this rule is editable (will be ignored)
        /// </summary>
        [Output("editable")]
        public Output<bool?> Editable { get; private set; } = null!;

        /// <summary>
        /// (IP network)
        /// </summary>
        [Output("ip_range")]
        public Output<string> Ip_range { get; private set; } = null!;

        /// <summary>
        /// The position of this rule in the security group rules list
        /// </summary>
        [Output("position")]
        public Output<double?> Position { get; private set; } = null!;

        [Output("protocol")]
        public Output<Pulumi.ScalewayInstances.Rules.Protocol> Protocol { get; private set; } = null!;


        /// <summary>
        /// Create a SecurityGroupRule 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 SecurityGroupRule(string name, SecurityGroupRuleArgs args, CustomResourceOptions? options = null)
            : base("scaleway-instances:rules:SecurityGroupRule", name, args ?? new SecurityGroupRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private SecurityGroupRule(string name, Input<string> id, CustomResourceOptions? options = null)
            : base("scaleway-instances:rules:SecurityGroupRule", name, null, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/cloudy-sky-software/pulumi-scaleway-instances",
            };
            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 SecurityGroupRule 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="options">A bag of options that control this resource's behavior</param>
        public static SecurityGroupRule Get(string name, Input<string> id, CustomResourceOptions? options = null)
        {
            return new SecurityGroupRule(name, id, options);
        }
    }

    public sealed class SecurityGroupRuleArgs : global::Pulumi.ResourceArgs
    {
        [Input("action", required: true)]
        public Input<Pulumi.ScalewayInstances.Rules.Action> Action { get; set; } = null!;

        /// <summary>
        /// The beginning of the range of ports to apply this rule to (inclusive)
        /// </summary>
        [Input("dest_port_from")]
        public Input<double>? Dest_port_from { get; set; }

        /// <summary>
        /// The end of the range of ports to apply this rule to (inclusive)
        /// </summary>
        [Input("dest_port_to")]
        public Input<double>? Dest_port_to { get; set; }

        [Input("direction", required: true)]
        public Input<Pulumi.ScalewayInstances.Rules.Direction> Direction { get; set; } = null!;

        /// <summary>
        /// Indicates if this rule is editable (will be ignored)
        /// </summary>
        [Input("editable")]
        public Input<bool>? Editable { get; set; }

        /// <summary>
        /// (IP network)
        /// </summary>
        [Input("ip_range", required: true)]
        public Input<string> Ip_range { get; set; } = null!;

        /// <summary>
        /// The position of this rule in the security group rules list
        /// </summary>
        [Input("position")]
        public Input<double>? Position { get; set; }

        [Input("protocol", required: true)]
        public Input<Pulumi.ScalewayInstances.Rules.Protocol> Protocol { get; set; } = null!;

        /// <summary>
        /// UUID of the security group
        /// </summary>
        [Input("security_group_id")]
        public Input<string>? Security_group_id { get; set; }

        /// <summary>
        /// The zone you want to target
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public SecurityGroupRuleArgs()
        {
            Action = Pulumi.ScalewayInstances.Rules.Action.Accept;
            Direction = Pulumi.ScalewayInstances.Rules.Direction.Inbound;
            Protocol = Pulumi.ScalewayInstances.Rules.Protocol.Tcp;
        }
        public static new SecurityGroupRuleArgs Empty => new SecurityGroupRuleArgs();
    }
}
