scaleway.getContainer
Explore with Pulumi AI
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:
- Namespace
Id string - Container
Id string - Name string
- Project
Id string - Region string
- (Defaults to provider
region
) The region in which the container was created.
- Namespace
Id string - Container
Id string - Name string
- Project
Id string - Region string
- (Defaults to provider
region
) The region in which the container was created.
- namespace
Id String - container
Id String - name String
- project
Id String - region String
- (Defaults to provider
region
) The region in which the container was created.
- namespace
Id string - container
Id string - name string
- project
Id 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.
- namespace
Id String - container
Id String - name String
- project
Id String - region String
- (Defaults to provider
region
) The region in which the container was created.
getContainer Result
The following output properties are available:
- Cpu
Limit int - The amount of vCPU computing resources to allocate to each container.
- Cron
Status 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.
- Domain
Name string - The container domain name.
- Environment
Variables Dictionary<string, string> - The environment variables of the container.
- Error
Message string - The error message of the container.
- Http
Option string - Id string
- 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 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
orh2c
. Defaults tohttp1
. - Registry
Image string - The registry image address (e.g.
rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE
). - Registry
Sha256 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.
- Secret
Environment Dictionary<string, string>Variables - Status string
- The container status.
- Timeout int
- The maximum amount of time your container can spend processing a request before being stopped.
- Container
Id string - Name string
- Project
Id 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 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.
- Domain
Name string - The container domain name.
- Environment
Variables map[string]string - The environment variables of the container.
- Error
Message string - The error message of the container.
- Http
Option string - Id string
- 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 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
orh2c
. Defaults tohttp1
. - Registry
Image string - The registry image address (e.g.
rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE
). - Registry
Sha256 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.
- Secret
Environment map[string]stringVariables - Status string
- The container status.
- Timeout int
- The maximum amount of time your container can spend processing a request before being stopped.
- Container
Id string - Name string
- Project
Id string - Region string
- (Defaults to provider
region
) The region in which the container was created.
- cpu
Limit Integer - The amount of vCPU computing resources to allocate to each container.
- cron
Status 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.
- domain
Name String - The container domain name.
- environment
Variables Map<String,String> - The environment variables of the container.
- error
Message String - The error message of the container.
- http
Option String - id String
- The provider-assigned unique ID for this managed resource.
- max
Concurrency Integer - The maximum number of simultaneous requests your container can handle at the same time.
- max
Scale Integer - The maximum number of instances the container can scale to.
- memory
Limit Integer - The memory resources in MB to allocate to each container.
- min
Scale Integer - The minimum number of container instances running continuously.
- namespace
Id 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
orh2c
. Defaults tohttp1
. - registry
Image String - The registry image address (e.g.
rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE
). - registry
Sha256 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.
- secret
Environment Map<String,String>Variables - status String
- The container status.
- timeout Integer
- The maximum amount of time your container can spend processing a request before being stopped.
- container
Id String - name String
- project
Id String - region String
- (Defaults to provider
region
) The region in which the container was created.
- cpu
Limit number - The amount of vCPU computing resources to allocate to each container.
- cron
Status 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.
- domain
Name string - The container domain name.
- environment
Variables {[key: string]: string} - The environment variables of the container.
- error
Message string - The error message of the container.
- http
Option string - id string
- The provider-assigned unique ID for this managed resource.
- max
Concurrency number - The maximum number of simultaneous requests your container can handle at the same time.
- max
Scale number - The maximum number of instances the container can scale to.
- memory
Limit number - The memory resources in MB to allocate to each container.
- min
Scale number - The minimum number of container instances running continuously.
- namespace
Id 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
orh2c
. Defaults tohttp1
. - registry
Image string - The registry image address (e.g.
rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE
). - registry
Sha256 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.
- secret
Environment {[key: string]: string}Variables - status string
- The container status.
- timeout number
- The maximum amount of time your container can spend processing a request before being stopped.
- container
Id string - name string
- project
Id 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
orh2c
. 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.
- secret_
environment_ Mapping[str, str]variables - 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.
- cpu
Limit Number - The amount of vCPU computing resources to allocate to each container.
- cron
Status 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.
- domain
Name String - The container domain name.
- environment
Variables Map<String> - The environment variables of the container.
- error
Message String - The error message of the container.
- http
Option String - id String
- The provider-assigned unique ID for this managed resource.
- max
Concurrency Number - The maximum number of simultaneous requests your container can handle at the same time.
- max
Scale Number - The maximum number of instances the container can scale to.
- memory
Limit Number - The memory resources in MB to allocate to each container.
- min
Scale Number - The minimum number of container instances running continuously.
- namespace
Id 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
orh2c
. Defaults tohttp1
. - registry
Image String - The registry image address (e.g.
rg.fr-par.scw.cloud/$NAMESPACE/$IMAGE
). - registry
Sha256 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.
- secret
Environment Map<String>Variables - status String
- The container status.
- timeout Number
- The maximum amount of time your container can spend processing a request before being stopped.
- container
Id String - name String
- project
Id 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.