alicloud.cr.Repo
Explore with Pulumi AI
This resource will help you to manager Container Registry repositories, see What is Repository.
NOTE: Available since v1.35.0.
NOTE: You need to set your registry password in Container Registry console before use this resource.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const example = new alicloud.cr.Namespace("example", {
name: name,
autoCreate: false,
defaultVisibility: "PUBLIC",
});
const exampleRepo = new alicloud.cr.Repo("example", {
namespace: example.name,
name: name,
summary: "this is summary of my new repo",
repoType: "PUBLIC",
detail: "this is a public repo",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
example = alicloud.cr.Namespace("example",
name=name,
auto_create=False,
default_visibility="PUBLIC")
example_repo = alicloud.cr.Repo("example",
namespace=example.name,
name=name,
summary="this is summary of my new repo",
repo_type="PUBLIC",
detail="this is a public repo")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
example, err := cr.NewNamespace(ctx, "example", &cr.NamespaceArgs{
Name: pulumi.String(name),
AutoCreate: pulumi.Bool(false),
DefaultVisibility: pulumi.String("PUBLIC"),
})
if err != nil {
return err
}
_, err = cr.NewRepo(ctx, "example", &cr.RepoArgs{
Namespace: example.Name,
Name: pulumi.String(name),
Summary: pulumi.String("this is summary of my new repo"),
RepoType: pulumi.String("PUBLIC"),
Detail: pulumi.String("this is a public repo"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var example = new AliCloud.CR.Namespace("example", new()
{
Name = name,
AutoCreate = false,
DefaultVisibility = "PUBLIC",
});
var exampleRepo = new AliCloud.CR.Repo("example", new()
{
Namespace = example.Name,
Name = name,
Summary = "this is summary of my new repo",
RepoType = "PUBLIC",
Detail = "this is a public repo",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cr.Namespace;
import com.pulumi.alicloud.cr.NamespaceArgs;
import com.pulumi.alicloud.cr.Repo;
import com.pulumi.alicloud.cr.RepoArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var example = new Namespace("example", NamespaceArgs.builder()
.name(name)
.autoCreate(false)
.defaultVisibility("PUBLIC")
.build());
var exampleRepo = new Repo("exampleRepo", RepoArgs.builder()
.namespace(example.name())
.name(name)
.summary("this is summary of my new repo")
.repoType("PUBLIC")
.detail("this is a public repo")
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
example:
type: alicloud:cr:Namespace
properties:
name: ${name}
autoCreate: false
defaultVisibility: PUBLIC
exampleRepo:
type: alicloud:cr:Repo
name: example
properties:
namespace: ${example.name}
name: ${name}
summary: this is summary of my new repo
repoType: PUBLIC
detail: this is a public repo
Create Repo Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Repo(name: string, args: RepoArgs, opts?: CustomResourceOptions);
@overload
def Repo(resource_name: str,
args: RepoArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Repo(resource_name: str,
opts: Optional[ResourceOptions] = None,
namespace: Optional[str] = None,
repo_type: Optional[str] = None,
summary: Optional[str] = None,
detail: Optional[str] = None,
name: Optional[str] = None)
func NewRepo(ctx *Context, name string, args RepoArgs, opts ...ResourceOption) (*Repo, error)
public Repo(string name, RepoArgs args, CustomResourceOptions? opts = null)
type: alicloud:cr:Repo
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 RepoArgs
- 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 RepoArgs
- 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 RepoArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepoArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepoArgs
- 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 repoResource = new AliCloud.CR.Repo("repoResource", new()
{
Namespace = "string",
RepoType = "string",
Summary = "string",
Detail = "string",
Name = "string",
});
example, err := cr.NewRepo(ctx, "repoResource", &cr.RepoArgs{
Namespace: pulumi.String("string"),
RepoType: pulumi.String("string"),
Summary: pulumi.String("string"),
Detail: pulumi.String("string"),
Name: pulumi.String("string"),
})
var repoResource = new Repo("repoResource", RepoArgs.builder()
.namespace("string")
.repoType("string")
.summary("string")
.detail("string")
.name("string")
.build());
repo_resource = alicloud.cr.Repo("repoResource",
namespace="string",
repo_type="string",
summary="string",
detail="string",
name="string")
const repoResource = new alicloud.cr.Repo("repoResource", {
namespace: "string",
repoType: "string",
summary: "string",
detail: "string",
name: "string",
});
type: alicloud:cr:Repo
properties:
detail: string
name: string
namespace: string
repoType: string
summary: string
Repo 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 Repo resource accepts the following input properties:
- Namespace string
- Name of container registry namespace where repository is located.
- Repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- Summary string
- The repository general information. It can contain 1 to 80 characters.
- Detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- Name string
- Name of container registry repository.
- Namespace string
- Name of container registry namespace where repository is located.
- Repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- Summary string
- The repository general information. It can contain 1 to 80 characters.
- Detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- Name string
- Name of container registry repository.
- namespace String
- Name of container registry namespace where repository is located.
- repo
Type String PUBLIC
orPRIVATE
, repo's visibility.- summary String
- The repository general information. It can contain 1 to 80 characters.
- detail String
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- name String
- Name of container registry repository.
- namespace string
- Name of container registry namespace where repository is located.
- repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- summary string
- The repository general information. It can contain 1 to 80 characters.
- detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- name string
- Name of container registry repository.
- namespace str
- Name of container registry namespace where repository is located.
- repo_
type str PUBLIC
orPRIVATE
, repo's visibility.- summary str
- The repository general information. It can contain 1 to 80 characters.
- detail str
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- name str
- Name of container registry repository.
- namespace String
- Name of container registry namespace where repository is located.
- repo
Type String PUBLIC
orPRIVATE
, repo's visibility.- summary String
- The repository general information. It can contain 1 to 80 characters.
- detail String
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- name String
- Name of container registry repository.
Outputs
All input properties are implicitly available as output properties. Additionally, the Repo resource produces the following output properties:
- Domain
List Pulumi.Ali Cloud. CR. Outputs. Repo Domain List - The repository domain list.
- Id string
- The provider-assigned unique ID for this managed resource.
- Domain
List RepoDomain List - The repository domain list.
- Id string
- The provider-assigned unique ID for this managed resource.
- domain
List RepoDomain List - The repository domain list.
- id String
- The provider-assigned unique ID for this managed resource.
- domain
List RepoDomain List - The repository domain list.
- id string
- The provider-assigned unique ID for this managed resource.
- domain_
list RepoDomain List - The repository domain list.
- id str
- The provider-assigned unique ID for this managed resource.
- domain
List Property Map - The repository domain list.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Repo Resource
Get an existing Repo resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RepoState, opts?: CustomResourceOptions): Repo
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
detail: Optional[str] = None,
domain_list: Optional[RepoDomainListArgs] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
repo_type: Optional[str] = None,
summary: Optional[str] = None) -> Repo
func GetRepo(ctx *Context, name string, id IDInput, state *RepoState, opts ...ResourceOption) (*Repo, error)
public static Repo Get(string name, Input<string> id, RepoState? state, CustomResourceOptions? opts = null)
public static Repo get(String name, Output<String> id, RepoState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- Domain
List Pulumi.Ali Cloud. CR. Inputs. Repo Domain List - The repository domain list.
- Name string
- Name of container registry repository.
- Namespace string
- Name of container registry namespace where repository is located.
- Repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- Summary string
- The repository general information. It can contain 1 to 80 characters.
- Detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- Domain
List RepoDomain List Args - The repository domain list.
- Name string
- Name of container registry repository.
- Namespace string
- Name of container registry namespace where repository is located.
- Repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- Summary string
- The repository general information. It can contain 1 to 80 characters.
- detail String
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- domain
List RepoDomain List - The repository domain list.
- name String
- Name of container registry repository.
- namespace String
- Name of container registry namespace where repository is located.
- repo
Type String PUBLIC
orPRIVATE
, repo's visibility.- summary String
- The repository general information. It can contain 1 to 80 characters.
- detail string
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- domain
List RepoDomain List - The repository domain list.
- name string
- Name of container registry repository.
- namespace string
- Name of container registry namespace where repository is located.
- repo
Type string PUBLIC
orPRIVATE
, repo's visibility.- summary string
- The repository general information. It can contain 1 to 80 characters.
- detail str
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- domain_
list RepoDomain List Args - The repository domain list.
- name str
- Name of container registry repository.
- namespace str
- Name of container registry namespace where repository is located.
- repo_
type str PUBLIC
orPRIVATE
, repo's visibility.- summary str
- The repository general information. It can contain 1 to 80 characters.
- detail String
- The repository specific information. MarkDown format is supported, and the length limit is 2000.
- domain
List Property Map - The repository domain list.
- name String
- Name of container registry repository.
- namespace String
- Name of container registry namespace where repository is located.
- repo
Type String PUBLIC
orPRIVATE
, repo's visibility.- summary String
- The repository general information. It can contain 1 to 80 characters.
Supporting Types
RepoDomainList, RepoDomainListArgs
Import
Container Registry repository can be imported using the namespace/repository
, e.g.
$ pulumi import alicloud:cr/repo:Repo default `my-namespace/my-repo`
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.