ibm.FunctionNamespace
Explore with Pulumi AI
Create, update, or delete an IBM Cloud Functions namespace. For more information, about managing namespace, see managing namespace. Then, you can create IAM managed namespaces to group entities such as actions, triggers or both.
Example Usage
The following example creates an IAM based namespace and package at a specific location.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const resource_group = ibm.getResourceGroup({
name: _var.resource_group,
});
const namespace = new ibm.FunctionNamespace("namespace", {resourceGroupId: resource_group.then(resource_group => resource_group.id)});
const _package = new ibm.FunctionPackage("package", {namespace: namespace.name});
import pulumi
import pulumi_ibm as ibm
resource_group = ibm.get_resource_group(name=var["resource_group"])
namespace = ibm.FunctionNamespace("namespace", resource_group_id=resource_group.id)
package = ibm.FunctionPackage("package", namespace=namespace.name)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
resource_group, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
Name: pulumi.StringRef(_var.Resource_group),
}, nil)
if err != nil {
return err
}
namespace, err := ibm.NewFunctionNamespace(ctx, "namespace", &ibm.FunctionNamespaceArgs{
ResourceGroupId: pulumi.String(resource_group.Id),
})
if err != nil {
return err
}
_, err = ibm.NewFunctionPackage(ctx, "package", &ibm.FunctionPackageArgs{
Namespace: namespace.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var resource_group = Ibm.GetResourceGroup.Invoke(new()
{
Name = @var.Resource_group,
});
var @namespace = new Ibm.FunctionNamespace("namespace", new()
{
ResourceGroupId = resource_group.Apply(resource_group => resource_group.Apply(getResourceGroupResult => getResourceGroupResult.Id)),
});
var package = new Ibm.FunctionPackage("package", new()
{
Namespace = @namespace.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetResourceGroupArgs;
import com.pulumi.ibm.FunctionNamespace;
import com.pulumi.ibm.FunctionNamespaceArgs;
import com.pulumi.ibm.FunctionPackage;
import com.pulumi.ibm.FunctionPackageArgs;
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 resource-group = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
.name(var_.resource_group())
.build());
var namespace = new FunctionNamespace("namespace", FunctionNamespaceArgs.builder()
.resourceGroupId(resource_group.id())
.build());
var package_ = new FunctionPackage("package", FunctionPackageArgs.builder()
.namespace(namespace.name())
.build());
}
}
resources:
namespace:
type: ibm:FunctionNamespace
properties:
resourceGroupId: ${["resource-group"].id}
package:
type: ibm:FunctionPackage
properties:
namespace: ${namespace.name}
variables:
resource-group:
fn::invoke:
function: ibm:getResourceGroup
arguments:
name: ${var.resource_group}
Create FunctionNamespace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FunctionNamespace(name: string, args: FunctionNamespaceArgs, opts?: CustomResourceOptions);
@overload
def FunctionNamespace(resource_name: str,
args: FunctionNamespaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FunctionNamespace(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_id: Optional[str] = None,
description: Optional[str] = None,
function_namespace_id: Optional[str] = None,
name: Optional[str] = None)
func NewFunctionNamespace(ctx *Context, name string, args FunctionNamespaceArgs, opts ...ResourceOption) (*FunctionNamespace, error)
public FunctionNamespace(string name, FunctionNamespaceArgs args, CustomResourceOptions? opts = null)
public FunctionNamespace(String name, FunctionNamespaceArgs args)
public FunctionNamespace(String name, FunctionNamespaceArgs args, CustomResourceOptions options)
type: ibm:FunctionNamespace
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FunctionNamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FunctionNamespaceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FunctionNamespaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionNamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FunctionNamespaceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var functionNamespaceResource = new Ibm.FunctionNamespace("functionNamespaceResource", new()
{
ResourceGroupId = "string",
Description = "string",
FunctionNamespaceId = "string",
Name = "string",
});
example, err := ibm.NewFunctionNamespace(ctx, "functionNamespaceResource", &ibm.FunctionNamespaceArgs{
ResourceGroupId: pulumi.String("string"),
Description: pulumi.String("string"),
FunctionNamespaceId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var functionNamespaceResource = new FunctionNamespace("functionNamespaceResource", FunctionNamespaceArgs.builder()
.resourceGroupId("string")
.description("string")
.functionNamespaceId("string")
.name("string")
.build());
function_namespace_resource = ibm.FunctionNamespace("functionNamespaceResource",
resource_group_id="string",
description="string",
function_namespace_id="string",
name="string")
const functionNamespaceResource = new ibm.FunctionNamespace("functionNamespaceResource", {
resourceGroupId: "string",
description: "string",
functionNamespaceId: "string",
name: "string",
});
type: ibm:FunctionNamespace
properties:
description: string
functionNamespaceId: string
name: string
resourceGroupId: string
FunctionNamespace Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FunctionNamespace resource accepts the following input properties:
- Resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - Description string
- The description of the namespace.
- Function
Namespace stringId - (String) The unique ID of the new namespace.
- Name string
- The name of the namespace.
- Resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - Description string
- The description of the namespace.
- Function
Namespace stringId - (String) The unique ID of the new namespace.
- Name string
- The name of the namespace.
- resource
Group StringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - description String
- The description of the namespace.
- function
Namespace StringId - (String) The unique ID of the new namespace.
- name String
- The name of the namespace.
- resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - description string
- The description of the namespace.
- function
Namespace stringId - (String) The unique ID of the new namespace.
- name string
- The name of the namespace.
- resource_
group_ strid - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - description str
- The description of the namespace.
- function_
namespace_ strid - (String) The unique ID of the new namespace.
- name str
- The name of the namespace.
- resource
Group StringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
. - description String
- The description of the namespace.
- function
Namespace StringId - (String) The unique ID of the new namespace.
- name String
- The name of the namespace.
Outputs
All input properties are implicitly available as output properties. Additionally, the FunctionNamespace resource produces the following output properties:
Look up Existing FunctionNamespace Resource
Get an existing FunctionNamespace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FunctionNamespaceState, opts?: CustomResourceOptions): FunctionNamespace
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
function_namespace_id: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_id: Optional[str] = None) -> FunctionNamespace
func GetFunctionNamespace(ctx *Context, name string, id IDInput, state *FunctionNamespaceState, opts ...ResourceOption) (*FunctionNamespace, error)
public static FunctionNamespace Get(string name, Input<string> id, FunctionNamespaceState? state, CustomResourceOptions? opts = null)
public static FunctionNamespace get(String name, Output<String> id, FunctionNamespaceState state, CustomResourceOptions options)
resources: _: type: ibm:FunctionNamespace get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- The description of the namespace.
- Function
Namespace stringId - (String) The unique ID of the new namespace.
- Location string
- (String) Target locations of the namespace.
- Name string
- The name of the namespace.
- Resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
- Description string
- The description of the namespace.
- Function
Namespace stringId - (String) The unique ID of the new namespace.
- Location string
- (String) Target locations of the namespace.
- Name string
- The name of the namespace.
- Resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
- description String
- The description of the namespace.
- function
Namespace StringId - (String) The unique ID of the new namespace.
- location String
- (String) Target locations of the namespace.
- name String
- The name of the namespace.
- resource
Group StringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
- description string
- The description of the namespace.
- function
Namespace stringId - (String) The unique ID of the new namespace.
- location string
- (String) Target locations of the namespace.
- name string
- The name of the namespace.
- resource
Group stringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
- description str
- The description of the namespace.
- function_
namespace_ strid - (String) The unique ID of the new namespace.
- location str
- (String) Target locations of the namespace.
- name str
- The name of the namespace.
- resource_
group_ strid - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
- description String
- The description of the namespace.
- function
Namespace StringId - (String) The unique ID of the new namespace.
- location String
- (String) Target locations of the namespace.
- name String
- The name of the namespace.
- resource
Group StringId - The ID of the resource group. You can retrieve the value from data source
ibm.ResourceGroup
.
Import
The ibm_function_namespace
resource can be imported by using the namespace ID.
Note
Namespace import will not return the value for resource_group_id
attribute.
Syntax
$ pulumi import ibm:index/functionNamespace:FunctionNamespace namespace <namespaceID>
Example
$ pulumi import ibm:index/functionNamespace:FunctionNamespace namespace 4cf78bb1-2298-413f-8575-2464948a344b
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.