ovh.CloudProject.ContainerRegistryIPRestrictionsRegistry
Explore with Pulumi AI
Apply IP restrictions container registry associated with a public cloud project on artifact manager component.
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_registry_iprestrictions = new ovh.cloudproject.ContainerRegistryIPRestrictionsRegistry("my-registry-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_registry_iprestrictions = ovh.cloud_project.ContainerRegistryIPRestrictionsRegistry("my-registry-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.NewContainerRegistryIPRestrictionsRegistry(ctx, "my-registry-iprestrictions", &CloudProject.ContainerRegistryIPRestrictionsRegistryArgs{
ServiceName: pulumi.Any(ovh_cloud_project_containerregistry.Registry.Service_name),
RegistryId: pulumi.Any(ovh_cloud_project_containerregistry.Registry.Id),
IpRestrictions: pulumi.MapArray{
pulumi.Map{
"ip_block": pulumi.Any("xxx.xxx.xxx.xxx/xx"),
"description": pulumi.Any("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_registry_iprestrictions = new Ovh.CloudProject.ContainerRegistryIPRestrictionsRegistry("my-registry-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.ContainerRegistryIPRestrictionsRegistry;
import com.pulumi.ovh.CloudProject.ContainerRegistryIPRestrictionsRegistryArgs;
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_registry_iprestrictions = new ContainerRegistryIPRestrictionsRegistry("my-registry-iprestrictions", ContainerRegistryIPRestrictionsRegistryArgs.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-registry-iprestrictions:
type: ovh:CloudProject:ContainerRegistryIPRestrictionsRegistry
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 ContainerRegistryIPRestrictionsRegistry Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ContainerRegistryIPRestrictionsRegistry(name: string, args: ContainerRegistryIPRestrictionsRegistryArgs, opts?: CustomResourceOptions);
@overload
def ContainerRegistryIPRestrictionsRegistry(resource_name: str,
args: ContainerRegistryIPRestrictionsRegistryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ContainerRegistryIPRestrictionsRegistry(resource_name: str,
opts: Optional[ResourceOptions] = None,
ip_restrictions: Optional[Sequence[Mapping[str, Any]]] = None,
registry_id: Optional[str] = None,
service_name: Optional[str] = None)
func NewContainerRegistryIPRestrictionsRegistry(ctx *Context, name string, args ContainerRegistryIPRestrictionsRegistryArgs, opts ...ResourceOption) (*ContainerRegistryIPRestrictionsRegistry, error)
public ContainerRegistryIPRestrictionsRegistry(string name, ContainerRegistryIPRestrictionsRegistryArgs args, CustomResourceOptions? opts = null)
public ContainerRegistryIPRestrictionsRegistry(String name, ContainerRegistryIPRestrictionsRegistryArgs args)
public ContainerRegistryIPRestrictionsRegistry(String name, ContainerRegistryIPRestrictionsRegistryArgs args, CustomResourceOptions options)
type: ovh:CloudProject:ContainerRegistryIPRestrictionsRegistry
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 ContainerRegistryIPRestrictionsRegistryArgs
- 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 ContainerRegistryIPRestrictionsRegistryArgs
- 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 ContainerRegistryIPRestrictionsRegistryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerRegistryIPRestrictionsRegistryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerRegistryIPRestrictionsRegistryArgs
- 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 containerRegistryIPRestrictionsRegistryResource = new Ovh.CloudProject.ContainerRegistryIPRestrictionsRegistry("containerRegistryIPRestrictionsRegistryResource", new()
{
IpRestrictions = new[]
{
{
{ "string", "any" },
},
},
RegistryId = "string",
ServiceName = "string",
});
example, err := CloudProject.NewContainerRegistryIPRestrictionsRegistry(ctx, "containerRegistryIPRestrictionsRegistryResource", &CloudProject.ContainerRegistryIPRestrictionsRegistryArgs{
IpRestrictions: pulumi.MapArray{
pulumi.Map{
"string": pulumi.Any("any"),
},
},
RegistryId: pulumi.String("string"),
ServiceName: pulumi.String("string"),
})
var containerRegistryIPRestrictionsRegistryResource = new ContainerRegistryIPRestrictionsRegistry("containerRegistryIPRestrictionsRegistryResource", ContainerRegistryIPRestrictionsRegistryArgs.builder()
.ipRestrictions(Map.of("string", "any"))
.registryId("string")
.serviceName("string")
.build());
container_registry_ip_restrictions_registry_resource = ovh.cloud_project.ContainerRegistryIPRestrictionsRegistry("containerRegistryIPRestrictionsRegistryResource",
ip_restrictions=[{
"string": "any",
}],
registry_id="string",
service_name="string")
const containerRegistryIPRestrictionsRegistryResource = new ovh.cloudproject.ContainerRegistryIPRestrictionsRegistry("containerRegistryIPRestrictionsRegistryResource", {
ipRestrictions: [{
string: "any",
}],
registryId: "string",
serviceName: "string",
});
type: ovh:CloudProject:ContainerRegistryIPRestrictionsRegistry
properties:
ipRestrictions:
- string: any
registryId: string
serviceName: string
ContainerRegistryIPRestrictionsRegistry 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 ContainerRegistryIPRestrictionsRegistry resource accepts the following input properties:
- Ip
Restrictions List<ImmutableDictionary<string, object>> - IP restrictions applied on artifact manager component.
- Registry
Id string - The id of the Managed Private Registry.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- Ip
Restrictions []map[string]interface{} - IP restrictions applied on artifact manager component.
- Registry
Id string - The id of the Managed Private Registry.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip
Restrictions List<Map<String,Object>> - IP restrictions applied on artifact manager component.
- registry
Id String - The id of the Managed Private Registry.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip
Restrictions {[key: string]: any}[] - IP restrictions applied on artifact manager component.
- registry
Id string - The id of the Managed Private Registry.
- service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip_
restrictions Sequence[Mapping[str, Any]] - IP restrictions applied on artifact manager component.
- 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.
- ip
Restrictions List<Map<Any>> - IP restrictions applied on artifact manager component.
- registry
Id String - The id of the Managed Private Registry.
- service
Name 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 ContainerRegistryIPRestrictionsRegistry 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 ContainerRegistryIPRestrictionsRegistry Resource
Get an existing ContainerRegistryIPRestrictionsRegistry 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?: ContainerRegistryIPRestrictionsRegistryState, opts?: CustomResourceOptions): ContainerRegistryIPRestrictionsRegistry
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ip_restrictions: Optional[Sequence[Mapping[str, Any]]] = None,
registry_id: Optional[str] = None,
service_name: Optional[str] = None) -> ContainerRegistryIPRestrictionsRegistry
func GetContainerRegistryIPRestrictionsRegistry(ctx *Context, name string, id IDInput, state *ContainerRegistryIPRestrictionsRegistryState, opts ...ResourceOption) (*ContainerRegistryIPRestrictionsRegistry, error)
public static ContainerRegistryIPRestrictionsRegistry Get(string name, Input<string> id, ContainerRegistryIPRestrictionsRegistryState? state, CustomResourceOptions? opts = null)
public static ContainerRegistryIPRestrictionsRegistry get(String name, Output<String> id, ContainerRegistryIPRestrictionsRegistryState 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.
- Ip
Restrictions List<ImmutableDictionary<string, object>> - IP restrictions applied on artifact manager component.
- Registry
Id string - The id of the Managed Private Registry.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- Ip
Restrictions []map[string]interface{} - IP restrictions applied on artifact manager component.
- Registry
Id string - The id of the Managed Private Registry.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip
Restrictions List<Map<String,Object>> - IP restrictions applied on artifact manager component.
- registry
Id String - The id of the Managed Private Registry.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip
Restrictions {[key: string]: any}[] - IP restrictions applied on artifact manager component.
- registry
Id string - The id of the Managed Private Registry.
- service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICE
environment variable is used.
- ip_
restrictions Sequence[Mapping[str, Any]] - IP restrictions applied on artifact manager component.
- 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.
- ip
Restrictions List<Map<Any>> - IP restrictions applied on artifact manager component.
- registry
Id String - The id of the Managed Private Registry.
- service
Name 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.