Cache Rule Args
data class CacheRuleArgs(val cacheRuleName: Output<String>? = null, val credentialSetResourceId: Output<String>? = null, val registryName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val sourceRepository: Output<String>? = null, val targetRepository: Output<String>? = null) : ConvertibleToJava<CacheRuleArgs>
An object that represents a cache rule for a container registry. Uses Azure REST API version 2023-01-01-preview. Other available API versions: 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview, 2024-11-01-preview.
Example Usage
CacheRuleCreate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cacheRule = new AzureNative.ContainerRegistry.CacheRule("cacheRule", new()
{
CacheRuleName = "myCacheRule",
CredentialSetResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet",
RegistryName = "myRegistry",
ResourceGroupName = "myResourceGroup",
SourceRepository = "docker.io/library/hello-world",
TargetRepository = "cached-docker-hub/hello-world",
});
});
Content copied to clipboard
package main
import (
containerregistry "github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := containerregistry.NewCacheRule(ctx, "cacheRule", &containerregistry.CacheRuleArgs{
CacheRuleName: pulumi.String("myCacheRule"),
CredentialSetResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
RegistryName: pulumi.String("myRegistry"),
ResourceGroupName: pulumi.String("myResourceGroup"),
SourceRepository: pulumi.String("docker.io/library/hello-world"),
TargetRepository: pulumi.String("cached-docker-hub/hello-world"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.CacheRule;
import com.pulumi.azurenative.containerregistry.CacheRuleArgs;
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 cacheRule = new CacheRule("cacheRule", CacheRuleArgs.builder()
.cacheRuleName("myCacheRule")
.credentialSetResourceId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet")
.registryName("myRegistry")
.resourceGroupName("myResourceGroup")
.sourceRepository("docker.io/library/hello-world")
.targetRepository("cached-docker-hub/hello-world")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:containerregistry:CacheRule myCacheRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}
Content copied to clipboard
Properties
Link copied to clipboard
The name of the cache rule.
Link copied to clipboard
The ARM resource ID of the credential store which is associated with the cache rule.
Link copied to clipboard
The name of the container registry.
Link copied to clipboard
The name of the resource group. The name is case insensitive.
Link copied to clipboard
Source repository pulled from upstream.
Link copied to clipboard
Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}