1. Packages
  2. Scaleway
  3. API Docs
  4. getVpc
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.getVpc

Explore with Pulumi AI

Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse
Deprecated: scaleway.index/getvpc.getVpc has been deprecated in favor of scaleway.network/getvpc.getVpc

Gets information about a Scaleway Virtual Private Cloud.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";

// Get info by name
const byName = scaleway.network.getVpc({
    name: "foobar",
});
// Get info by ID
const byId = scaleway.network.getVpc({
    vpcId: "11111111-1111-1111-1111-111111111111",
});
// Get default VPC info
const _default = scaleway.network.getVpc({
    isDefault: true,
});
Copy
import pulumi
import pulumi_scaleway as scaleway

# Get info by name
by_name = scaleway.network.get_vpc(name="foobar")
# Get info by ID
by_id = scaleway.network.get_vpc(vpc_id="11111111-1111-1111-1111-111111111111")
# Get default VPC info
default = scaleway.network.get_vpc(is_default=True)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Get info by name
		_, err := network.LookupVpc(ctx, &network.LookupVpcArgs{
			Name: pulumi.StringRef("foobar"),
		}, nil)
		if err != nil {
			return err
		}
		// Get info by ID
		_, err = network.LookupVpc(ctx, &network.LookupVpcArgs{
			VpcId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
		}, nil)
		if err != nil {
			return err
		}
		// Get default VPC info
		_, err = network.LookupVpc(ctx, &network.LookupVpcArgs{
			IsDefault: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    // Get info by name
    var byName = Scaleway.Network.GetVpc.Invoke(new()
    {
        Name = "foobar",
    });

    // Get info by ID
    var byId = Scaleway.Network.GetVpc.Invoke(new()
    {
        VpcId = "11111111-1111-1111-1111-111111111111",
    });

    // Get default VPC info
    var @default = Scaleway.Network.GetVpc.Invoke(new()
    {
        IsDefault = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.network.NetworkFunctions;
import com.pulumi.scaleway.network.inputs.GetVpcArgs;
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) {
        // Get info by name
        final var byName = NetworkFunctions.getVpc(GetVpcArgs.builder()
            .name("foobar")
            .build());

        // Get info by ID
        final var byId = NetworkFunctions.getVpc(GetVpcArgs.builder()
            .vpcId("11111111-1111-1111-1111-111111111111")
            .build());

        // Get default VPC info
        final var default = NetworkFunctions.getVpc(GetVpcArgs.builder()
            .isDefault(true)
            .build());

    }
}
Copy
variables:
  # Get info by name
  byName:
    fn::invoke:
      function: scaleway:network:getVpc
      arguments:
        name: foobar
  # Get info by ID
  byId:
    fn::invoke:
      function: scaleway:network:getVpc
      arguments:
        vpcId: 11111111-1111-1111-1111-111111111111
  # Get default VPC info
  default:
    fn::invoke:
      function: scaleway:network:getVpc
      arguments:
        isDefault: true
Copy

Using getVpc

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 getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
function getVpcOutput(args: GetVpcOutputArgs, opts?: InvokeOptions): Output<GetVpcResult>
Copy
def get_vpc(is_default: Optional[bool] = None,
            name: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            vpc_id: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetVpcResult
def get_vpc_output(is_default: Optional[pulumi.Input[bool]] = None,
            name: Optional[pulumi.Input[str]] = None,
            organization_id: Optional[pulumi.Input[str]] = None,
            project_id: Optional[pulumi.Input[str]] = None,
            region: Optional[pulumi.Input[str]] = None,
            vpc_id: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetVpcResult]
Copy
func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput
Copy

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

public static class GetVpc 
{
    public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcResult> Invoke(GetVpcInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
public static Output<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: scaleway:index/getVpc:getVpc
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

IsDefault bool
Whether the targeted VPC is the default VPC.
Name string
Name of the VPC. A maximum of one of name and vpc_id should be specified.
OrganizationId string
The ID of the Organization the VPC is associated with.
ProjectId string
project_id) The ID of the Project the VPC is associated with.
Region string
VpcId string
ID of the VPC. A maximum of one of name and vpc_id should be specified.
IsDefault bool
Whether the targeted VPC is the default VPC.
Name string
Name of the VPC. A maximum of one of name and vpc_id should be specified.
OrganizationId string
The ID of the Organization the VPC is associated with.
ProjectId string
project_id) The ID of the Project the VPC is associated with.
Region string
VpcId string
ID of the VPC. A maximum of one of name and vpc_id should be specified.
isDefault Boolean
Whether the targeted VPC is the default VPC.
name String
Name of the VPC. A maximum of one of name and vpc_id should be specified.
organizationId String
The ID of the Organization the VPC is associated with.
projectId String
project_id) The ID of the Project the VPC is associated with.
region String
vpcId String
ID of the VPC. A maximum of one of name and vpc_id should be specified.
isDefault boolean
Whether the targeted VPC is the default VPC.
name string
Name of the VPC. A maximum of one of name and vpc_id should be specified.
organizationId string
The ID of the Organization the VPC is associated with.
projectId string
project_id) The ID of the Project the VPC is associated with.
region string
vpcId string
ID of the VPC. A maximum of one of name and vpc_id should be specified.
is_default bool
Whether the targeted VPC is the default VPC.
name str
Name of the VPC. A maximum of one of name and vpc_id should be specified.
organization_id str
The ID of the Organization the VPC is associated with.
project_id str
project_id) The ID of the Project the VPC is associated with.
region str
vpc_id str
ID of the VPC. A maximum of one of name and vpc_id should be specified.
isDefault Boolean
Whether the targeted VPC is the default VPC.
name String
Name of the VPC. A maximum of one of name and vpc_id should be specified.
organizationId String
The ID of the Organization the VPC is associated with.
projectId String
project_id) The ID of the Project the VPC is associated with.
region String
vpcId String
ID of the VPC. A maximum of one of name and vpc_id should be specified.

getVpc Result

The following output properties are available:

CreatedAt string
EnableRouting bool
Id string
The provider-assigned unique ID for this managed resource.
OrganizationId string
Tags List<string>
UpdatedAt string
IsDefault bool
Name string
ProjectId string
Region string
VpcId string
CreatedAt string
EnableRouting bool
Id string
The provider-assigned unique ID for this managed resource.
OrganizationId string
Tags []string
UpdatedAt string
IsDefault bool
Name string
ProjectId string
Region string
VpcId string
createdAt String
enableRouting Boolean
id String
The provider-assigned unique ID for this managed resource.
organizationId String
tags List<String>
updatedAt String
isDefault Boolean
name String
projectId String
region String
vpcId String
createdAt string
enableRouting boolean
id string
The provider-assigned unique ID for this managed resource.
organizationId string
tags string[]
updatedAt string
isDefault boolean
name string
projectId string
region string
vpcId string
created_at str
enable_routing bool
id str
The provider-assigned unique ID for this managed resource.
organization_id str
tags Sequence[str]
updated_at str
is_default bool
name str
project_id str
region str
vpc_id str
createdAt String
enableRouting Boolean
id String
The provider-assigned unique ID for this managed resource.
organizationId String
tags List<String>
updatedAt String
isDefault Boolean
name String
projectId String
region String
vpcId String

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse