scaleway.getContainer
The scaleway.containers.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 "@pulumiverse/scaleway";
const main = new scaleway.containers.Namespace("main", {});
const mainContainer = new scaleway.containers.Container("main", {
    name: "test-container-data",
    namespaceId: main.id,
});
// Get info by container name
const byName = scaleway.containers.getContainerOutput({
    namespaceId: main.id,
    name: mainContainer.name,
});
// Get info by container ID
const byId = scaleway.containers.getContainerOutput({
    namespaceId: main.id,
    containerId: mainContainer.id,
});
import pulumi
import pulumi_scaleway as scaleway
import pulumiverse_scaleway as scaleway
main = scaleway.containers.Namespace("main")
main_container = scaleway.containers.Container("main",
    name="test-container-data",
    namespace_id=main.id)
# Get info by container name
by_name = scaleway.containers.get_container_output(namespace_id=main.id,
    name=main_container.name)
# Get info by container ID
by_id = scaleway.containers.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/containers"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := containers.NewNamespace(ctx, "main", nil)
		if err != nil {
			return err
		}
		mainContainer, err := containers.NewContainer(ctx, "main", &containers.ContainerArgs{
			Name:        pulumi.String("test-container-data"),
			NamespaceId: main.ID(),
		})
		if err != nil {
			return err
		}
		// Get info by container name
		_ = containers.LookupContainerOutput(ctx, containers.GetContainerOutputArgs{
			NamespaceId: main.ID(),
			Name:        mainContainer.Name,
		}, nil)
		// Get info by container ID
		_ = containers.LookupContainerOutput(ctx, containers.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.Containers.Namespace("main");
    var mainContainer = new Scaleway.Containers.Container("main", new()
    {
        Name = "test-container-data",
        NamespaceId = main.Id,
    });
    // Get info by container name
    var byName = Scaleway.Containers.GetContainer.Invoke(new()
    {
        NamespaceId = main.Id,
        Name = mainContainer.Name,
    });
    // Get info by container ID
    var byId = Scaleway.Containers.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.containers.Namespace;
import com.pulumi.scaleway.containers.Container;
import com.pulumi.scaleway.containers.ContainerArgs;
import com.pulumi.scaleway.containers.ContainersFunctions;
import com.pulumi.scaleway.containers.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 Namespace("main");
        var mainContainer = new Container("mainContainer", ContainerArgs.builder()
            .name("test-container-data")
            .namespaceId(main.id())
            .build());
        // Get info by container name
        final var byName = ContainersFunctions.getContainer(GetContainerArgs.builder()
            .namespaceId(main.id())
            .name(mainContainer.name())
            .build());
        // Get info by container ID
        final var byId = ContainersFunctions.getContainer(GetContainerArgs.builder()
            .namespaceId(main.id())
            .containerId(mainContainer.id())
            .build());
    }
}
resources:
  main:
    type: scaleway:containers:Namespace
  mainContainer:
    type: scaleway:containers:Container
    name: main
    properties:
      name: test-container-data
      namespaceId: ${main.id}
variables:
  # Get info by container name
  byName:
    fn::invoke:
      function: scaleway:containers:getContainer
      arguments:
        namespaceId: ${main.id}
        name: ${mainContainer.name}
  # Get info by container ID
  byId:
    fn::invoke:
      function: scaleway:containers:getContainer
      arguments:
        namespaceId: ${main.id}
        containerId: ${mainContainer.id}
Arguments reference
This section lists the arguments that you can provide to the scaleway.containers.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
nameargument 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)
public static Output<GetContainerResult> getContainer(GetContainerArgs args, InvokeOptions options)
fn::invoke:
  function: scaleway:index/getContainer:getContainer
  arguments:
    # arguments dictionaryThe 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:
- Args List<string>
- Commands List<string>
- 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.
- HealthChecks List<Pulumiverse.Scaleway. Outputs. Get Container Health Check> 
- Health check configuration block of the container.
- HttpOption string
- Id string
- The provider-assigned unique ID for this managed resource.
- LocalStorage intLimit 
- 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.
- PrivateNetwork stringId 
- Protocol string
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- ScalingOptions List<Pulumiverse.Scaleway. Outputs. Get Container Scaling Option> 
- Configuration block used to decide when to scale up or down. Possible values:
- SecretEnvironment Dictionary<string, string>Variables 
- Status string
- The container status.
- List<string>
- 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.
- Args []string
- Commands []string
- 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.
- HealthChecks []GetContainer Health Check 
- Health check configuration block of the container.
- HttpOption string
- Id string
- The provider-assigned unique ID for this managed resource.
- LocalStorage intLimit 
- 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.
- PrivateNetwork stringId 
- Protocol string
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- ScalingOptions []GetContainer Scaling Option 
- Configuration block used to decide when to scale up or down. Possible values:
- SecretEnvironment map[string]stringVariables 
- Status string
- The container status.
- []string
- 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.
- args List<String>
- commands List<String>
- 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.
- healthChecks List<GetContainer Health Check> 
- Health check configuration block of the container.
- httpOption String
- id String
- The provider-assigned unique ID for this managed resource.
- localStorage IntegerLimit 
- 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.
- privateNetwork StringId 
- protocol String
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- scalingOptions List<GetContainer Scaling Option> 
- Configuration block used to decide when to scale up or down. Possible values:
- secretEnvironment Map<String,String>Variables 
- status String
- The container status.
- List<String>
- 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.
- args string[]
- commands string[]
- 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.
- healthChecks GetContainer Health Check[] 
- Health check configuration block of the container.
- httpOption string
- id string
- The provider-assigned unique ID for this managed resource.
- localStorage numberLimit 
- 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.
- privateNetwork stringId 
- protocol string
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- scalingOptions GetContainer Scaling Option[] 
- Configuration block used to decide when to scale up or down. Possible values:
- secretEnvironment {[key: string]: string}Variables 
- status string
- The container status.
- string[]
- 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.
- args Sequence[str]
- commands Sequence[str]
- 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.
- health_checks Sequence[GetContainer Health Check] 
- Health check configuration block of the container.
- http_option str
- id str
- The provider-assigned unique ID for this managed resource.
- local_storage_ intlimit 
- 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.
- private_network_ strid 
- protocol str
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- scaling_options Sequence[GetContainer Scaling Option] 
- Configuration block used to decide when to scale up or down. Possible values:
- secret_environment_ Mapping[str, str]variables 
- status str
- The container status.
- Sequence[str]
- 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.
- args List<String>
- commands List<String>
- 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.
- healthChecks List<Property Map>
- Health check configuration block of the container.
- httpOption String
- id String
- The provider-assigned unique ID for this managed resource.
- localStorage NumberLimit 
- 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.
- privateNetwork StringId 
- protocol String
- The communication protocol http1orh2c. Defaults tohttp1.
- 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.
- scalingOptions List<Property Map>
- Configuration block used to decide when to scale up or down. Possible values:
- secretEnvironment Map<String>Variables 
- status String
- The container status.
- List<String>
- 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.
Supporting Types
GetContainerHealthCheck   
- FailureThreshold int
- Number of consecutive health check failures before considering the container unhealthy.
- Https
List<Pulumiverse.Scaleway. Inputs. Get Container Health Check Http> 
- HTTP health check configuration.
- Interval string
- Period between health checks (in seconds).
- FailureThreshold int
- Number of consecutive health check failures before considering the container unhealthy.
- Https
[]GetContainer Health Check Http 
- HTTP health check configuration.
- Interval string
- Period between health checks (in seconds).
- failureThreshold Integer
- Number of consecutive health check failures before considering the container unhealthy.
- https
List<GetContainer Health Check Http> 
- HTTP health check configuration.
- interval String
- Period between health checks (in seconds).
- failureThreshold number
- Number of consecutive health check failures before considering the container unhealthy.
- https
GetContainer Health Check Http[] 
- HTTP health check configuration.
- interval string
- Period between health checks (in seconds).
- failure_threshold int
- Number of consecutive health check failures before considering the container unhealthy.
- https
Sequence[GetContainer Health Check Http] 
- HTTP health check configuration.
- interval str
- Period between health checks (in seconds).
- failureThreshold Number
- Number of consecutive health check failures before considering the container unhealthy.
- https List<Property Map>
- HTTP health check configuration.
- interval String
- Period between health checks (in seconds).
GetContainerHealthCheckHttp    
- Path string
- Path to use for the HTTP health check.
- Path string
- Path to use for the HTTP health check.
- path String
- Path to use for the HTTP health check.
- path string
- Path to use for the HTTP health check.
- path str
- Path to use for the HTTP health check.
- path String
- Path to use for the HTTP health check.
GetContainerScalingOption   
- ConcurrentRequests intThreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- CpuUsage intThreshold 
- Scale depending on the CPU usage of a container instance.
- MemoryUsage intThreshold 
- Scale depending on the memory usage of a container instance.
- ConcurrentRequests intThreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- CpuUsage intThreshold 
- Scale depending on the CPU usage of a container instance.
- MemoryUsage intThreshold 
- Scale depending on the memory usage of a container instance.
- concurrentRequests IntegerThreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- cpuUsage IntegerThreshold 
- Scale depending on the CPU usage of a container instance.
- memoryUsage IntegerThreshold 
- Scale depending on the memory usage of a container instance.
- concurrentRequests numberThreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- cpuUsage numberThreshold 
- Scale depending on the CPU usage of a container instance.
- memoryUsage numberThreshold 
- Scale depending on the memory usage of a container instance.
- concurrent_requests_ intthreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- cpu_usage_ intthreshold 
- Scale depending on the CPU usage of a container instance.
- memory_usage_ intthreshold 
- Scale depending on the memory usage of a container instance.
- concurrentRequests NumberThreshold 
- Scale depending on the number of concurrent requests being processed per container instance.
- cpuUsage NumberThreshold 
- Scale depending on the CPU usage of a container instance.
- memoryUsage NumberThreshold 
- Scale depending on the memory usage of a container instance.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the scalewayTerraform Provider.
 
