1. Packages
  2. Packages
  3. OVH
  4. API Docs
  5. getCloudSecurityGroups
Viewing docs for OVHCloud v2.15.0
published on Monday, Jun 29, 2026 by OVHcloud
ovh logo
Viewing docs for OVHCloud v2.15.0
published on Monday, Jun 29, 2026 by OVHcloud

    Use this data source to list the security groups of a public cloud project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const securityGroups = ovh.getCloudSecurityGroups({
        serviceName: "<public cloud project ID>",
    });
    export const securityGroupNames = securityGroups.then(securityGroups => .map(sg => (sg.name)));
    
    import pulumi
    import pulumi_ovh as ovh
    
    security_groups = ovh.get_cloud_security_groups(service_name="<public cloud project ID>")
    pulumi.export("securityGroupNames", [sg.name for sg in security_groups.security_groups])
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var securityGroups = Ovh.GetCloudSecurityGroups.Invoke(new()
        {
            ServiceName = "<public cloud project ID>",
        });
    
        return new Dictionary<string, object?>
        {
            ["securityGroupNames"] = .Select(sg => 
            {
                return sg.Name;
            }).ToList(),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    

    Using getCloudSecurityGroups

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCloudSecurityGroups(args: GetCloudSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetCloudSecurityGroupsResult>
    function getCloudSecurityGroupsOutput(args: GetCloudSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetCloudSecurityGroupsResult>
    def get_cloud_security_groups(service_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetCloudSecurityGroupsResult
    def get_cloud_security_groups_output(service_name: pulumi.Input[Optional[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetCloudSecurityGroupsResult]
    func GetCloudSecurityGroups(ctx *Context, args *GetCloudSecurityGroupsArgs, opts ...InvokeOption) (*GetCloudSecurityGroupsResult, error)
    func GetCloudSecurityGroupsOutput(ctx *Context, args *GetCloudSecurityGroupsOutputArgs, opts ...InvokeOption) GetCloudSecurityGroupsResultOutput

    > Note: This function is named GetCloudSecurityGroups in the Go SDK.

    public static class GetCloudSecurityGroups 
    {
        public static Task<GetCloudSecurityGroupsResult> InvokeAsync(GetCloudSecurityGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudSecurityGroupsResult> Invoke(GetCloudSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudSecurityGroupsResult> getCloudSecurityGroups(GetCloudSecurityGroupsArgs args, InvokeOptions options)
    public static Output<GetCloudSecurityGroupsResult> getCloudSecurityGroups(GetCloudSecurityGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ovh:index/getCloudSecurityGroups:getCloudSecurityGroups
      arguments:
        # arguments dictionary
    data "ovh_getcloudsecuritygroups" "name" {
        # arguments
    }

    The following arguments are supported:

    ServiceName string
    Service name of the resource representing the id of the cloud project.
    ServiceName string
    Service name of the resource representing the id of the cloud project.
    service_name string
    Service name of the resource representing the id of the cloud project.
    serviceName String
    Service name of the resource representing the id of the cloud project.
    serviceName string
    Service name of the resource representing the id of the cloud project.
    service_name str
    Service name of the resource representing the id of the cloud project.
    serviceName String
    Service name of the resource representing the id of the cloud project.

    getCloudSecurityGroups Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups List<GetCloudSecurityGroupsSecurityGroup>
    List of security groups. Each element exports:
    ServiceName string
    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups []GetCloudSecurityGroupsSecurityGroup
    List of security groups. Each element exports:
    ServiceName string
    id string
    The provider-assigned unique ID for this managed resource.
    security_groups list(object)
    List of security groups. Each element exports:
    service_name string
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<GetCloudSecurityGroupsSecurityGroup>
    List of security groups. Each element exports:
    serviceName String
    id string
    The provider-assigned unique ID for this managed resource.
    securityGroups GetCloudSecurityGroupsSecurityGroup[]
    List of security groups. Each element exports:
    serviceName string
    id str
    The provider-assigned unique ID for this managed resource.
    security_groups Sequence[GetCloudSecurityGroupsSecurityGroup]
    List of security groups. Each element exports:
    service_name str
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<Property Map>
    List of security groups. Each element exports:
    serviceName String

    Supporting Types

    GetCloudSecurityGroupsSecurityGroup

    Checksum string
    Computed hash representing the current target specification value.
    CreatedAt string
    Creation date of the security group.
    CurrentState GetCloudSecurityGroupsSecurityGroupCurrentState
    Current state of the security group:
    Description string
    Description of the rule.
    Id string
    Rule ID.
    Location GetCloudSecurityGroupsSecurityGroupLocation
    Location details:
    Name string
    Name of the security group.
    ResourceStatus string
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    Rules List<GetCloudSecurityGroupsSecurityGroupRule>
    List of security group rules:
    UpdatedAt string
    Last update date of the security group.
    Checksum string
    Computed hash representing the current target specification value.
    CreatedAt string
    Creation date of the security group.
    CurrentState GetCloudSecurityGroupsSecurityGroupCurrentState
    Current state of the security group:
    Description string
    Description of the rule.
    Id string
    Rule ID.
    Location GetCloudSecurityGroupsSecurityGroupLocation
    Location details:
    Name string
    Name of the security group.
    ResourceStatus string
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    Rules []GetCloudSecurityGroupsSecurityGroupRule
    List of security group rules:
    UpdatedAt string
    Last update date of the security group.
    checksum string
    Computed hash representing the current target specification value.
    created_at string
    Creation date of the security group.
    current_state object
    Current state of the security group:
    description string
    Description of the rule.
    id string
    Rule ID.
    location object
    Location details:
    name string
    Name of the security group.
    resource_status string
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    rules list(object)
    List of security group rules:
    updated_at string
    Last update date of the security group.
    checksum String
    Computed hash representing the current target specification value.
    createdAt String
    Creation date of the security group.
    currentState GetCloudSecurityGroupsSecurityGroupCurrentState
    Current state of the security group:
    description String
    Description of the rule.
    id String
    Rule ID.
    location GetCloudSecurityGroupsSecurityGroupLocation
    Location details:
    name String
    Name of the security group.
    resourceStatus String
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    rules List<GetCloudSecurityGroupsSecurityGroupRule>
    List of security group rules:
    updatedAt String
    Last update date of the security group.
    checksum string
    Computed hash representing the current target specification value.
    createdAt string
    Creation date of the security group.
    currentState GetCloudSecurityGroupsSecurityGroupCurrentState
    Current state of the security group:
    description string
    Description of the rule.
    id string
    Rule ID.
    location GetCloudSecurityGroupsSecurityGroupLocation
    Location details:
    name string
    Name of the security group.
    resourceStatus string
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    rules GetCloudSecurityGroupsSecurityGroupRule[]
    List of security group rules:
    updatedAt string
    Last update date of the security group.
    checksum str
    Computed hash representing the current target specification value.
    created_at str
    Creation date of the security group.
    current_state GetCloudSecurityGroupsSecurityGroupCurrentState
    Current state of the security group:
    description str
    Description of the rule.
    id str
    Rule ID.
    location GetCloudSecurityGroupsSecurityGroupLocation
    Location details:
    name str
    Name of the security group.
    resource_status str
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    rules Sequence[GetCloudSecurityGroupsSecurityGroupRule]
    List of security group rules:
    updated_at str
    Last update date of the security group.
    checksum String
    Computed hash representing the current target specification value.
    createdAt String
    Creation date of the security group.
    currentState Property Map
    Current state of the security group:
    description String
    Description of the rule.
    id String
    Rule ID.
    location Property Map
    Location details:
    name String
    Name of the security group.
    resourceStatus String
    Security group readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    rules List<Property Map>
    List of security group rules:
    updatedAt String
    Last update date of the security group.

    GetCloudSecurityGroupsSecurityGroupCurrentState

    DefaultRules List<GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule>
    Default egress rules auto-created by OpenStack (same schema as rules).
    Description string
    Description of the rule.
    Location GetCloudSecurityGroupsSecurityGroupCurrentStateLocation
    Location details:
    Name string
    Name of the security group.
    Rules List<GetCloudSecurityGroupsSecurityGroupCurrentStateRule>
    User-specified security group rules with their IDs:
    DefaultRules []GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule
    Default egress rules auto-created by OpenStack (same schema as rules).
    Description string
    Description of the rule.
    Location GetCloudSecurityGroupsSecurityGroupCurrentStateLocation
    Location details:
    Name string
    Name of the security group.
    Rules []GetCloudSecurityGroupsSecurityGroupCurrentStateRule
    User-specified security group rules with their IDs:
    default_rules list(object)
    Default egress rules auto-created by OpenStack (same schema as rules).
    description string
    Description of the rule.
    location object
    Location details:
    name string
    Name of the security group.
    rules list(object)
    User-specified security group rules with their IDs:
    defaultRules List<GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule>
    Default egress rules auto-created by OpenStack (same schema as rules).
    description String
    Description of the rule.
    location GetCloudSecurityGroupsSecurityGroupCurrentStateLocation
    Location details:
    name String
    Name of the security group.
    rules List<GetCloudSecurityGroupsSecurityGroupCurrentStateRule>
    User-specified security group rules with their IDs:
    defaultRules GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule[]
    Default egress rules auto-created by OpenStack (same schema as rules).
    description string
    Description of the rule.
    location GetCloudSecurityGroupsSecurityGroupCurrentStateLocation
    Location details:
    name string
    Name of the security group.
    rules GetCloudSecurityGroupsSecurityGroupCurrentStateRule[]
    User-specified security group rules with their IDs:
    default_rules Sequence[GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule]
    Default egress rules auto-created by OpenStack (same schema as rules).
    description str
    Description of the rule.
    location GetCloudSecurityGroupsSecurityGroupCurrentStateLocation
    Location details:
    name str
    Name of the security group.
    rules Sequence[GetCloudSecurityGroupsSecurityGroupCurrentStateRule]
    User-specified security group rules with their IDs:
    defaultRules List<Property Map>
    Default egress rules auto-created by OpenStack (same schema as rules).
    description String
    Description of the rule.
    location Property Map
    Location details:
    name String
    Name of the security group.
    rules List<Property Map>
    User-specified security group rules with their IDs:

    GetCloudSecurityGroupsSecurityGroupCurrentStateDefaultRule

    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    Id string
    Rule ID.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    Id string
    Rule ID.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernet_type string
    Ethernet type.
    id string
    Rule ID.
    port_range_max number
    Maximum port number.
    port_range_min number
    Minimum port number.
    protocol string
    Protocol.
    remote_group_id string
    Remote security group ID.
    remote_ip_prefix string
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    id String
    Rule ID.
    portRangeMax Integer
    Maximum port number.
    portRangeMin Integer
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernetType string
    Ethernet type.
    id string
    Rule ID.
    portRangeMax number
    Maximum port number.
    portRangeMin number
    Minimum port number.
    protocol string
    Protocol.
    remoteGroupId string
    Remote security group ID.
    remoteIpPrefix string
    Remote IP prefix.
    description str
    Description of the rule.
    direction str
    Direction of the rule.
    ethernet_type str
    Ethernet type.
    id str
    Rule ID.
    port_range_max int
    Maximum port number.
    port_range_min int
    Minimum port number.
    protocol str
    Protocol.
    remote_group_id str
    Remote security group ID.
    remote_ip_prefix str
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    id String
    Rule ID.
    portRangeMax Number
    Maximum port number.
    portRangeMin Number
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.

    GetCloudSecurityGroupsSecurityGroupCurrentStateLocation

    Region string
    Region.
    Region string
    Region.
    region string
    Region.
    region String
    Region.
    region string
    Region.
    region str
    Region.
    region String
    Region.

    GetCloudSecurityGroupsSecurityGroupCurrentStateRule

    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    Id string
    Rule ID.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    Id string
    Rule ID.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernet_type string
    Ethernet type.
    id string
    Rule ID.
    port_range_max number
    Maximum port number.
    port_range_min number
    Minimum port number.
    protocol string
    Protocol.
    remote_group_id string
    Remote security group ID.
    remote_ip_prefix string
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    id String
    Rule ID.
    portRangeMax Integer
    Maximum port number.
    portRangeMin Integer
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernetType string
    Ethernet type.
    id string
    Rule ID.
    portRangeMax number
    Maximum port number.
    portRangeMin number
    Minimum port number.
    protocol string
    Protocol.
    remoteGroupId string
    Remote security group ID.
    remoteIpPrefix string
    Remote IP prefix.
    description str
    Description of the rule.
    direction str
    Direction of the rule.
    ethernet_type str
    Ethernet type.
    id str
    Rule ID.
    port_range_max int
    Maximum port number.
    port_range_min int
    Minimum port number.
    protocol str
    Protocol.
    remote_group_id str
    Remote security group ID.
    remote_ip_prefix str
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    id String
    Rule ID.
    portRangeMax Number
    Maximum port number.
    portRangeMin Number
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.

    GetCloudSecurityGroupsSecurityGroupLocation

    Region string
    Region.
    Region string
    Region.
    region string
    Region.
    region String
    Region.
    region string
    Region.
    region str
    Region.
    region String
    Region.

    GetCloudSecurityGroupsSecurityGroupRule

    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    Description string
    Description of the rule.
    Direction string
    Direction of the rule.
    EthernetType string
    Ethernet type.
    PortRangeMax int
    Maximum port number.
    PortRangeMin int
    Minimum port number.
    Protocol string
    Protocol.
    RemoteGroupId string
    Remote security group ID.
    RemoteIpPrefix string
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernet_type string
    Ethernet type.
    port_range_max number
    Maximum port number.
    port_range_min number
    Minimum port number.
    protocol string
    Protocol.
    remote_group_id string
    Remote security group ID.
    remote_ip_prefix string
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    portRangeMax Integer
    Maximum port number.
    portRangeMin Integer
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.
    description string
    Description of the rule.
    direction string
    Direction of the rule.
    ethernetType string
    Ethernet type.
    portRangeMax number
    Maximum port number.
    portRangeMin number
    Minimum port number.
    protocol string
    Protocol.
    remoteGroupId string
    Remote security group ID.
    remoteIpPrefix string
    Remote IP prefix.
    description str
    Description of the rule.
    direction str
    Direction of the rule.
    ethernet_type str
    Ethernet type.
    port_range_max int
    Maximum port number.
    port_range_min int
    Minimum port number.
    protocol str
    Protocol.
    remote_group_id str
    Remote security group ID.
    remote_ip_prefix str
    Remote IP prefix.
    description String
    Description of the rule.
    direction String
    Direction of the rule.
    ethernetType String
    Ethernet type.
    portRangeMax Number
    Maximum port number.
    portRangeMin Number
    Minimum port number.
    protocol String
    Protocol.
    remoteGroupId String
    Remote security group ID.
    remoteIpPrefix String
    Remote IP prefix.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    Viewing docs for OVHCloud v2.15.0
    published on Monday, Jun 29, 2026 by OVHcloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial