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

scaleway.getContainer

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    The scaleway.Container data source is used to retrieve information about a Serverless Container.

    Refer to the Serverless Containers product documentation and API documentation for more information.

    For more information on the limitations of Serverless Containers, refer to the dedicated documentation.

    Retrieve a Serverless Container

    The following commands allow you to:

    • retrieve a container by its name
    • retrieve a container by its ID
    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.ContainerNamespace("main", {});
    const mainContainer = new scaleway.Container("main", {
        name: "test-container-data",
        namespaceId: main.id,
    });
    // Get info by container name
    const byName = scaleway.getContainerOutput({
        namespaceId: main.id,
        name: mainContainer.name,
    });
    // Get info by container ID
    const byId = scaleway.getContainerOutput({
        namespaceId: main.id,
        containerId: mainContainer.id,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.ContainerNamespace("main")
    main_container = scaleway.Container("main",
        name="test-container-data",
        namespace_id=main.id)
    # Get info by container name
    by_name = scaleway.get_container_output(namespace_id=main.id,
        name=main_container.name)
    # Get info by container ID
    by_id = scaleway.get_container_output(namespace_id=main.id,
        container_id=main_container.id)
    
    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 {
    		main, err := scaleway.NewContainerNamespace(ctx, "main", nil)
    		if err != nil {
    			return err
    		}
    		mainContainer, err := scaleway.NewContainer(ctx, "main", &scaleway.ContainerArgs{
    			Name:        pulumi.String("test-container-data"),
    			NamespaceId: main.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		// Get info by container name
    		_ = scaleway.LookupContainerOutput(ctx, scaleway.GetContainerOutputArgs{
    			NamespaceId: main.ID(),
    			Name:        mainContainer.Name,
    		}, nil)
    		// Get info by container ID
    		_ = scaleway.LookupContainerOutput(ctx, scaleway.GetContainerOutputArgs{
    			NamespaceId: main.ID(),
    			ContainerId: mainContainer.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.ContainerNamespace("main");
    
        var mainContainer = new Scaleway.Container("main", new()
        {
            Name = "test-container-data",
            NamespaceId = main.Id,
        });
    
        // Get info by container name
        var byName = Scaleway.GetContainer.Invoke(new()
        {
            NamespaceId = main.Id,
            Name = mainContainer.Name,
        });
    
        // Get info by container ID
        var byId = Scaleway.GetContainer.Invoke(new()
        {
            NamespaceId = main.Id,
            ContainerId = mainContainer.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ContainerNamespace;
    import com.pulumi.scaleway.Container;
    import com.pulumi.scaleway.ContainerArgs;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetContainerArgs;
    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) {
            var main = new ContainerNamespace("main");
    
            var mainContainer = new Container("mainContainer", ContainerArgs.builder()
                .name("test-container-data")
                .namespaceId(main.id())
                .build());
    
            // Get info by container name
            final var byName = ScalewayFunctions.getContainer(GetContainerArgs.builder()
                .namespaceId(main.id())
                .name(mainContainer.name())
                .build());
    
            // Get info by container ID
            final var byId = ScalewayFunctions.getContainer(GetContainerArgs.builder()
                .namespaceId(main.id())
                .containerId(mainContainer.id())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:ContainerNamespace
      mainContainer:
        type: scaleway:Container
        name: main
        properties:
          name: test-container-data
          namespaceId: ${main.id}
    variables:
      # Get info by container name
      byName:
        fn::invoke:
          Function: scaleway:getContainer
          Arguments:
            namespaceId: ${main.id}
            name: ${mainContainer.name}
      # Get info by container ID
      byId:
        fn::invoke:
          Function: scaleway:getContainer
          Arguments:
            namespaceId: ${main.id}
            containerId: ${mainContainer.id}
    

    Arguments reference

    This section lists the arguments that you can provide to the scaleway.Container data source to filter and retrieve the desired namespace. Each argument has a specific purpose:

    • name - (Required) The unique name of the container.

    • namespace_id - (Required) The container namespace ID of the container.

    • project_id - (Optional) The unique identifier of the project with which the container is associated.

    Important Updating the name argument will recreate the container.

    Using getContainer

    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 getContainer(args: GetContainerArgs, opts?: InvokeOptions): Promise<GetContainerResult>
    function getContainerOutput(args: GetContainerOutputArgs, opts?: InvokeOptions): Output<GetContainerResult>
    def get_container(container_id: Optional[str] = None,
                      name: Optional[str] = None,
                      namespace_id: Optional[str] = None,
                      project_id: Optional[str] = None,
                      region: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetContainerResult
    def get_container_output(container_id: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      namespace_id: Optional[pulumi.Input[str]] = None,
                      project_id: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetContainerResult]
    func LookupContainer(ctx *Context, args *LookupContainerArgs, opts ...InvokeOption) (*LookupContainerResult, error)
    func LookupContainerOutput(ctx *Context, args *LookupContainerOutputArgs, opts ...InvokeOption) LookupContainerResultOutput

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

    public static class GetContainer 
    {
        public static Task<GetContainerResult> InvokeAsync(GetContainerArgs args, InvokeOptions? opts = null)
        public static Output<GetContainerResult> Invoke(GetContainerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContainerResult> getContainer(GetContainerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getContainer:getContainer
      arguments:
        # arguments dictionary

    The following arguments are supported:

    NamespaceId string
    ContainerId string
    Name string
    ProjectId string
    Region string
    (Defaults to provider region) The region in which the container was created.
    NamespaceId string
    ContainerId string
    Name string
    ProjectId string
    Region string
    (Defaults to provider region) The region in which the container was created.
    namespaceId String
    containerId String
    name String
    projectId String
    region String
    (Defaults to provider region) The region in which the container was created.
    namespaceId string
    containerId string
    name string
    projectId string
    region string
    (Defaults to provider region) The region in which the container was created.
    namespace_id str
    container_id str
    name str
    project_id str
    region str
    (Defaults to provider region) The region in which the container was created.
    namespaceId String
    containerId String
    name String
    projectId String
    region String
    (Defaults to provider region) The region in which the container was created.

    getContainer Result

    The following output properties are available:

    CpuLimit int
    The amount of vCPU computing resources to allocate to each container.
    CronStatus string
    The cron status of the container.
    Deploy bool
    Boolean indicating whether the container is on a production environment.
    Description string
    The description of the container.
    DomainName string
    The container domain name.
    EnvironmentVariables Dictionary<string, string>
    The environment variables of the container.
    ErrorMessage string
    The error message of the container.
    HttpOption string
    Id string
    The provider-assigned unique ID for this managed resource.
    MaxConcurrency int
    The maximum number of simultaneous requests your container can handle at the same time.
    MaxScale int
    The maximum number of instances the container can scale to.
    MemoryLimit int
    The memory resources in MB to allocate to each container.
    MinScale int
    The minimum number of container instances running continuously.
    NamespaceId string
    Port int
    The port to expose the container.
    Privacy string
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    Protocol string
    The communication protocol http1 or h2c. Defaults to http1.
    RegistryImage string
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    RegistrySha256 string
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    Sandbox string
    (Optional) Execution environment of the container.
    SecretEnvironmentVariables Dictionary<string, string>
    Status string
    The container status.
    Timeout int
    The maximum amount of time your container can spend processing a request before being stopped.
    ContainerId string
    Name string
    ProjectId string
    Region string
    (Defaults to provider region) The region in which the container was created.
    CpuLimit int
    The amount of vCPU computing resources to allocate to each container.
    CronStatus string
    The cron status of the container.
    Deploy bool
    Boolean indicating whether the container is on a production environment.
    Description string
    The description of the container.
    DomainName string
    The container domain name.
    EnvironmentVariables map[string]string
    The environment variables of the container.
    ErrorMessage string
    The error message of the container.
    HttpOption string
    Id string
    The provider-assigned unique ID for this managed resource.
    MaxConcurrency int
    The maximum number of simultaneous requests your container can handle at the same time.
    MaxScale int
    The maximum number of instances the container can scale to.
    MemoryLimit int
    The memory resources in MB to allocate to each container.
    MinScale int
    The minimum number of container instances running continuously.
    NamespaceId string
    Port int
    The port to expose the container.
    Privacy string
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    Protocol string
    The communication protocol http1 or h2c. Defaults to http1.
    RegistryImage string
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    RegistrySha256 string
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    Sandbox string
    (Optional) Execution environment of the container.
    SecretEnvironmentVariables map[string]string
    Status string
    The container status.
    Timeout int
    The maximum amount of time your container can spend processing a request before being stopped.
    ContainerId string
    Name string
    ProjectId string
    Region string
    (Defaults to provider region) The region in which the container was created.
    cpuLimit Integer
    The amount of vCPU computing resources to allocate to each container.
    cronStatus String
    The cron status of the container.
    deploy Boolean
    Boolean indicating whether the container is on a production environment.
    description String
    The description of the container.
    domainName String
    The container domain name.
    environmentVariables Map<String,String>
    The environment variables of the container.
    errorMessage String
    The error message of the container.
    httpOption String
    id String
    The provider-assigned unique ID for this managed resource.
    maxConcurrency Integer
    The maximum number of simultaneous requests your container can handle at the same time.
    maxScale Integer
    The maximum number of instances the container can scale to.
    memoryLimit Integer
    The memory resources in MB to allocate to each container.
    minScale Integer
    The minimum number of container instances running continuously.
    namespaceId String
    port Integer
    The port to expose the container.
    privacy String
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    protocol String
    The communication protocol http1 or h2c. Defaults to http1.
    registryImage String
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    registrySha256 String
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    sandbox String
    (Optional) Execution environment of the container.
    secretEnvironmentVariables Map<String,String>
    status String
    The container status.
    timeout Integer
    The maximum amount of time your container can spend processing a request before being stopped.
    containerId String
    name String
    projectId String
    region String
    (Defaults to provider region) The region in which the container was created.
    cpuLimit number
    The amount of vCPU computing resources to allocate to each container.
    cronStatus string
    The cron status of the container.
    deploy boolean
    Boolean indicating whether the container is on a production environment.
    description string
    The description of the container.
    domainName string
    The container domain name.
    environmentVariables {[key: string]: string}
    The environment variables of the container.
    errorMessage string
    The error message of the container.
    httpOption string
    id string
    The provider-assigned unique ID for this managed resource.
    maxConcurrency number
    The maximum number of simultaneous requests your container can handle at the same time.
    maxScale number
    The maximum number of instances the container can scale to.
    memoryLimit number
    The memory resources in MB to allocate to each container.
    minScale number
    The minimum number of container instances running continuously.
    namespaceId string
    port number
    The port to expose the container.
    privacy string
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    protocol string
    The communication protocol http1 or h2c. Defaults to http1.
    registryImage string
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    registrySha256 string
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    sandbox string
    (Optional) Execution environment of the container.
    secretEnvironmentVariables {[key: string]: string}
    status string
    The container status.
    timeout number
    The maximum amount of time your container can spend processing a request before being stopped.
    containerId string
    name string
    projectId string
    region string
    (Defaults to provider region) The region in which the container was created.
    cpu_limit int
    The amount of vCPU computing resources to allocate to each container.
    cron_status str
    The cron status of the container.
    deploy bool
    Boolean indicating whether the container is on a production environment.
    description str
    The description of the container.
    domain_name str
    The container domain name.
    environment_variables Mapping[str, str]
    The environment variables of the container.
    error_message str
    The error message of the container.
    http_option str
    id str
    The provider-assigned unique ID for this managed resource.
    max_concurrency int
    The maximum number of simultaneous requests your container can handle at the same time.
    max_scale int
    The maximum number of instances the container can scale to.
    memory_limit int
    The memory resources in MB to allocate to each container.
    min_scale int
    The minimum number of container instances running continuously.
    namespace_id str
    port int
    The port to expose the container.
    privacy str
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    protocol str
    The communication protocol http1 or h2c. Defaults to http1.
    registry_image str
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    registry_sha256 str
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    sandbox str
    (Optional) Execution environment of the container.
    secret_environment_variables Mapping[str, str]
    status str
    The container status.
    timeout int
    The maximum amount of time your container can spend processing a request before being stopped.
    container_id str
    name str
    project_id str
    region str
    (Defaults to provider region) The region in which the container was created.
    cpuLimit Number
    The amount of vCPU computing resources to allocate to each container.
    cronStatus String
    The cron status of the container.
    deploy Boolean
    Boolean indicating whether the container is on a production environment.
    description String
    The description of the container.
    domainName String
    The container domain name.
    environmentVariables Map<String>
    The environment variables of the container.
    errorMessage String
    The error message of the container.
    httpOption String
    id String
    The provider-assigned unique ID for this managed resource.
    maxConcurrency Number
    The maximum number of simultaneous requests your container can handle at the same time.
    maxScale Number
    The maximum number of instances the container can scale to.
    memoryLimit Number
    The memory resources in MB to allocate to each container.
    minScale Number
    The minimum number of container instances running continuously.
    namespaceId String
    port Number
    The port to expose the container.
    privacy String
    The privacy type define the way to authenticate to your container. Refer to the dedicated documentation for more information.
    protocol String
    The communication protocol http1 or h2c. Defaults to http1.
    registryImage String
    The registry image address (e.g. rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE).
    registrySha256 String
    The sha256 of your source registry image, changing it will re-apply the deployment. Can be any string.
    sandbox String
    (Optional) Execution environment of the container.
    secretEnvironmentVariables Map<String>
    status String
    The container status.
    timeout Number
    The maximum amount of time your container can spend processing a request before being stopped.
    containerId String
    name String
    projectId String
    region String
    (Defaults to provider region) The region in which the container was created.

    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