1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. ContainerRegistryIPRestrictionsManagement
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

ovh.CloudProject.ContainerRegistryIPRestrictionsManagement

Explore with Pulumi AI

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

    Apply IP restrictions container registry associated with a public cloud project on Harbor UI and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const registry = ovh.CloudProject.getContainerRegistry({
        serviceName: "XXXXXX",
        registryId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
    });
    const my_mgt_iprestrictions = new ovh.cloudproject.ContainerRegistryIPRestrictionsManagement("my-mgt-iprestrictions", {
        serviceName: ovh_cloud_project_containerregistry.registry.service_name,
        registryId: ovh_cloud_project_containerregistry.registry.id,
        ipRestrictions: [{
            ip_block: "xxx.xxx.xxx.xxx/xx",
            description: "xxxxxxx",
        }],
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    registry = ovh.CloudProject.get_container_registry(service_name="XXXXXX",
        registry_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx")
    my_mgt_iprestrictions = ovh.cloud_project.ContainerRegistryIPRestrictionsManagement("my-mgt-iprestrictions",
        service_name=ovh_cloud_project_containerregistry["registry"]["service_name"],
        registry_id=ovh_cloud_project_containerregistry["registry"]["id"],
        ip_restrictions=[{
            "ip_block": "xxx.xxx.xxx.xxx/xx",
            "description": "xxxxxxx",
        }])
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProject"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := CloudProject.GetContainerRegistry(ctx, &cloudproject.GetContainerRegistryArgs{
    			ServiceName: "XXXXXX",
    			RegistryId:  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = CloudProject.NewContainerRegistryIPRestrictionsManagement(ctx, "my-mgt-iprestrictions", &CloudProject.ContainerRegistryIPRestrictionsManagementArgs{
    			ServiceName: pulumi.Any(ovh_cloud_project_containerregistry.Registry.Service_name),
    			RegistryId:  pulumi.Any(ovh_cloud_project_containerregistry.Registry.Id),
    			IpRestrictions: pulumi.StringMapArray{
    				pulumi.StringMap{
    					"ip_block":    pulumi.String("xxx.xxx.xxx.xxx/xx"),
    					"description": pulumi.String("xxxxxxx"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var registry = Ovh.CloudProject.GetContainerRegistry.Invoke(new()
        {
            ServiceName = "XXXXXX",
            RegistryId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
        });
    
        var my_mgt_iprestrictions = new Ovh.CloudProject.ContainerRegistryIPRestrictionsManagement("my-mgt-iprestrictions", new()
        {
            ServiceName = ovh_cloud_project_containerregistry.Registry.Service_name,
            RegistryId = ovh_cloud_project_containerregistry.Registry.Id,
            IpRestrictions = new[]
            {
                
                {
                    { "ip_block", "xxx.xxx.xxx.xxx/xx" },
                    { "description", "xxxxxxx" },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProject.CloudProjectFunctions;
    import com.pulumi.ovh.CloudProject.inputs.GetContainerRegistryArgs;
    import com.pulumi.ovh.CloudProject.ContainerRegistryIPRestrictionsManagement;
    import com.pulumi.ovh.CloudProject.ContainerRegistryIPRestrictionsManagementArgs;
    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 registry = CloudProjectFunctions.getContainerRegistry(GetContainerRegistryArgs.builder()
                .serviceName("XXXXXX")
                .registryId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx")
                .build());
    
            var my_mgt_iprestrictions = new ContainerRegistryIPRestrictionsManagement("my-mgt-iprestrictions", ContainerRegistryIPRestrictionsManagementArgs.builder()
                .serviceName(ovh_cloud_project_containerregistry.registry().service_name())
                .registryId(ovh_cloud_project_containerregistry.registry().id())
                .ipRestrictions(Map.ofEntries(
                    Map.entry("ip_block", "xxx.xxx.xxx.xxx/xx"),
                    Map.entry("description", "xxxxxxx")
                ))
                .build());
    
        }
    }
    
    resources:
      my-mgt-iprestrictions:
        type: ovh:CloudProject:ContainerRegistryIPRestrictionsManagement
        properties:
          serviceName: ${ovh_cloud_project_containerregistry.registry.service_name}
          registryId: ${ovh_cloud_project_containerregistry.registry.id}
          ipRestrictions:
            - ip_block: xxx.xxx.xxx.xxx/xx
              description: xxxxxxx
    variables:
      registry:
        fn::invoke:
          Function: ovh:CloudProject:getContainerRegistry
          Arguments:
            serviceName: XXXXXX
            registryId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
    

    Create ContainerRegistryIPRestrictionsManagement Resource

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

    Constructor syntax

    new ContainerRegistryIPRestrictionsManagement(name: string, args: ContainerRegistryIPRestrictionsManagementArgs, opts?: CustomResourceOptions);
    @overload
    def ContainerRegistryIPRestrictionsManagement(resource_name: str,
                                                  args: ContainerRegistryIPRestrictionsManagementArgs,
                                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def ContainerRegistryIPRestrictionsManagement(resource_name: str,
                                                  opts: Optional[ResourceOptions] = None,
                                                  ip_restrictions: Optional[Sequence[Mapping[str, str]]] = None,
                                                  registry_id: Optional[str] = None,
                                                  service_name: Optional[str] = None)
    func NewContainerRegistryIPRestrictionsManagement(ctx *Context, name string, args ContainerRegistryIPRestrictionsManagementArgs, opts ...ResourceOption) (*ContainerRegistryIPRestrictionsManagement, error)
    public ContainerRegistryIPRestrictionsManagement(string name, ContainerRegistryIPRestrictionsManagementArgs args, CustomResourceOptions? opts = null)
    public ContainerRegistryIPRestrictionsManagement(String name, ContainerRegistryIPRestrictionsManagementArgs args)
    public ContainerRegistryIPRestrictionsManagement(String name, ContainerRegistryIPRestrictionsManagementArgs args, CustomResourceOptions options)
    
    type: ovh:CloudProject:ContainerRegistryIPRestrictionsManagement
    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 ContainerRegistryIPRestrictionsManagementArgs
    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 ContainerRegistryIPRestrictionsManagementArgs
    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 ContainerRegistryIPRestrictionsManagementArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContainerRegistryIPRestrictionsManagementArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContainerRegistryIPRestrictionsManagementArgs
    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 containerRegistryIPRestrictionsManagementResource = new Ovh.CloudProject.ContainerRegistryIPRestrictionsManagement("containerRegistryIPRestrictionsManagementResource", new()
    {
        IpRestrictions = new[]
        {
            
            {
                { "string", "string" },
            },
        },
        RegistryId = "string",
        ServiceName = "string",
    });
    
    example, err := CloudProject.NewContainerRegistryIPRestrictionsManagement(ctx, "containerRegistryIPRestrictionsManagementResource", &CloudProject.ContainerRegistryIPRestrictionsManagementArgs{
    	IpRestrictions: pulumi.StringMapArray{
    		pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    	},
    	RegistryId:  pulumi.String("string"),
    	ServiceName: pulumi.String("string"),
    })
    
    var containerRegistryIPRestrictionsManagementResource = new ContainerRegistryIPRestrictionsManagement("containerRegistryIPRestrictionsManagementResource", ContainerRegistryIPRestrictionsManagementArgs.builder()
        .ipRestrictions(Map.of("string", "string"))
        .registryId("string")
        .serviceName("string")
        .build());
    
    container_registry_ip_restrictions_management_resource = ovh.cloud_project.ContainerRegistryIPRestrictionsManagement("containerRegistryIPRestrictionsManagementResource",
        ip_restrictions=[{
            "string": "string",
        }],
        registry_id="string",
        service_name="string")
    
    const containerRegistryIPRestrictionsManagementResource = new ovh.cloudproject.ContainerRegistryIPRestrictionsManagement("containerRegistryIPRestrictionsManagementResource", {
        ipRestrictions: [{
            string: "string",
        }],
        registryId: "string",
        serviceName: "string",
    });
    
    type: ovh:CloudProject:ContainerRegistryIPRestrictionsManagement
    properties:
        ipRestrictions:
            - string: string
        registryId: string
        serviceName: string
    

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

    IpRestrictions List<ImmutableDictionary<string, string>>
    IP restrictions applied on Harbor UI and API.
    RegistryId string
    The id of the Managed Private Registry.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    IpRestrictions []map[string]string
    IP restrictions applied on Harbor UI and API.
    RegistryId string
    The id of the Managed Private Registry.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions List<Map<String,String>>
    IP restrictions applied on Harbor UI and API.
    registryId String
    The id of the Managed Private Registry.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions {[key: string]: string}[]
    IP restrictions applied on Harbor UI and API.
    registryId string
    The id of the Managed Private Registry.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ip_restrictions Sequence[Mapping[str, str]]
    IP restrictions applied on Harbor UI and API.
    registry_id str
    The id of the Managed Private Registry.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions List<Map<String>>
    IP restrictions applied on Harbor UI and API.
    registryId String
    The id of the Managed Private Registry.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    Outputs

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

    Get an existing ContainerRegistryIPRestrictionsManagement 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?: ContainerRegistryIPRestrictionsManagementState, opts?: CustomResourceOptions): ContainerRegistryIPRestrictionsManagement
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ip_restrictions: Optional[Sequence[Mapping[str, str]]] = None,
            registry_id: Optional[str] = None,
            service_name: Optional[str] = None) -> ContainerRegistryIPRestrictionsManagement
    func GetContainerRegistryIPRestrictionsManagement(ctx *Context, name string, id IDInput, state *ContainerRegistryIPRestrictionsManagementState, opts ...ResourceOption) (*ContainerRegistryIPRestrictionsManagement, error)
    public static ContainerRegistryIPRestrictionsManagement Get(string name, Input<string> id, ContainerRegistryIPRestrictionsManagementState? state, CustomResourceOptions? opts = null)
    public static ContainerRegistryIPRestrictionsManagement get(String name, Output<String> id, ContainerRegistryIPRestrictionsManagementState 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:
    IpRestrictions List<ImmutableDictionary<string, string>>
    IP restrictions applied on Harbor UI and API.
    RegistryId string
    The id of the Managed Private Registry.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    IpRestrictions []map[string]string
    IP restrictions applied on Harbor UI and API.
    RegistryId string
    The id of the Managed Private Registry.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions List<Map<String,String>>
    IP restrictions applied on Harbor UI and API.
    registryId String
    The id of the Managed Private Registry.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions {[key: string]: string}[]
    IP restrictions applied on Harbor UI and API.
    registryId string
    The id of the Managed Private Registry.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ip_restrictions Sequence[Mapping[str, str]]
    IP restrictions applied on Harbor UI and API.
    registry_id str
    The id of the Managed Private Registry.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ipRestrictions List<Map<String>>
    IP restrictions applied on Harbor UI and API.
    registryId String
    The id of the Managed Private Registry.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud