CacheRuleArgs

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 2024-11-01-preview. In version 2.x of the Azure Native provider, it used API version 2023-01-01-preview. Other available API versions: 2023-01-01-preview, 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native containerregistry [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

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",
});
});
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
})
}
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());
}
}

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}

Constructors

Link copied to clipboard
constructor(cacheRuleName: Output<String>? = null, credentialSetResourceId: Output<String>? = null, registryName: Output<String>? = null, resourceGroupName: Output<String>? = null, sourceRepository: Output<String>? = null, targetRepository: Output<String>? = null)

Properties

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

The name of the cache rule.

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

The ARM resource ID of the credential store which is associated with the cache rule.

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

The name of the container registry.

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 sourceRepository: Output<String>? = null

Source repository pulled from upstream.

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

Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}

Functions

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