Azure Classic

v5.25.0 published on Thursday, Nov 24, 2022 by Pulumi

ApplicationNetworkRuleSet

Manages an IoT Central Application Network Rule Set.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleApplication = new Azure.IotCentral.Application("exampleApplication", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        SubDomain = "example-iotcentral-app-subdomain",
        DisplayName = "example-iotcentral-app-display-name",
        Sku = "ST1",
        Tags = 
        {
            { "Foo", "Bar" },
        },
    });

    var exampleApplicationNetworkRuleSet = new Azure.IotCentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", new()
    {
        IotcentralApplicationId = exampleApplication.Id,
        IpRules = new[]
        {
            new Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs
            {
                Name = "rule1",
                IpMask = "10.0.1.0/24",
            },
            new Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs
            {
                Name = "rule2",
                IpMask = "10.1.1.0/24",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iotcentral"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleApplication, err := iotcentral.NewApplication(ctx, "exampleApplication", &iotcentral.ApplicationArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			SubDomain:         pulumi.String("example-iotcentral-app-subdomain"),
			DisplayName:       pulumi.String("example-iotcentral-app-display-name"),
			Sku:               pulumi.String("ST1"),
			Tags: pulumi.StringMap{
				"Foo": pulumi.String("Bar"),
			},
		})
		if err != nil {
			return err
		}
		_, err = iotcentral.NewApplicationNetworkRuleSet(ctx, "exampleApplicationNetworkRuleSet", &iotcentral.ApplicationNetworkRuleSetArgs{
			IotcentralApplicationId: exampleApplication.ID(),
			IpRules: iotcentral.ApplicationNetworkRuleSetIpRuleArray{
				&iotcentral.ApplicationNetworkRuleSetIpRuleArgs{
					Name:   pulumi.String("rule1"),
					IpMask: pulumi.String("10.0.1.0/24"),
				},
				&iotcentral.ApplicationNetworkRuleSetIpRuleArgs{
					Name:   pulumi.String("rule2"),
					IpMask: pulumi.String("10.1.1.0/24"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.iotcentral.Application;
import com.pulumi.azure.iotcentral.ApplicationArgs;
import com.pulumi.azure.iotcentral.ApplicationNetworkRuleSet;
import com.pulumi.azure.iotcentral.ApplicationNetworkRuleSetArgs;
import com.pulumi.azure.iotcentral.inputs.ApplicationNetworkRuleSetIpRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleApplication = new Application("exampleApplication", ApplicationArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .subDomain("example-iotcentral-app-subdomain")
            .displayName("example-iotcentral-app-display-name")
            .sku("ST1")
            .tags(Map.of("Foo", "Bar"))
            .build());

        var exampleApplicationNetworkRuleSet = new ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", ApplicationNetworkRuleSetArgs.builder()        
            .iotcentralApplicationId(exampleApplication.id())
            .ipRules(            
                ApplicationNetworkRuleSetIpRuleArgs.builder()
                    .name("rule1")
                    .ipMask("10.0.1.0/24")
                    .build(),
                ApplicationNetworkRuleSetIpRuleArgs.builder()
                    .name("rule2")
                    .ipMask("10.1.1.0/24")
                    .build())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_application = azure.iotcentral.Application("exampleApplication",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    sub_domain="example-iotcentral-app-subdomain",
    display_name="example-iotcentral-app-display-name",
    sku="ST1",
    tags={
        "Foo": "Bar",
    })
example_application_network_rule_set = azure.iotcentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet",
    iotcentral_application_id=example_application.id,
    ip_rules=[
        azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs(
            name="rule1",
            ip_mask="10.0.1.0/24",
        ),
        azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs(
            name="rule2",
            ip_mask="10.1.1.0/24",
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleApplication = new azure.iotcentral.Application("exampleApplication", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    subDomain: "example-iotcentral-app-subdomain",
    displayName: "example-iotcentral-app-display-name",
    sku: "ST1",
    tags: {
        Foo: "Bar",
    },
});
const exampleApplicationNetworkRuleSet = new azure.iotcentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", {
    iotcentralApplicationId: exampleApplication.id,
    ipRules: [
        {
            name: "rule1",
            ipMask: "10.0.1.0/24",
        },
        {
            name: "rule2",
            ipMask: "10.1.1.0/24",
        },
    ],
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleApplication:
    type: azure:iotcentral:Application
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      subDomain: example-iotcentral-app-subdomain
      displayName: example-iotcentral-app-display-name
      sku: ST1
      tags:
        Foo: Bar
  exampleApplicationNetworkRuleSet:
    type: azure:iotcentral:ApplicationNetworkRuleSet
    properties:
      iotcentralApplicationId: ${exampleApplication.id}
      ipRules:
        - name: rule1
          ipMask: 10.0.1.0/24
        - name: rule2
          ipMask: 10.1.1.0/24

Create ApplicationNetworkRuleSet Resource

new ApplicationNetworkRuleSet(name: string, args: ApplicationNetworkRuleSetArgs, opts?: CustomResourceOptions);
@overload
def ApplicationNetworkRuleSet(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              apply_to_device: Optional[bool] = None,
                              default_action: Optional[str] = None,
                              iotcentral_application_id: Optional[str] = None,
                              ip_rules: Optional[Sequence[ApplicationNetworkRuleSetIpRuleArgs]] = None)
@overload
def ApplicationNetworkRuleSet(resource_name: str,
                              args: ApplicationNetworkRuleSetArgs,
                              opts: Optional[ResourceOptions] = None)
func NewApplicationNetworkRuleSet(ctx *Context, name string, args ApplicationNetworkRuleSetArgs, opts ...ResourceOption) (*ApplicationNetworkRuleSet, error)
public ApplicationNetworkRuleSet(string name, ApplicationNetworkRuleSetArgs args, CustomResourceOptions? opts = null)
public ApplicationNetworkRuleSet(String name, ApplicationNetworkRuleSetArgs args)
public ApplicationNetworkRuleSet(String name, ApplicationNetworkRuleSetArgs args, CustomResourceOptions options)
type: azure:iotcentral:ApplicationNetworkRuleSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ApplicationNetworkRuleSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ApplicationNetworkRuleSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ApplicationNetworkRuleSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApplicationNetworkRuleSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ApplicationNetworkRuleSetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ApplicationNetworkRuleSet Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ApplicationNetworkRuleSet resource accepts the following input properties:

IotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ApplyToDevice bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

DefaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

IpRules List<Pulumi.Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs>

One or more ip_rule blocks as defined below.

IotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ApplyToDevice bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

DefaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

IpRules []ApplicationNetworkRuleSetIpRuleArgs

One or more ip_rule blocks as defined below.

iotcentralApplicationId String

The ID of the IoT Central Application. Changing this forces a new resource to be created.

applyToDevice Boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction String

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

ipRules List<ApplicationNetworkRuleSetIpRuleArgs>

One or more ip_rule blocks as defined below.

iotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

applyToDevice boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

ipRules ApplicationNetworkRuleSetIpRuleArgs[]

One or more ip_rule blocks as defined below.

iotcentral_application_id str

The ID of the IoT Central Application. Changing this forces a new resource to be created.

apply_to_device bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

default_action str

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

ip_rules Sequence[ApplicationNetworkRuleSetIpRuleArgs]

One or more ip_rule blocks as defined below.

iotcentralApplicationId String

The ID of the IoT Central Application. Changing this forces a new resource to be created.

applyToDevice Boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction String

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

ipRules List<Property Map>

One or more ip_rule blocks as defined below.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApplicationNetworkRuleSet resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing ApplicationNetworkRuleSet Resource

Get an existing ApplicationNetworkRuleSet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApplicationNetworkRuleSetState, opts?: CustomResourceOptions): ApplicationNetworkRuleSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        apply_to_device: Optional[bool] = None,
        default_action: Optional[str] = None,
        iotcentral_application_id: Optional[str] = None,
        ip_rules: Optional[Sequence[ApplicationNetworkRuleSetIpRuleArgs]] = None) -> ApplicationNetworkRuleSet
func GetApplicationNetworkRuleSet(ctx *Context, name string, id IDInput, state *ApplicationNetworkRuleSetState, opts ...ResourceOption) (*ApplicationNetworkRuleSet, error)
public static ApplicationNetworkRuleSet Get(string name, Input<string> id, ApplicationNetworkRuleSetState? state, CustomResourceOptions? opts = null)
public static ApplicationNetworkRuleSet get(String name, Output<String> id, ApplicationNetworkRuleSetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApplyToDevice bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

DefaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

IotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

IpRules List<Pulumi.Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs>

One or more ip_rule blocks as defined below.

ApplyToDevice bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

DefaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

IotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

IpRules []ApplicationNetworkRuleSetIpRuleArgs

One or more ip_rule blocks as defined below.

applyToDevice Boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction String

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

iotcentralApplicationId String

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ipRules List<ApplicationNetworkRuleSetIpRuleArgs>

One or more ip_rule blocks as defined below.

applyToDevice boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction string

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

iotcentralApplicationId string

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ipRules ApplicationNetworkRuleSetIpRuleArgs[]

One or more ip_rule blocks as defined below.

apply_to_device bool

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

default_action str

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

iotcentral_application_id str

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ip_rules Sequence[ApplicationNetworkRuleSetIpRuleArgs]

One or more ip_rule blocks as defined below.

applyToDevice Boolean

Whether these IP Rules apply for device connectivity to IoT Hub and Device Provisioning Service associated with this IoT Central Application. Possible values are true, false. Defaults to true

defaultAction String

Specifies the default action for the IoT Central Application Network Rule Set. Possible values are Allow and Deny. Defaults to Deny.

iotcentralApplicationId String

The ID of the IoT Central Application. Changing this forces a new resource to be created.

ipRules List<Property Map>

One or more ip_rule blocks as defined below.

Supporting Types

ApplicationNetworkRuleSetIpRule

IpMask string

The IP address range in CIDR notation for the IP Rule.

Name string

The name of the IP Rule

IpMask string

The IP address range in CIDR notation for the IP Rule.

Name string

The name of the IP Rule

ipMask String

The IP address range in CIDR notation for the IP Rule.

name String

The name of the IP Rule

ipMask string

The IP address range in CIDR notation for the IP Rule.

name string

The name of the IP Rule

ip_mask str

The IP address range in CIDR notation for the IP Rule.

name str

The name of the IP Rule

ipMask String

The IP address range in CIDR notation for the IP Rule.

name String

The name of the IP Rule

Import

IoT Central Application Network Rule Sets can be imported using the resource id, e.g.

 $ pulumi import azure:iotcentral/applicationNetworkRuleSet:ApplicationNetworkRuleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.IoTCentral/iotApps/app1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.