Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud
published on Friday, Jul 17, 2026 by OVHcloud
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud
published on Friday, Jul 17, 2026 by OVHcloud
Use this data source to retrieve information about a security group in a public cloud project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const sg = ovh.getCloudSecurityGroup({
serviceName: "<public cloud project ID>",
id: "<security group ID>",
});
export const securityGroupName = sg.then(sg => sg.name);
import pulumi
import pulumi_ovh as ovh
sg = ovh.get_cloud_security_group(service_name="<public cloud project ID>",
id="<security group ID>")
pulumi.export("securityGroupName", sg.name)
package main
import (
"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
sg, err := ovh.LookupCloudSecurityGroup(ctx, &ovh.LookupCloudSecurityGroupArgs{
ServiceName: "<public cloud project ID>",
Id: "<security group ID>",
}, nil)
if err != nil {
return err
}
ctx.Export("securityGroupName", sg.Name)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var sg = Ovh.GetCloudSecurityGroup.Invoke(new()
{
ServiceName = "<public cloud project ID>",
Id = "<security group ID>",
});
return new Dictionary<string, object?>
{
["securityGroupName"] = sg.Apply(getCloudSecurityGroupResult => getCloudSecurityGroupResult.Name),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.OvhFunctions;
import com.pulumi.ovh.inputs.GetCloudSecurityGroupArgs;
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 sg = OvhFunctions.getCloudSecurityGroup(GetCloudSecurityGroupArgs.builder()
.serviceName("<public cloud project ID>")
.id("<security group ID>")
.build());
ctx.export("securityGroupName", sg.name());
}
}
variables:
sg:
fn::invoke:
function: ovh:getCloudSecurityGroup
arguments:
serviceName: <public cloud project ID>
id: <security group ID>
outputs:
securityGroupName: ${sg.name}
Example coming soon!
Using getCloudSecurityGroup
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 getCloudSecurityGroup(args: GetCloudSecurityGroupArgs, opts?: InvokeOptions): Promise<GetCloudSecurityGroupResult>
function getCloudSecurityGroupOutput(args: GetCloudSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetCloudSecurityGroupResult>def get_cloud_security_group(id: Optional[str] = None,
service_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCloudSecurityGroupResult
def get_cloud_security_group_output(id: pulumi.Input[Optional[str]] = None,
service_name: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCloudSecurityGroupResult]func LookupCloudSecurityGroup(ctx *Context, args *LookupCloudSecurityGroupArgs, opts ...InvokeOption) (*LookupCloudSecurityGroupResult, error)
func LookupCloudSecurityGroupOutput(ctx *Context, args *LookupCloudSecurityGroupOutputArgs, opts ...InvokeOption) LookupCloudSecurityGroupResultOutput> Note: This function is named LookupCloudSecurityGroup in the Go SDK.
public static class GetCloudSecurityGroup
{
public static Task<GetCloudSecurityGroupResult> InvokeAsync(GetCloudSecurityGroupArgs args, InvokeOptions? opts = null)
public static Output<GetCloudSecurityGroupResult> Invoke(GetCloudSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCloudSecurityGroupResult> getCloudSecurityGroup(GetCloudSecurityGroupArgs args, InvokeOptions options)
public static Output<GetCloudSecurityGroupResult> getCloudSecurityGroup(GetCloudSecurityGroupArgs args, InvokeOptions options)
fn::invoke:
function: ovh:index/getCloudSecurityGroup:getCloudSecurityGroup
arguments:
# arguments dictionarydata "ovh_get_cloud_security_group" "name" {
# arguments
}The following arguments are supported:
- Id string
- Security group ID.
- Service
Name string - Service name of the resource representing the id of the cloud project.
- Id string
- Security group ID.
- Service
Name string - Service name of the resource representing the id of the cloud project.
- id string
- Security group ID.
- service_
name string - Service name of the resource representing the id of the cloud project.
- id String
- Security group ID.
- service
Name String - Service name of the resource representing the id of the cloud project.
- id string
- Security group ID.
- service
Name string - Service name of the resource representing the id of the cloud project.
- id str
- Security group ID.
- service_
name str - Service name of the resource representing the id of the cloud project.
- id String
- Security group ID.
- service
Name String - Service name of the resource representing the id of the cloud project.
getCloudSecurityGroup Result
The following output properties are available:
- Checksum string
- Computed hash representing the current target specification value.
- Created
At string - Creation date of the security group.
- Current
State GetCloud Security Group Current State - Current state of the security group:
- Description string
- Description of the rule.
- Id string
- Rule ID.
- Location
Get
Cloud Security Group Location - 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<Get
Cloud Security Group Rule> - List of security group rules. Each rule exports:
- Service
Name string - Updated
At 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 GetCloud Security Group Current State - Current state of the security group:
- Description string
- Description of the rule.
- Id string
- Rule ID.
- Location
Get
Cloud Security Group Location - 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
[]Get
Cloud Security Group Rule - List of security group rules. Each rule exports:
- Service
Name string - Updated
At 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. Each rule exports:
- service_
name string - updated_
at 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 GetCloud Security Group Current State - Current state of the security group:
- description String
- Description of the rule.
- id String
- Rule ID.
- location
Get
Cloud Security Group Location - 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<Get
Cloud Security Group Rule> - List of security group rules. Each rule exports:
- service
Name String - updated
At 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 GetCloud Security Group Current State - Current state of the security group:
- description string
- Description of the rule.
- id string
- Rule ID.
- location
Get
Cloud Security Group Location - 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
Get
Cloud Security Group Rule[] - List of security group rules. Each rule exports:
- service
Name string - updated
At 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 GetCloud Security Group Current State - Current state of the security group:
- description str
- Description of the rule.
- id str
- Rule ID.
- location
Get
Cloud Security Group Location - 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[Get
Cloud Security Group Rule] - List of security group rules. Each rule exports:
- service_
name str - updated_
at str - 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 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.
- resource
Status String - Security group readiness in the system (
CREATING,DELETING,ERROR,OUT_OF_SYNC,READY,UPDATING). - rules List<Property Map>
- List of security group rules. Each rule exports:
- service
Name String - updated
At String - Last update date of the security group.
Supporting Types
GetCloudSecurityGroupCurrentState
- Default
Rules List<GetCloud Security Group Current State Default Rule> - Default egress rules auto-created by OpenStack (same schema as
rules). - Description string
- Description of the rule.
- Location
Get
Cloud Security Group Current State Location - Location details:
- Name string
- Name of the security group.
- Rules
List<Get
Cloud Security Group Current State Rule> - User-specified security group rules with their IDs:
- Default
Rules []GetCloud Security Group Current State Default Rule - Default egress rules auto-created by OpenStack (same schema as
rules). - Description string
- Description of the rule.
- Location
Get
Cloud Security Group Current State Location - Location details:
- Name string
- Name of the security group.
- Rules
[]Get
Cloud Security Group Current State Rule - 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:
- default
Rules List<GetCloud Security Group Current State Default Rule> - Default egress rules auto-created by OpenStack (same schema as
rules). - description String
- Description of the rule.
- location
Get
Cloud Security Group Current State Location - Location details:
- name String
- Name of the security group.
- rules
List<Get
Cloud Security Group Current State Rule> - User-specified security group rules with their IDs:
- default
Rules GetCloud Security Group Current State Default Rule[] - Default egress rules auto-created by OpenStack (same schema as
rules). - description string
- Description of the rule.
- location
Get
Cloud Security Group Current State Location - Location details:
- name string
- Name of the security group.
- rules
Get
Cloud Security Group Current State Rule[] - User-specified security group rules with their IDs:
- default_
rules Sequence[GetCloud Security Group Current State Default Rule] - Default egress rules auto-created by OpenStack (same schema as
rules). - description str
- Description of the rule.
- location
Get
Cloud Security Group Current State Location - Location details:
- name str
- Name of the security group.
- rules
Sequence[Get
Cloud Security Group Current State Rule] - User-specified security group rules with their IDs:
- default
Rules 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:
GetCloudSecurityGroupCurrentStateDefaultRule
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Id string
- Security group ID.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Id string
- Security group ID.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet_
type string - Ethernet type.
- id string
- Security group ID.
- port_
range_ numbermax - Maximum port number.
- port_
range_ numbermin - Minimum port number.
- protocol string
- Protocol.
- remote_
group_ stringid - Remote security group ID.
- remote_
ip_ stringprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- id String
- Security group ID.
- port
Range IntegerMax - Maximum port number.
- port
Range IntegerMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet
Type string - Ethernet type.
- id string
- Security group ID.
- port
Range numberMax - Maximum port number.
- port
Range numberMin - Minimum port number.
- protocol string
- Protocol.
- remote
Group stringId - Remote security group ID.
- remote
Ip stringPrefix - Remote IP prefix.
- description str
- Description of the rule.
- direction str
- Direction of the rule.
- ethernet_
type str - Ethernet type.
- id str
- Security group ID.
- port_
range_ intmax - Maximum port number.
- port_
range_ intmin - Minimum port number.
- protocol str
- Protocol.
- remote_
group_ strid - Remote security group ID.
- remote_
ip_ strprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- id String
- Security group ID.
- port
Range NumberMax - Maximum port number.
- port
Range NumberMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
GetCloudSecurityGroupCurrentStateLocation
- Region string
- Region.
- Region string
- Region.
- region string
- Region.
- region String
- Region.
- region string
- Region.
- region str
- Region.
- region String
- Region.
GetCloudSecurityGroupCurrentStateRule
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Id string
- Security group ID.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Id string
- Security group ID.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet_
type string - Ethernet type.
- id string
- Security group ID.
- port_
range_ numbermax - Maximum port number.
- port_
range_ numbermin - Minimum port number.
- protocol string
- Protocol.
- remote_
group_ stringid - Remote security group ID.
- remote_
ip_ stringprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- id String
- Security group ID.
- port
Range IntegerMax - Maximum port number.
- port
Range IntegerMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet
Type string - Ethernet type.
- id string
- Security group ID.
- port
Range numberMax - Maximum port number.
- port
Range numberMin - Minimum port number.
- protocol string
- Protocol.
- remote
Group stringId - Remote security group ID.
- remote
Ip stringPrefix - Remote IP prefix.
- description str
- Description of the rule.
- direction str
- Direction of the rule.
- ethernet_
type str - Ethernet type.
- id str
- Security group ID.
- port_
range_ intmax - Maximum port number.
- port_
range_ intmin - Minimum port number.
- protocol str
- Protocol.
- remote_
group_ strid - Remote security group ID.
- remote_
ip_ strprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- id String
- Security group ID.
- port
Range NumberMax - Maximum port number.
- port
Range NumberMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
GetCloudSecurityGroupLocation
- Region string
- Region.
- Region string
- Region.
- region string
- Region.
- region String
- Region.
- region string
- Region.
- region str
- Region.
- region String
- Region.
GetCloudSecurityGroupRule
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- Description string
- Description of the rule.
- Direction string
- Direction of the rule.
- Ethernet
Type string - Ethernet type.
- Port
Range intMax - Maximum port number.
- Port
Range intMin - Minimum port number.
- Protocol string
- Protocol.
- Remote
Group stringId - Remote security group ID.
- Remote
Ip stringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet_
type string - Ethernet type.
- port_
range_ numbermax - Maximum port number.
- port_
range_ numbermin - Minimum port number.
- protocol string
- Protocol.
- remote_
group_ stringid - Remote security group ID.
- remote_
ip_ stringprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- port
Range IntegerMax - Maximum port number.
- port
Range IntegerMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
- description string
- Description of the rule.
- direction string
- Direction of the rule.
- ethernet
Type string - Ethernet type.
- port
Range numberMax - Maximum port number.
- port
Range numberMin - Minimum port number.
- protocol string
- Protocol.
- remote
Group stringId - Remote security group ID.
- remote
Ip stringPrefix - Remote IP prefix.
- description str
- Description of the rule.
- direction str
- Direction of the rule.
- ethernet_
type str - Ethernet type.
- port_
range_ intmax - Maximum port number.
- port_
range_ intmin - Minimum port number.
- protocol str
- Protocol.
- remote_
group_ strid - Remote security group ID.
- remote_
ip_ strprefix - Remote IP prefix.
- description String
- Description of the rule.
- direction String
- Direction of the rule.
- ethernet
Type String - Ethernet type.
- port
Range NumberMax - Maximum port number.
- port
Range NumberMin - Minimum port number.
- protocol String
- Protocol.
- remote
Group StringId - Remote security group ID.
- remote
Ip StringPrefix - Remote IP prefix.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovhTerraform Provider.
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud
published on Friday, Jul 17, 2026 by OVHcloud