ResourceSyncRuleArgs

data class ResourceSyncRuleArgs(val childResourceName: Output<String>? = null, val location: Output<String>? = null, val priority: Output<Int>? = null, val resourceGroupName: Output<String>? = null, val resourceName: Output<String>? = null, val selector: Output<ResourceSyncRulePropertiesSelectorArgs>? = null, val tags: Output<Map<String, String>>? = null, val targetResourceGroup: Output<String>? = null) : ConvertibleToJava<ResourceSyncRuleArgs>

Resource Sync Rules definition. Uses Azure REST API version 2021-08-31-preview. In version 1.x of the Azure Native provider, it used API version 2021-08-31-preview.

Example Usage

Create/Update Resource Sync Rule

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var resourceSyncRule = new AzureNative.ExtendedLocation.ResourceSyncRule("resourceSyncRule", new()
{
ChildResourceName = "resourceSyncRule01",
Location = "West US",
Priority = 999,
ResourceGroupName = "testresourcegroup",
ResourceName = "customLocation01",
Selector = new AzureNative.ExtendedLocation.Inputs.ResourceSyncRulePropertiesSelectorArgs
{
MatchLabels =
{
{ "key1", "value1" },
},
},
TargetResourceGroup = "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup",
});
});
package main
import (
extendedlocation "github.com/pulumi/pulumi-azure-native-sdk/extendedlocation/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := extendedlocation.NewResourceSyncRule(ctx, "resourceSyncRule", &extendedlocation.ResourceSyncRuleArgs{
ChildResourceName: pulumi.String("resourceSyncRule01"),
Location: pulumi.String("West US"),
Priority: pulumi.Int(999),
ResourceGroupName: pulumi.String("testresourcegroup"),
ResourceName: pulumi.String("customLocation01"),
Selector: &extendedlocation.ResourceSyncRulePropertiesSelectorArgs{
MatchLabels: pulumi.StringMap{
"key1": pulumi.String("value1"),
},
},
TargetResourceGroup: pulumi.String("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup"),
})
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.azurenative.extendedlocation.ResourceSyncRule;
import com.pulumi.azurenative.extendedlocation.ResourceSyncRuleArgs;
import com.pulumi.azurenative.extendedlocation.inputs.ResourceSyncRulePropertiesSelectorArgs;
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 resourceSyncRule = new ResourceSyncRule("resourceSyncRule", ResourceSyncRuleArgs.builder()
.childResourceName("resourceSyncRule01")
.location("West US")
.priority(999)
.resourceGroupName("testresourcegroup")
.resourceName("customLocation01")
.selector(ResourceSyncRulePropertiesSelectorArgs.builder()
.matchLabels(Map.of("key1", "value1"))
.build())
.targetResourceGroup("/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:extendedlocation:ResourceSyncRule resourceSyncRule01 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}

Constructors

Link copied to clipboard
constructor(childResourceName: Output<String>? = null, location: Output<String>? = null, priority: Output<Int>? = null, resourceGroupName: Output<String>? = null, resourceName: Output<String>? = null, selector: Output<ResourceSyncRulePropertiesSelectorArgs>? = null, tags: Output<Map<String, String>>? = null, targetResourceGroup: Output<String>? = null)

Properties

Link copied to clipboard
val childResourceName: Output<String>? = null

Resource Sync Rule name.

Link copied to clipboard
val location: Output<String>? = null

The geo-location where the resource lives

Link copied to clipboard
val priority: Output<Int>? = null

Priority represents a priority of the Resource Sync Rule

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val resourceName: Output<String>? = null

Custom Locations name.

Link copied to clipboard

A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Resource tags.

Link copied to clipboard
val targetResourceGroup: Output<String>? = null

For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule.

Functions

Link copied to clipboard
open override fun toJava(): ResourceSyncRuleArgs