Resource Sync Rule Args
Resource Sync Rules definition. Uses Azure REST API version 2021-08-31-preview. In version 2.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
Properties
Resource Sync Rule name.
The name of the resource group. The name is case insensitive.
Custom Locations name.
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.
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.