1. Packages
  2. Alicloud Provider
  3. API Docs
  4. cr
  5. EndpointAclPolicy
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.cr.EndpointAclPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a CR Endpoint Acl Policy resource.

    For information about CR Endpoint Acl Policy and how to use it, see What is Endpoint Acl Policy.

    NOTE: Available since v1.139.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 defaultInteger = new random.index.Integer("default", {
        min: 10000000,
        max: 99999999,
    });
    const defaultRegistryEnterpriseInstance = new alicloud.cr.RegistryEnterpriseInstance("default", {
        paymentType: "Subscription",
        period: 1,
        renewalStatus: "ManualRenewal",
        instanceType: "Advanced",
        instanceName: `${name}-${defaultInteger.result}`,
    });
    const default = alicloud.cr.getEndpointAclServiceOutput({
        endpointType: "internet",
        enable: true,
        instanceId: defaultRegistryEnterpriseInstance.id,
        moduleName: "Registry",
    });
    const defaultEndpointAclPolicy = new alicloud.cr.EndpointAclPolicy("default", {
        instanceId: _default.apply(_default => _default.instanceId),
        entry: "192.168.1.0/24",
        description: name,
        moduleName: "Registry",
        endpointType: "internet",
    });
    
    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_integer = random.index.Integer("default",
        min=10000000,
        max=99999999)
    default_registry_enterprise_instance = alicloud.cr.RegistryEnterpriseInstance("default",
        payment_type="Subscription",
        period=1,
        renewal_status="ManualRenewal",
        instance_type="Advanced",
        instance_name=f"{name}-{default_integer['result']}")
    default = alicloud.cr.get_endpoint_acl_service_output(endpoint_type="internet",
        enable=True,
        instance_id=default_registry_enterprise_instance.id,
        module_name="Registry")
    default_endpoint_acl_policy = alicloud.cr.EndpointAclPolicy("default",
        instance_id=default.instance_id,
        entry="192.168.1.0/24",
        description=name,
        module_name="Registry",
        endpoint_type="internet")
    
    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
    }
    defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    Min: 10000000,
    Max: 99999999,
    })
    if err != nil {
    return err
    }
    defaultRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "default", &cr.RegistryEnterpriseInstanceArgs{
    PaymentType: pulumi.String("Subscription"),
    Period: pulumi.Int(1),
    RenewalStatus: pulumi.String("ManualRenewal"),
    InstanceType: pulumi.String("Advanced"),
    InstanceName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    })
    if err != nil {
    return err
    }
    _default := cr.GetEndpointAclServiceOutput(ctx, cr.GetEndpointAclServiceOutputArgs{
    EndpointType: pulumi.String("internet"),
    Enable: pulumi.Bool(true),
    InstanceId: defaultRegistryEnterpriseInstance.ID(),
    ModuleName: pulumi.String("Registry"),
    }, nil);
    _, err = cr.NewEndpointAclPolicy(ctx, "default", &cr.EndpointAclPolicyArgs{
    InstanceId: pulumi.String(_default.ApplyT(func(_default cr.GetEndpointAclServiceResult) (*string, error) {
    return &default.InstanceId, nil
    }).(pulumi.StringPtrOutput)),
    Entry: pulumi.String("192.168.1.0/24"),
    Description: pulumi.String(name),
    ModuleName: pulumi.String("Registry"),
    EndpointType: pulumi.String("internet"),
    })
    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 defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000000,
            Max = 99999999,
        });
    
        var defaultRegistryEnterpriseInstance = new AliCloud.CR.RegistryEnterpriseInstance("default", new()
        {
            PaymentType = "Subscription",
            Period = 1,
            RenewalStatus = "ManualRenewal",
            InstanceType = "Advanced",
            InstanceName = $"{name}-{defaultInteger.Result}",
        });
    
        var @default = AliCloud.CR.GetEndpointAclService.Invoke(new()
        {
            EndpointType = "internet",
            Enable = true,
            InstanceId = defaultRegistryEnterpriseInstance.Id,
            ModuleName = "Registry",
        });
    
        var defaultEndpointAclPolicy = new AliCloud.CR.EndpointAclPolicy("default", new()
        {
            InstanceId = @default.Apply(@default => @default.Apply(getEndpointAclServiceResult => getEndpointAclServiceResult.InstanceId)),
            Entry = "192.168.1.0/24",
            Description = name,
            ModuleName = "Registry",
            EndpointType = "internet",
        });
    
    });
    
    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.CrFunctions;
    import com.pulumi.alicloud.cr.inputs.GetEndpointAclServiceArgs;
    import com.pulumi.alicloud.cr.EndpointAclPolicy;
    import com.pulumi.alicloud.cr.EndpointAclPolicyArgs;
    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 defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000000)
                .max(99999999)
                .build());
    
            var defaultRegistryEnterpriseInstance = new RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()
                .paymentType("Subscription")
                .period(1)
                .renewalStatus("ManualRenewal")
                .instanceType("Advanced")
                .instanceName(String.format("%s-%s", name,defaultInteger.result()))
                .build());
    
            final var default = CrFunctions.getEndpointAclService(GetEndpointAclServiceArgs.builder()
                .endpointType("internet")
                .enable(true)
                .instanceId(defaultRegistryEnterpriseInstance.id())
                .moduleName("Registry")
                .build());
    
            var defaultEndpointAclPolicy = new EndpointAclPolicy("defaultEndpointAclPolicy", EndpointAclPolicyArgs.builder()
                .instanceId(default_.applyValue(default_ -> default_.instanceId()))
                .entry("192.168.1.0/24")
                .description(name)
                .moduleName("Registry")
                .endpointType("internet")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 1e+07
          max: 9.9999999e+07
      defaultRegistryEnterpriseInstance:
        type: alicloud:cr:RegistryEnterpriseInstance
        name: default
        properties:
          paymentType: Subscription
          period: 1
          renewalStatus: ManualRenewal
          instanceType: Advanced
          instanceName: ${name}-${defaultInteger.result}
      defaultEndpointAclPolicy:
        type: alicloud:cr:EndpointAclPolicy
        name: default
        properties:
          instanceId: ${default.instanceId}
          entry: 192.168.1.0/24
          description: ${name}
          moduleName: Registry
          endpointType: internet
    variables:
      default:
        fn::invoke:
          Function: alicloud:cr:getEndpointAclService
          Arguments:
            endpointType: internet
            enable: true
            instanceId: ${defaultRegistryEnterpriseInstance.id}
            moduleName: Registry
    

    Create EndpointAclPolicy Resource

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

    Constructor syntax

    new EndpointAclPolicy(name: string, args: EndpointAclPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def EndpointAclPolicy(resource_name: str,
                          args: EndpointAclPolicyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def EndpointAclPolicy(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          endpoint_type: Optional[str] = None,
                          entry: Optional[str] = None,
                          instance_id: Optional[str] = None,
                          description: Optional[str] = None,
                          module_name: Optional[str] = None)
    func NewEndpointAclPolicy(ctx *Context, name string, args EndpointAclPolicyArgs, opts ...ResourceOption) (*EndpointAclPolicy, error)
    public EndpointAclPolicy(string name, EndpointAclPolicyArgs args, CustomResourceOptions? opts = null)
    public EndpointAclPolicy(String name, EndpointAclPolicyArgs args)
    public EndpointAclPolicy(String name, EndpointAclPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:cr:EndpointAclPolicy
    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 EndpointAclPolicyArgs
    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 EndpointAclPolicyArgs
    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 EndpointAclPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EndpointAclPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EndpointAclPolicyArgs
    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 endpointAclPolicyResource = new AliCloud.CR.EndpointAclPolicy("endpointAclPolicyResource", new()
    {
        EndpointType = "string",
        Entry = "string",
        InstanceId = "string",
        Description = "string",
        ModuleName = "string",
    });
    
    example, err := cr.NewEndpointAclPolicy(ctx, "endpointAclPolicyResource", &cr.EndpointAclPolicyArgs{
    	EndpointType: pulumi.String("string"),
    	Entry:        pulumi.String("string"),
    	InstanceId:   pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	ModuleName:   pulumi.String("string"),
    })
    
    var endpointAclPolicyResource = new EndpointAclPolicy("endpointAclPolicyResource", EndpointAclPolicyArgs.builder()
        .endpointType("string")
        .entry("string")
        .instanceId("string")
        .description("string")
        .moduleName("string")
        .build());
    
    endpoint_acl_policy_resource = alicloud.cr.EndpointAclPolicy("endpointAclPolicyResource",
        endpoint_type="string",
        entry="string",
        instance_id="string",
        description="string",
        module_name="string")
    
    const endpointAclPolicyResource = new alicloud.cr.EndpointAclPolicy("endpointAclPolicyResource", {
        endpointType: "string",
        entry: "string",
        instanceId: "string",
        description: "string",
        moduleName: "string",
    });
    
    type: alicloud:cr:EndpointAclPolicy
    properties:
        description: string
        endpointType: string
        entry: string
        instanceId: string
        moduleName: string
    

    EndpointAclPolicy 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 EndpointAclPolicy resource accepts the following input properties:

    EndpointType string
    The type of endpoint. Valid values: internet.
    Entry string
    The IP segment that allowed to access.
    InstanceId string
    The ID of the CR Instance.
    Description string
    The description of the entry.
    ModuleName string
    The module that needs to set the access policy. Valid values: Registry.
    EndpointType string
    The type of endpoint. Valid values: internet.
    Entry string
    The IP segment that allowed to access.
    InstanceId string
    The ID of the CR Instance.
    Description string
    The description of the entry.
    ModuleName string
    The module that needs to set the access policy. Valid values: Registry.
    endpointType String
    The type of endpoint. Valid values: internet.
    entry String
    The IP segment that allowed to access.
    instanceId String
    The ID of the CR Instance.
    description String
    The description of the entry.
    moduleName String
    The module that needs to set the access policy. Valid values: Registry.
    endpointType string
    The type of endpoint. Valid values: internet.
    entry string
    The IP segment that allowed to access.
    instanceId string
    The ID of the CR Instance.
    description string
    The description of the entry.
    moduleName string
    The module that needs to set the access policy. Valid values: Registry.
    endpoint_type str
    The type of endpoint. Valid values: internet.
    entry str
    The IP segment that allowed to access.
    instance_id str
    The ID of the CR Instance.
    description str
    The description of the entry.
    module_name str
    The module that needs to set the access policy. Valid values: Registry.
    endpointType String
    The type of endpoint. Valid values: internet.
    entry String
    The IP segment that allowed to access.
    instanceId String
    The ID of the CR Instance.
    description String
    The description of the entry.
    moduleName String
    The module that needs to set the access policy. Valid values: Registry.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EndpointAclPolicy 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 EndpointAclPolicy Resource

    Get an existing EndpointAclPolicy 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?: EndpointAclPolicyState, opts?: CustomResourceOptions): EndpointAclPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            endpoint_type: Optional[str] = None,
            entry: Optional[str] = None,
            instance_id: Optional[str] = None,
            module_name: Optional[str] = None) -> EndpointAclPolicy
    func GetEndpointAclPolicy(ctx *Context, name string, id IDInput, state *EndpointAclPolicyState, opts ...ResourceOption) (*EndpointAclPolicy, error)
    public static EndpointAclPolicy Get(string name, Input<string> id, EndpointAclPolicyState? state, CustomResourceOptions? opts = null)
    public static EndpointAclPolicy get(String name, Output<String> id, EndpointAclPolicyState 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:
    Description string
    The description of the entry.
    EndpointType string
    The type of endpoint. Valid values: internet.
    Entry string
    The IP segment that allowed to access.
    InstanceId string
    The ID of the CR Instance.
    ModuleName string
    The module that needs to set the access policy. Valid values: Registry.
    Description string
    The description of the entry.
    EndpointType string
    The type of endpoint. Valid values: internet.
    Entry string
    The IP segment that allowed to access.
    InstanceId string
    The ID of the CR Instance.
    ModuleName string
    The module that needs to set the access policy. Valid values: Registry.
    description String
    The description of the entry.
    endpointType String
    The type of endpoint. Valid values: internet.
    entry String
    The IP segment that allowed to access.
    instanceId String
    The ID of the CR Instance.
    moduleName String
    The module that needs to set the access policy. Valid values: Registry.
    description string
    The description of the entry.
    endpointType string
    The type of endpoint. Valid values: internet.
    entry string
    The IP segment that allowed to access.
    instanceId string
    The ID of the CR Instance.
    moduleName string
    The module that needs to set the access policy. Valid values: Registry.
    description str
    The description of the entry.
    endpoint_type str
    The type of endpoint. Valid values: internet.
    entry str
    The IP segment that allowed to access.
    instance_id str
    The ID of the CR Instance.
    module_name str
    The module that needs to set the access policy. Valid values: Registry.
    description String
    The description of the entry.
    endpointType String
    The type of endpoint. Valid values: internet.
    entry String
    The IP segment that allowed to access.
    instanceId String
    The ID of the CR Instance.
    moduleName String
    The module that needs to set the access policy. Valid values: Registry.

    Import

    CR Endpoint Acl Policy can be imported using the id, e.g.

    $ pulumi import alicloud:cr/endpointAclPolicy:EndpointAclPolicy example <instance_id>:<endpoint_type>:<entry>
    

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi