azure-native.containerregistry.CacheRule
Explore with Pulumi AI
An object that represents a cache rule for a container registry. 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.
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 pulumi
import pulumi_azure_native as azure_native
cache_rule = azure_native.containerregistry.CacheRule("cacheRule",
cache_rule_name="myCacheRule",
credential_set_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet",
registry_name="myRegistry",
resource_group_name="myResourceGroup",
source_repository="docker.io/library/hello-world",
target_repository="cached-docker-hub/hello-world")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const cacheRule = new azure_native.containerregistry.CacheRule("cacheRule", {
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",
});
resources:
cacheRule:
type: azure-native:containerregistry:CacheRule
properties:
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
Create CacheRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CacheRule(name: string, args: CacheRuleArgs, opts?: CustomResourceOptions);
@overload
def CacheRule(resource_name: str,
args: CacheRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CacheRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
registry_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
cache_rule_name: Optional[str] = None,
credential_set_resource_id: Optional[str] = None,
source_repository: Optional[str] = None,
target_repository: Optional[str] = None)
func NewCacheRule(ctx *Context, name string, args CacheRuleArgs, opts ...ResourceOption) (*CacheRule, error)
public CacheRule(string name, CacheRuleArgs args, CustomResourceOptions? opts = null)
public CacheRule(String name, CacheRuleArgs args)
public CacheRule(String name, CacheRuleArgs args, CustomResourceOptions options)
type: azure-native:containerregistry:CacheRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CacheRuleArgs
- 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 CacheRuleArgs
- 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 CacheRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var cacheRuleResource = new AzureNative.ContainerRegistry.CacheRule("cacheRuleResource", new()
{
RegistryName = "string",
ResourceGroupName = "string",
CacheRuleName = "string",
CredentialSetResourceId = "string",
SourceRepository = "string",
TargetRepository = "string",
});
example, err := containerregistry.NewCacheRule(ctx, "cacheRuleResource", &containerregistry.CacheRuleArgs{
RegistryName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
CacheRuleName: pulumi.String("string"),
CredentialSetResourceId: pulumi.String("string"),
SourceRepository: pulumi.String("string"),
TargetRepository: pulumi.String("string"),
})
var cacheRuleResource = new CacheRule("cacheRuleResource", CacheRuleArgs.builder()
.registryName("string")
.resourceGroupName("string")
.cacheRuleName("string")
.credentialSetResourceId("string")
.sourceRepository("string")
.targetRepository("string")
.build());
cache_rule_resource = azure_native.containerregistry.CacheRule("cacheRuleResource",
registry_name="string",
resource_group_name="string",
cache_rule_name="string",
credential_set_resource_id="string",
source_repository="string",
target_repository="string")
const cacheRuleResource = new azure_native.containerregistry.CacheRule("cacheRuleResource", {
registryName: "string",
resourceGroupName: "string",
cacheRuleName: "string",
credentialSetResourceId: "string",
sourceRepository: "string",
targetRepository: "string",
});
type: azure-native:containerregistry:CacheRule
properties:
cacheRuleName: string
credentialSetResourceId: string
registryName: string
resourceGroupName: string
sourceRepository: string
targetRepository: string
CacheRule 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 CacheRule resource accepts the following input properties:
- Registry
Name string - The name of the container registry.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Cache
Rule stringName - The name of the cache rule.
- Credential
Set stringResource Id - The ARM resource ID of the credential store which is associated with the cache rule.
- Source
Repository string - Source repository pulled from upstream.
- Target
Repository string - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
- Registry
Name string - The name of the container registry.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Cache
Rule stringName - The name of the cache rule.
- Credential
Set stringResource Id - The ARM resource ID of the credential store which is associated with the cache rule.
- Source
Repository string - Source repository pulled from upstream.
- Target
Repository string - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
- registry
Name String - The name of the container registry.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- cache
Rule StringName - The name of the cache rule.
- credential
Set StringResource Id - The ARM resource ID of the credential store which is associated with the cache rule.
- source
Repository String - Source repository pulled from upstream.
- target
Repository String - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
- registry
Name string - The name of the container registry.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- cache
Rule stringName - The name of the cache rule.
- credential
Set stringResource Id - The ARM resource ID of the credential store which is associated with the cache rule.
- source
Repository string - Source repository pulled from upstream.
- target
Repository string - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
- registry_
name str - The name of the container registry.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- cache_
rule_ strname - The name of the cache rule.
- credential_
set_ strresource_ id - The ARM resource ID of the credential store which is associated with the cache rule.
- source_
repository str - Source repository pulled from upstream.
- target_
repository str - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
- registry
Name String - The name of the container registry.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- cache
Rule StringName - The name of the cache rule.
- credential
Set StringResource Id - The ARM resource ID of the credential store which is associated with the cache rule.
- source
Repository String - Source repository pulled from upstream.
- target
Repository String - Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
Outputs
All input properties are implicitly available as output properties. Additionally, the CacheRule resource produces the following output properties:
- Creation
Date string - The creation date of the cache rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource.
- Provisioning
State string - Provisioning state of the resource.
- System
Data Pulumi.Azure Native. Container Registry. Outputs. System Data Response - Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource.
- Creation
Date string - The creation date of the cache rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource.
- Provisioning
State string - Provisioning state of the resource.
- System
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- Type string
- The type of the resource.
- creation
Date String - The creation date of the cache rule.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource.
- provisioning
State String - Provisioning state of the resource.
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource.
- creation
Date string - The creation date of the cache rule.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource.
- provisioning
State string - Provisioning state of the resource.
- system
Data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type string
- The type of the resource.
- creation_
date str - The creation date of the cache rule.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource.
- provisioning_
state str - Provisioning state of the resource.
- system_
data SystemData Response - Metadata pertaining to creation and last modification of the resource.
- type str
- The type of the resource.
- creation
Date String - The creation date of the cache rule.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource.
- provisioning
State String - Provisioning state of the resource.
- system
Data Property Map - Metadata pertaining to creation and last modification of the resource.
- type String
- The type of the resource.
Supporting Types
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource modification (UTC).
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource modification (UTC).
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource modification (UTC).
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource modification (UTC).
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource modification (UTC).
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource modification (UTC).
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
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}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0