1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cr
  5. ChartRepository
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cr.ChartRepository

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a CR Chart Repository resource.

    For information about CR Chart Repository and how to use it, see What is Chart Repository.

    NOTE: Available since v1.149.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const _default = new random.index.Integer("default", {
        min: 100000,
        max: 999999,
    });
    const example = new alicloud.cr.RegistryEnterpriseInstance("example", {
        paymentType: "Subscription",
        period: 1,
        renewPeriod: 0,
        renewalStatus: "ManualRenewal",
        instanceType: "Advanced",
        instanceName: `${name}-${_default.result}`,
    });
    const exampleChartNamespace = new alicloud.cr.ChartNamespace("example", {
        instanceId: example.id,
        namespaceName: `${name}-${_default.result}`,
    });
    const exampleChartRepository = new alicloud.cr.ChartRepository("example", {
        repoNamespaceName: exampleChartNamespace.namespaceName,
        instanceId: exampleChartNamespace.instanceId,
        repoName: `${name}-${_default.result}`,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = random.index.Integer("default",
        min=100000,
        max=999999)
    example = alicloud.cr.RegistryEnterpriseInstance("example",
        payment_type="Subscription",
        period=1,
        renew_period=0,
        renewal_status="ManualRenewal",
        instance_type="Advanced",
        instance_name=f"{name}-{default['result']}")
    example_chart_namespace = alicloud.cr.ChartNamespace("example",
        instance_id=example.id,
        namespace_name=f"{name}-{default['result']}")
    example_chart_repository = alicloud.cr.ChartRepository("example",
        repo_namespace_name=example_chart_namespace.namespace_name,
        instance_id=example_chart_namespace.instance_id,
        repo_name=f"{name}-{default['result']}")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"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
    		}
    		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 100000,
    			Max: 999999,
    		})
    		if err != nil {
    			return err
    		}
    		example, err := cr.NewRegistryEnterpriseInstance(ctx, "example", &cr.RegistryEnterpriseInstanceArgs{
    			PaymentType:   pulumi.String("Subscription"),
    			Period:        pulumi.Int(1),
    			RenewPeriod:   pulumi.Int(0),
    			RenewalStatus: pulumi.String("ManualRenewal"),
    			InstanceType:  pulumi.String("Advanced"),
    			InstanceName:  pulumi.Sprintf("%v-%v", name, _default.Result),
    		})
    		if err != nil {
    			return err
    		}
    		exampleChartNamespace, err := cr.NewChartNamespace(ctx, "example", &cr.ChartNamespaceArgs{
    			InstanceId:    example.ID(),
    			NamespaceName: pulumi.Sprintf("%v-%v", name, _default.Result),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cr.NewChartRepository(ctx, "example", &cr.ChartRepositoryArgs{
    			RepoNamespaceName: exampleChartNamespace.NamespaceName,
    			InstanceId:        exampleChartNamespace.InstanceId,
    			RepoName:          pulumi.Sprintf("%v-%v", name, _default.Result),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = new Random.Index.Integer("default", new()
        {
            Min = 100000,
            Max = 999999,
        });
    
        var example = new AliCloud.CR.RegistryEnterpriseInstance("example", new()
        {
            PaymentType = "Subscription",
            Period = 1,
            RenewPeriod = 0,
            RenewalStatus = "ManualRenewal",
            InstanceType = "Advanced",
            InstanceName = $"{name}-{@default.Result}",
        });
    
        var exampleChartNamespace = new AliCloud.CR.ChartNamespace("example", new()
        {
            InstanceId = example.Id,
            NamespaceName = $"{name}-{@default.Result}",
        });
    
        var exampleChartRepository = new AliCloud.CR.ChartRepository("example", new()
        {
            RepoNamespaceName = exampleChartNamespace.NamespaceName,
            InstanceId = exampleChartNamespace.InstanceId,
            RepoName = $"{name}-{@default.Result}",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstance;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstanceArgs;
    import com.pulumi.alicloud.cr.ChartNamespace;
    import com.pulumi.alicloud.cr.ChartNamespaceArgs;
    import com.pulumi.alicloud.cr.ChartRepository;
    import com.pulumi.alicloud.cr.ChartRepositoryArgs;
    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 default_ = new Integer("default", IntegerArgs.builder()
                .min(100000)
                .max(999999)
                .build());
    
            var example = new RegistryEnterpriseInstance("example", RegistryEnterpriseInstanceArgs.builder()
                .paymentType("Subscription")
                .period(1)
                .renewPeriod(0)
                .renewalStatus("ManualRenewal")
                .instanceType("Advanced")
                .instanceName(String.format("%s-%s", name,default_.result()))
                .build());
    
            var exampleChartNamespace = new ChartNamespace("exampleChartNamespace", ChartNamespaceArgs.builder()
                .instanceId(example.id())
                .namespaceName(String.format("%s-%s", name,default_.result()))
                .build());
    
            var exampleChartRepository = new ChartRepository("exampleChartRepository", ChartRepositoryArgs.builder()
                .repoNamespaceName(exampleChartNamespace.namespaceName())
                .instanceId(exampleChartNamespace.instanceId())
                .repoName(String.format("%s-%s", name,default_.result()))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      default:
        type: random:integer
        properties:
          min: 100000
          max: 999999
      example:
        type: alicloud:cr:RegistryEnterpriseInstance
        properties:
          paymentType: Subscription
          period: 1
          renewPeriod: 0
          renewalStatus: ManualRenewal
          instanceType: Advanced
          instanceName: ${name}-${default.result}
      exampleChartNamespace:
        type: alicloud:cr:ChartNamespace
        name: example
        properties:
          instanceId: ${example.id}
          namespaceName: ${name}-${default.result}
      exampleChartRepository:
        type: alicloud:cr:ChartRepository
        name: example
        properties:
          repoNamespaceName: ${exampleChartNamespace.namespaceName}
          instanceId: ${exampleChartNamespace.instanceId}
          repoName: ${name}-${default.result}
    

    Create ChartRepository Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ChartRepository(name: string, args: ChartRepositoryArgs, opts?: CustomResourceOptions);
    @overload
    def ChartRepository(resource_name: str,
                        args: ChartRepositoryArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def ChartRepository(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        instance_id: Optional[str] = None,
                        repo_name: Optional[str] = None,
                        repo_namespace_name: Optional[str] = None,
                        repo_type: Optional[str] = None,
                        summary: Optional[str] = None)
    func NewChartRepository(ctx *Context, name string, args ChartRepositoryArgs, opts ...ResourceOption) (*ChartRepository, error)
    public ChartRepository(string name, ChartRepositoryArgs args, CustomResourceOptions? opts = null)
    public ChartRepository(String name, ChartRepositoryArgs args)
    public ChartRepository(String name, ChartRepositoryArgs args, CustomResourceOptions options)
    
    type: alicloud:cr:ChartRepository
    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 ChartRepositoryArgs
    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 ChartRepositoryArgs
    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 ChartRepositoryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ChartRepositoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ChartRepositoryArgs
    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 chartRepositoryResource = new AliCloud.CR.ChartRepository("chartRepositoryResource", new()
    {
        InstanceId = "string",
        RepoName = "string",
        RepoNamespaceName = "string",
        RepoType = "string",
        Summary = "string",
    });
    
    example, err := cr.NewChartRepository(ctx, "chartRepositoryResource", &cr.ChartRepositoryArgs{
    	InstanceId:        pulumi.String("string"),
    	RepoName:          pulumi.String("string"),
    	RepoNamespaceName: pulumi.String("string"),
    	RepoType:          pulumi.String("string"),
    	Summary:           pulumi.String("string"),
    })
    
    var chartRepositoryResource = new ChartRepository("chartRepositoryResource", ChartRepositoryArgs.builder()
        .instanceId("string")
        .repoName("string")
        .repoNamespaceName("string")
        .repoType("string")
        .summary("string")
        .build());
    
    chart_repository_resource = alicloud.cr.ChartRepository("chartRepositoryResource",
        instance_id="string",
        repo_name="string",
        repo_namespace_name="string",
        repo_type="string",
        summary="string")
    
    const chartRepositoryResource = new alicloud.cr.ChartRepository("chartRepositoryResource", {
        instanceId: "string",
        repoName: "string",
        repoNamespaceName: "string",
        repoType: "string",
        summary: "string",
    });
    
    type: alicloud:cr:ChartRepository
    properties:
        instanceId: string
        repoName: string
        repoNamespaceName: string
        repoType: string
        summary: string
    

    ChartRepository Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ChartRepository resource accepts the following input properties:

    InstanceId string
    The ID of the Container Registry instance.
    RepoName string
    The name of the repository that you want to create.
    RepoNamespaceName string
    The namespace to which the repository belongs.
    RepoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    Summary string
    The summary about the repository.
    InstanceId string
    The ID of the Container Registry instance.
    RepoName string
    The name of the repository that you want to create.
    RepoNamespaceName string
    The namespace to which the repository belongs.
    RepoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    Summary string
    The summary about the repository.
    instanceId String
    The ID of the Container Registry instance.
    repoName String
    The name of the repository that you want to create.
    repoNamespaceName String
    The namespace to which the repository belongs.
    repoType String
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary String
    The summary about the repository.
    instanceId string
    The ID of the Container Registry instance.
    repoName string
    The name of the repository that you want to create.
    repoNamespaceName string
    The namespace to which the repository belongs.
    repoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary string
    The summary about the repository.
    instance_id str
    The ID of the Container Registry instance.
    repo_name str
    The name of the repository that you want to create.
    repo_namespace_name str
    The namespace to which the repository belongs.
    repo_type str
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary str
    The summary about the repository.
    instanceId String
    The ID of the Container Registry instance.
    repoName String
    The name of the repository that you want to create.
    repoNamespaceName String
    The namespace to which the repository belongs.
    repoType String
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary String
    The summary about the repository.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ChartRepository resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ChartRepository Resource

    Get an existing ChartRepository 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?: ChartRepositoryState, opts?: CustomResourceOptions): ChartRepository
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            repo_name: Optional[str] = None,
            repo_namespace_name: Optional[str] = None,
            repo_type: Optional[str] = None,
            summary: Optional[str] = None) -> ChartRepository
    func GetChartRepository(ctx *Context, name string, id IDInput, state *ChartRepositoryState, opts ...ResourceOption) (*ChartRepository, error)
    public static ChartRepository Get(string name, Input<string> id, ChartRepositoryState? state, CustomResourceOptions? opts = null)
    public static ChartRepository get(String name, Output<String> id, ChartRepositoryState 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.
    The following state arguments are supported:
    InstanceId string
    The ID of the Container Registry instance.
    RepoName string
    The name of the repository that you want to create.
    RepoNamespaceName string
    The namespace to which the repository belongs.
    RepoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    Summary string
    The summary about the repository.
    InstanceId string
    The ID of the Container Registry instance.
    RepoName string
    The name of the repository that you want to create.
    RepoNamespaceName string
    The namespace to which the repository belongs.
    RepoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    Summary string
    The summary about the repository.
    instanceId String
    The ID of the Container Registry instance.
    repoName String
    The name of the repository that you want to create.
    repoNamespaceName String
    The namespace to which the repository belongs.
    repoType String
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary String
    The summary about the repository.
    instanceId string
    The ID of the Container Registry instance.
    repoName string
    The name of the repository that you want to create.
    repoNamespaceName string
    The namespace to which the repository belongs.
    repoType string
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary string
    The summary about the repository.
    instance_id str
    The ID of the Container Registry instance.
    repo_name str
    The name of the repository that you want to create.
    repo_namespace_name str
    The namespace to which the repository belongs.
    repo_type str
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary str
    The summary about the repository.
    instanceId String
    The ID of the Container Registry instance.
    repoName String
    The name of the repository that you want to create.
    repoNamespaceName String
    The namespace to which the repository belongs.
    repoType String
    The default repository type. Valid values: PUBLIC,PRIVATE.
    summary String
    The summary about the repository.

    Import

    CR Chart Repository can be imported using the id, e.g.

    $ pulumi import alicloud:cr/chartRepository:ChartRepository example <instance_id>:<repo_namespace_name>:<repo_name>
    

    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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi