alicloud.cr.EndpointAclPolicy
Explore with Pulumi AI
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
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 defaultRegistryEnterpriseInstance = new AliCloud.CR.RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", new()
{
PaymentType = "Subscription",
Period = 1,
RenewalStatus = "ManualRenewal",
InstanceType = "Advanced",
InstanceName = name,
});
var defaultEndpointAclService = AliCloud.CR.GetEndpointAclService.Invoke(new()
{
EndpointType = "internet",
Enable = true,
InstanceId = defaultRegistryEnterpriseInstance.Id,
ModuleName = "Registry",
});
var defaultEndpointAclPolicy = new AliCloud.CR.EndpointAclPolicy("defaultEndpointAclPolicy", new()
{
InstanceId = defaultEndpointAclService.Apply(getEndpointAclServiceResult => getEndpointAclServiceResult.InstanceId),
Entry = "192.168.1.0/24",
Description = name,
ModuleName = "Registry",
EndpointType = "internet",
});
});
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
}
defaultRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "defaultRegistryEnterpriseInstance", &cr.RegistryEnterpriseInstanceArgs{
PaymentType: pulumi.String("Subscription"),
Period: pulumi.Int(1),
RenewalStatus: pulumi.String("ManualRenewal"),
InstanceType: pulumi.String("Advanced"),
InstanceName: pulumi.String(name),
})
if err != nil {
return err
}
defaultEndpointAclService := 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, "defaultEndpointAclPolicy", &cr.EndpointAclPolicyArgs{
InstanceId: defaultEndpointAclService.ApplyT(func(defaultEndpointAclService cr.GetEndpointAclServiceResult) (*string, error) {
return &defaultEndpointAclService.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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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 defaultRegistryEnterpriseInstance = new RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()
.paymentType("Subscription")
.period(1)
.renewalStatus("ManualRenewal")
.instanceType("Advanced")
.instanceName(name)
.build());
final var defaultEndpointAclService = CrFunctions.getEndpointAclService(GetEndpointAclServiceArgs.builder()
.endpointType("internet")
.enable(true)
.instanceId(defaultRegistryEnterpriseInstance.id())
.moduleName("Registry")
.build());
var defaultEndpointAclPolicy = new EndpointAclPolicy("defaultEndpointAclPolicy", EndpointAclPolicyArgs.builder()
.instanceId(defaultEndpointAclService.applyValue(getEndpointAclServiceResult -> getEndpointAclServiceResult).applyValue(defaultEndpointAclService -> defaultEndpointAclService.applyValue(getEndpointAclServiceResult -> getEndpointAclServiceResult.instanceId())))
.entry("192.168.1.0/24")
.description(name)
.moduleName("Registry")
.endpointType("internet")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default_registry_enterprise_instance = alicloud.cr.RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance",
payment_type="Subscription",
period=1,
renewal_status="ManualRenewal",
instance_type="Advanced",
instance_name=name)
default_endpoint_acl_service = 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("defaultEndpointAclPolicy",
instance_id=default_endpoint_acl_service.instance_id,
entry="192.168.1.0/24",
description=name,
module_name="Registry",
endpoint_type="internet")
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 defaultRegistryEnterpriseInstance = new alicloud.cr.RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", {
paymentType: "Subscription",
period: 1,
renewalStatus: "ManualRenewal",
instanceType: "Advanced",
instanceName: name,
});
const defaultEndpointAclService = alicloud.cr.getEndpointAclServiceOutput({
endpointType: "internet",
enable: true,
instanceId: defaultRegistryEnterpriseInstance.id,
moduleName: "Registry",
});
const defaultEndpointAclPolicy = new alicloud.cr.EndpointAclPolicy("defaultEndpointAclPolicy", {
instanceId: defaultEndpointAclService.apply(defaultEndpointAclService => defaultEndpointAclService.instanceId),
entry: "192.168.1.0/24",
description: name,
moduleName: "Registry",
endpointType: "internet",
});
configuration:
name:
type: string
default: tf-example
resources:
defaultRegistryEnterpriseInstance:
type: alicloud:cr:RegistryEnterpriseInstance
properties:
paymentType: Subscription
period: 1
renewalStatus: ManualRenewal
instanceType: Advanced
instanceName: ${name}
defaultEndpointAclPolicy:
type: alicloud:cr:EndpointAclPolicy
properties:
instanceId: ${defaultEndpointAclService.instanceId}
entry: 192.168.1.0/24
description: ${name}
moduleName: Registry
endpointType: internet
variables:
defaultEndpointAclService:
fn::invoke:
Function: alicloud:cr:getEndpointAclService
Arguments:
endpointType: internet
enable: true
instanceId: ${defaultRegistryEnterpriseInstance.id}
moduleName: Registry
Create EndpointAclPolicy Resource
new EndpointAclPolicy(name: string, args: EndpointAclPolicyArgs, opts?: CustomResourceOptions);
@overload
def EndpointAclPolicy(resource_name: 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)
@overload
def EndpointAclPolicy(resource_name: str,
args: EndpointAclPolicyArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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:
- Endpoint
Type string The type of endpoint. Valid values:
internet
.- Entry string
The IP segment that allowed to access.
- Instance
Id string The ID of the CR Instance.
- Description string
The description of the entry.
- Module
Name string The module that needs to set the access policy. Valid values:
Registry
.
- Endpoint
Type string The type of endpoint. Valid values:
internet
.- Entry string
The IP segment that allowed to access.
- Instance
Id string The ID of the CR Instance.
- Description string
The description of the entry.
- Module
Name string The module that needs to set the access policy. Valid values:
Registry
.
- endpoint
Type String The type of endpoint. Valid values:
internet
.- entry String
The IP segment that allowed to access.
- instance
Id String The ID of the CR Instance.
- description String
The description of the entry.
- module
Name String The module that needs to set the access policy. Valid values:
Registry
.
- endpoint
Type string The type of endpoint. Valid values:
internet
.- entry string
The IP segment that allowed to access.
- instance
Id string The ID of the CR Instance.
- description string
The description of the entry.
- module
Name 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
.
- endpoint
Type String The type of endpoint. Valid values:
internet
.- entry String
The IP segment that allowed to access.
- instance
Id String The ID of the CR Instance.
- description String
The description of the entry.
- module
Name 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.
- Description string
The description of the entry.
- Endpoint
Type string The type of endpoint. Valid values:
internet
.- Entry string
The IP segment that allowed to access.
- Instance
Id string The ID of the CR Instance.
- Module
Name string The module that needs to set the access policy. Valid values:
Registry
.
- Description string
The description of the entry.
- Endpoint
Type string The type of endpoint. Valid values:
internet
.- Entry string
The IP segment that allowed to access.
- Instance
Id string The ID of the CR Instance.
- Module
Name string The module that needs to set the access policy. Valid values:
Registry
.
- description String
The description of the entry.
- endpoint
Type String The type of endpoint. Valid values:
internet
.- entry String
The IP segment that allowed to access.
- instance
Id String The ID of the CR Instance.
- module
Name String The module that needs to set the access policy. Valid values:
Registry
.
- description string
The description of the entry.
- endpoint
Type string The type of endpoint. Valid values:
internet
.- entry string
The IP segment that allowed to access.
- instance
Id string The ID of the CR Instance.
- module
Name 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.
- endpoint
Type String The type of endpoint. Valid values:
internet
.- entry String
The IP segment that allowed to access.
- instance
Id String The ID of the CR Instance.
- module
Name 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>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.