1. Packages
  2. Scaleway
  3. API Docs
  4. getVpc
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.getVpc

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 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";
    
    // Get info by name
    const byName = scaleway.getVpc({
        name: "foobar",
    });
    // Get info by ID
    const byId = scaleway.getVpc({
        vpcId: "11111111-1111-1111-1111-111111111111",
    });
    // Get default VPC info
    const default = scaleway.getVpc({
        isDefault: true,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    # Get info by name
    by_name = scaleway.get_vpc(name="foobar")
    # Get info by ID
    by_id = scaleway.get_vpc(vpc_id="11111111-1111-1111-1111-111111111111")
    # Get default VPC info
    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 {
    		// Get info by name
    		_, err := scaleway.LookupVpc(ctx, &scaleway.LookupVpcArgs{
    			Name: pulumi.StringRef("foobar"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Get info by ID
    		_, err = scaleway.LookupVpc(ctx, &scaleway.LookupVpcArgs{
    			VpcId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Get default VPC info
    		_, 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(() => 
    {
        // Get info by name
        var byName = Scaleway.GetVpc.Invoke(new()
        {
            Name = "foobar",
        });
    
        // Get info by ID
        var byId = Scaleway.GetVpc.Invoke(new()
        {
            VpcId = "11111111-1111-1111-1111-111111111111",
        });
    
        // Get default VPC info
        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) {
            // Get info by name
            final var byName = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .name("foobar")
                .build());
    
            // Get info by ID
            final var byId = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .vpcId("11111111-1111-1111-1111-111111111111")
                .build());
    
            // Get default VPC info
            final var default = ScalewayFunctions.getVpc(GetVpcArgs.builder()
                .isDefault(true)
                .build());
    
        }
    }
    
    variables:
      # Get info by name
      byName:
        fn::invoke:
          Function: scaleway:getVpc
          Arguments:
            name: foobar
      # Get info by ID
      byId:
        fn::invoke:
          Function: scaleway:getVpc
          Arguments:
            vpcId: 11111111-1111-1111-1111-111111111111
      # Get default VPC info
      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
    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 logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse