<reponame>Kagashino/pulumi-tctest<filename>sdk/dotnet/Security/GroupRule.cs// *** 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.Tctest.Security
{
    [TctestResourceType("tctest:Security/groupRule:GroupRule")]
    public partial class GroupRule : Pulumi.CustomResource
    {
        /// <summary>
        /// ID of the address template, and confilicts with `source_sgid` and `cidr_ip`.
        /// </summary>
        [Output("addressTemplate")]
        public Output<Outputs.GroupRuleAddressTemplate> AddressTemplate { get; private set; } = null!;

        /// <summary>
        /// An IP address network or segment, and conflict with `source_sgid` and `address_template`.
        /// </summary>
        [Output("cidrIp")]
        public Output<string?> CidrIp { get; private set; } = null!;

        /// <summary>
        /// Description of the security group rule.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        /// <summary>
        /// Type of IP protocol. Valid values: `TCP`, `UDP` and `ICMP`. Default to all types protocol, and conflicts with
        /// `protocol_template`.
        /// </summary>
        [Output("ipProtocol")]
        public Output<string> IpProtocol { get; private set; } = null!;

        /// <summary>
        /// Rule policy of security group. Valid values: `ACCEPT` and `DROP`.
        /// </summary>
        [Output("policy")]
        public Output<string> Policy { get; private set; } = null!;

        /// <summary>
        /// Range of the port. The available value can be one, multiple or one segment. E.g. `80`, `80,90` and `80-90`. Default to
        /// all ports, and confilicts with `protocol_template`.
        /// </summary>
        [Output("portRange")]
        public Output<string> PortRange { get; private set; } = null!;

        /// <summary>
        /// ID of the address template, and conflict with `ip_protocol`, `port_range`.
        /// </summary>
        [Output("protocolTemplate")]
        public Output<Outputs.GroupRuleProtocolTemplate> ProtocolTemplate { get; private set; } = null!;

        /// <summary>
        /// ID of the security group to be queried.
        /// </summary>
        [Output("securityGroupId")]
        public Output<string> SecurityGroupId { get; private set; } = null!;

        /// <summary>
        /// ID of the nested security group, and conflicts with `cidr_ip` and `address_template`.
        /// </summary>
        [Output("sourceSgid")]
        public Output<string> SourceSgid { get; private set; } = null!;

        /// <summary>
        /// Type of the security group rule. Valid values: `ingress` and `egress`.
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;


        /// <summary>
        /// Create a GroupRule 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 GroupRule(string name, GroupRuleArgs args, CustomResourceOptions? options = null)
            : base("tctest:Security/groupRule:GroupRule", name, args ?? new GroupRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private GroupRule(string name, Input<string> id, GroupRuleState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Security/groupRule:GroupRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 GroupRule 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 GroupRule Get(string name, Input<string> id, GroupRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new GroupRule(name, id, state, options);
        }
    }

    public sealed class GroupRuleArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the address template, and confilicts with `source_sgid` and `cidr_ip`.
        /// </summary>
        [Input("addressTemplate")]
        public Input<Inputs.GroupRuleAddressTemplateArgs>? AddressTemplate { get; set; }

        /// <summary>
        /// An IP address network or segment, and conflict with `source_sgid` and `address_template`.
        /// </summary>
        [Input("cidrIp")]
        public Input<string>? CidrIp { get; set; }

        /// <summary>
        /// Description of the security group rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Type of IP protocol. Valid values: `TCP`, `UDP` and `ICMP`. Default to all types protocol, and conflicts with
        /// `protocol_template`.
        /// </summary>
        [Input("ipProtocol")]
        public Input<string>? IpProtocol { get; set; }

        /// <summary>
        /// Rule policy of security group. Valid values: `ACCEPT` and `DROP`.
        /// </summary>
        [Input("policy", required: true)]
        public Input<string> Policy { get; set; } = null!;

        /// <summary>
        /// Range of the port. The available value can be one, multiple or one segment. E.g. `80`, `80,90` and `80-90`. Default to
        /// all ports, and confilicts with `protocol_template`.
        /// </summary>
        [Input("portRange")]
        public Input<string>? PortRange { get; set; }

        /// <summary>
        /// ID of the address template, and conflict with `ip_protocol`, `port_range`.
        /// </summary>
        [Input("protocolTemplate")]
        public Input<Inputs.GroupRuleProtocolTemplateArgs>? ProtocolTemplate { get; set; }

        /// <summary>
        /// ID of the security group to be queried.
        /// </summary>
        [Input("securityGroupId", required: true)]
        public Input<string> SecurityGroupId { get; set; } = null!;

        /// <summary>
        /// ID of the nested security group, and conflicts with `cidr_ip` and `address_template`.
        /// </summary>
        [Input("sourceSgid")]
        public Input<string>? SourceSgid { get; set; }

        /// <summary>
        /// Type of the security group rule. Valid values: `ingress` and `egress`.
        /// </summary>
        [Input("type", required: true)]
        public Input<string> Type { get; set; } = null!;

        public GroupRuleArgs()
        {
        }
    }

    public sealed class GroupRuleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the address template, and confilicts with `source_sgid` and `cidr_ip`.
        /// </summary>
        [Input("addressTemplate")]
        public Input<Inputs.GroupRuleAddressTemplateGetArgs>? AddressTemplate { get; set; }

        /// <summary>
        /// An IP address network or segment, and conflict with `source_sgid` and `address_template`.
        /// </summary>
        [Input("cidrIp")]
        public Input<string>? CidrIp { get; set; }

        /// <summary>
        /// Description of the security group rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Type of IP protocol. Valid values: `TCP`, `UDP` and `ICMP`. Default to all types protocol, and conflicts with
        /// `protocol_template`.
        /// </summary>
        [Input("ipProtocol")]
        public Input<string>? IpProtocol { get; set; }

        /// <summary>
        /// Rule policy of security group. Valid values: `ACCEPT` and `DROP`.
        /// </summary>
        [Input("policy")]
        public Input<string>? Policy { get; set; }

        /// <summary>
        /// Range of the port. The available value can be one, multiple or one segment. E.g. `80`, `80,90` and `80-90`. Default to
        /// all ports, and confilicts with `protocol_template`.
        /// </summary>
        [Input("portRange")]
        public Input<string>? PortRange { get; set; }

        /// <summary>
        /// ID of the address template, and conflict with `ip_protocol`, `port_range`.
        /// </summary>
        [Input("protocolTemplate")]
        public Input<Inputs.GroupRuleProtocolTemplateGetArgs>? ProtocolTemplate { get; set; }

        /// <summary>
        /// ID of the security group to be queried.
        /// </summary>
        [Input("securityGroupId")]
        public Input<string>? SecurityGroupId { get; set; }

        /// <summary>
        /// ID of the nested security group, and conflicts with `cidr_ip` and `address_template`.
        /// </summary>
        [Input("sourceSgid")]
        public Input<string>? SourceSgid { get; set; }

        /// <summary>
        /// Type of the security group rule. Valid values: `ingress` and `egress`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        public GroupRuleState()
        {
        }
    }
}
