1. Packages
  2. Scaleway
  3. API Docs
  4. getVpc
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

scaleway.getVpc

Explore with Pulumi AI

scaleway logo
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

    Gets information about a Scaleway Virtual Private Cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    
    const byName = scaleway.getVpc({
        name: "foobar",
    });
    const byId = scaleway.getVpc({
        vpcId: "11111111-1111-1111-1111-111111111111",
    });
    const default = scaleway.getVpc({
        isDefault: true,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    by_name = scaleway.get_vpc(name="foobar")
    by_id = scaleway.get_vpc(vpc_id="11111111-1111-1111-1111-111111111111")
    default = scaleway.get_vpc(is_default=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.LookupVpc(ctx, &scaleway.LookupVpcArgs{
    			Name: pulumi.StringRef("foobar"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupVpc(ctx, &scaleway.LookupVpcArgs{
    			VpcId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupVpc(ctx, &scaleway.LookupVpcArgs{
    			IsDefault: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var byName = Scaleway.GetVpc.Invoke(new()
        {
            Name = "foobar",
        });
    
        var byId = Scaleway.GetVpc.Invoke(new()
        {
            VpcId = "11111111-1111-1111-1111-111111111111",
        });
    
        var @default = Scaleway.GetVpc.Invoke(new()
        {
            IsDefault = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.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) {
            final var byName = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .name("foobar")
                .build());
    
            final var byId = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .vpcId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var default = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .isDefault(true)
                .build());
    
        }
    }
    
    variables:
      byName:
        fn::invoke:
          Function: scaleway:getVpc
          Arguments:
            name: foobar
      byId:
        fn::invoke:
          Function: scaleway:getVpc
          Arguments:
            vpcId: 11111111-1111-1111-1111-111111111111
      default:
        fn::invoke:
          Function: scaleway:getVpc
          Arguments:
            isDefault: true
    

    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>
    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]
    func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
    func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput

    > 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)
    }
    public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getVpc:getVpc
      arguments:
        # arguments dictionary

    The following arguments are supported:

    IsDefault bool
    To get default VPC's information.
    Name string
    Name of the VPC. 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. One of name and vpc_id should be specified.
    IsDefault bool
    To get default VPC's information.
    Name string
    Name of the VPC. 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. One of name and vpc_id should be specified.
    isDefault Boolean
    To get default VPC's information.
    name String
    Name of the VPC. 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. One of name and vpc_id should be specified.
    isDefault boolean
    To get default VPC's information.
    name string
    Name of the VPC. 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. One of name and vpc_id should be specified.
    is_default bool
    To get default VPC's information.
    name str
    Name of the VPC. 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. One of name and vpc_id should be specified.
    isDefault Boolean
    To get default VPC's information.
    name String
    Name of the VPC. 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. One of name and vpc_id should be specified.

    getVpc Result

    The following output properties are available:

    CreatedAt string
    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
    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
    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
    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
    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
    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 logo
    Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse