1. Packages
  2. Gcore Provider
  3. API Docs
  4. FaasKey
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.FaasKey

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Represents FaaS API key

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const secretFaasKey = new gcore.FaasKey("secretFaasKey", {
        description: "Keys description",
        projectId: 1,
        regionId: 1,
    });
    export const secret = resource.gcore_faas_key.secret;
    
    import pulumi
    import pulumi_gcore as gcore
    
    secret_faas_key = gcore.FaasKey("secretFaasKey",
        description="Keys description",
        project_id=1,
        region_id=1)
    pulumi.export("secret", resource["gcore_faas_key"]["secret"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.NewFaasKey(ctx, "secretFaasKey", &gcore.FaasKeyArgs{
    			Description: pulumi.String("Keys description"),
    			ProjectId:   pulumi.Float64(1),
    			RegionId:    pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("secret", resource.Gcore_faas_key.Secret)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var secretFaasKey = new Gcore.FaasKey("secretFaasKey", new()
        {
            Description = "Keys description",
            ProjectId = 1,
            RegionId = 1,
        });
    
        return new Dictionary<string, object?>
        {
            ["secret"] = resource.Gcore_faas_key.Secret,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.FaasKey;
    import com.pulumi.gcore.FaasKeyArgs;
    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 secretFaasKey = new FaasKey("secretFaasKey", FaasKeyArgs.builder()
                .description("Keys description")
                .projectId(1)
                .regionId(1)
                .build());
    
            ctx.export("secret", resource.gcore_faas_key().secret());
        }
    }
    
    resources:
      secretFaasKey:
        type: gcore:FaasKey
        properties:
          description: Keys description
          projectId: 1
          regionId: 1
    outputs:
      # To get sensitive value use `terraform output secret`
      secret: ${resource.gcore_faas_key.secret}
    

    Create FaasKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new FaasKey(name: string, args?: FaasKeyArgs, opts?: CustomResourceOptions);
    @overload
    def FaasKey(resource_name: str,
                args: Optional[FaasKeyArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def FaasKey(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                expire: Optional[str] = None,
                faas_key_id: Optional[str] = None,
                functions: Optional[Sequence[FaasKeyFunctionArgs]] = None,
                name: Optional[str] = None,
                project_id: Optional[float] = None,
                project_name: Optional[str] = None,
                region_id: Optional[float] = None,
                region_name: Optional[str] = None)
    func NewFaasKey(ctx *Context, name string, args *FaasKeyArgs, opts ...ResourceOption) (*FaasKey, error)
    public FaasKey(string name, FaasKeyArgs? args = null, CustomResourceOptions? opts = null)
    public FaasKey(String name, FaasKeyArgs args)
    public FaasKey(String name, FaasKeyArgs args, CustomResourceOptions options)
    
    type: gcore:FaasKey
    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 FaasKeyArgs
    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 FaasKeyArgs
    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 FaasKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FaasKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FaasKeyArgs
    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 faasKeyResource = new Gcore.FaasKey("faasKeyResource", new()
    {
        Description = "string",
        Expire = "string",
        FaasKeyId = "string",
        Functions = new[]
        {
            new Gcore.Inputs.FaasKeyFunctionArgs
            {
                Name = "string",
                Namespace = "string",
            },
        },
        Name = "string",
        ProjectId = 0,
        ProjectName = "string",
        RegionId = 0,
        RegionName = "string",
    });
    
    example, err := gcore.NewFaasKey(ctx, "faasKeyResource", &gcore.FaasKeyArgs{
    	Description: pulumi.String("string"),
    	Expire:      pulumi.String("string"),
    	FaasKeyId:   pulumi.String("string"),
    	Functions: gcore.FaasKeyFunctionArray{
    		&gcore.FaasKeyFunctionArgs{
    			Name:      pulumi.String("string"),
    			Namespace: pulumi.String("string"),
    		},
    	},
    	Name:        pulumi.String("string"),
    	ProjectId:   pulumi.Float64(0),
    	ProjectName: pulumi.String("string"),
    	RegionId:    pulumi.Float64(0),
    	RegionName:  pulumi.String("string"),
    })
    
    var faasKeyResource = new FaasKey("faasKeyResource", FaasKeyArgs.builder()
        .description("string")
        .expire("string")
        .faasKeyId("string")
        .functions(FaasKeyFunctionArgs.builder()
            .name("string")
            .namespace("string")
            .build())
        .name("string")
        .projectId(0)
        .projectName("string")
        .regionId(0)
        .regionName("string")
        .build());
    
    faas_key_resource = gcore.FaasKey("faasKeyResource",
        description="string",
        expire="string",
        faas_key_id="string",
        functions=[{
            "name": "string",
            "namespace": "string",
        }],
        name="string",
        project_id=0,
        project_name="string",
        region_id=0,
        region_name="string")
    
    const faasKeyResource = new gcore.FaasKey("faasKeyResource", {
        description: "string",
        expire: "string",
        faasKeyId: "string",
        functions: [{
            name: "string",
            namespace: "string",
        }],
        name: "string",
        projectId: 0,
        projectName: "string",
        regionId: 0,
        regionName: "string",
    });
    
    type: gcore:FaasKey
    properties:
        description: string
        expire: string
        faasKeyId: string
        functions:
            - name: string
              namespace: string
        name: string
        projectId: 0
        projectName: string
        regionId: 0
        regionName: string
    

    FaasKey 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 FaasKey resource accepts the following input properties:

    Description string
    Expire string
    FaasKeyId string
    The ID of this resource.
    Functions List<FaasKeyFunction>
    Name string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    Description string
    Expire string
    FaasKeyId string
    The ID of this resource.
    Functions []FaasKeyFunctionArgs
    Name string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    description String
    expire String
    faasKeyId String
    The ID of this resource.
    functions List<FaasKeyFunction>
    name String
    projectId Double
    projectName String
    regionId Double
    regionName String
    description string
    expire string
    faasKeyId string
    The ID of this resource.
    functions FaasKeyFunction[]
    name string
    projectId number
    projectName string
    regionId number
    regionName string
    description String
    expire String
    faasKeyId String
    The ID of this resource.
    functions List<Property Map>
    name String
    projectId Number
    projectName String
    regionId Number
    regionName String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the FaasKey resource produces the following output properties:

    CreatedAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    API key secret
    Status string
    CreatedAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    API key secret
    Status string
    createdAt String
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    API key secret
    status String
    createdAt string
    id string
    The provider-assigned unique ID for this managed resource.
    secret string
    API key secret
    status string
    created_at str
    id str
    The provider-assigned unique ID for this managed resource.
    secret str
    API key secret
    status str
    createdAt String
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    API key secret
    status String

    Look up Existing FaasKey Resource

    Get an existing FaasKey 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?: FaasKeyState, opts?: CustomResourceOptions): FaasKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            expire: Optional[str] = None,
            faas_key_id: Optional[str] = None,
            functions: Optional[Sequence[FaasKeyFunctionArgs]] = None,
            name: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            secret: Optional[str] = None,
            status: Optional[str] = None) -> FaasKey
    func GetFaasKey(ctx *Context, name string, id IDInput, state *FaasKeyState, opts ...ResourceOption) (*FaasKey, error)
    public static FaasKey Get(string name, Input<string> id, FaasKeyState? state, CustomResourceOptions? opts = null)
    public static FaasKey get(String name, Output<String> id, FaasKeyState state, CustomResourceOptions options)
    resources:  _:    type: gcore:FaasKey    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.
    The following state arguments are supported:
    CreatedAt string
    Description string
    Expire string
    FaasKeyId string
    The ID of this resource.
    Functions List<FaasKeyFunction>
    Name string
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    Secret string
    API key secret
    Status string
    CreatedAt string
    Description string
    Expire string
    FaasKeyId string
    The ID of this resource.
    Functions []FaasKeyFunctionArgs
    Name string
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    Secret string
    API key secret
    Status string
    createdAt String
    description String
    expire String
    faasKeyId String
    The ID of this resource.
    functions List<FaasKeyFunction>
    name String
    projectId Double
    projectName String
    regionId Double
    regionName String
    secret String
    API key secret
    status String
    createdAt string
    description string
    expire string
    faasKeyId string
    The ID of this resource.
    functions FaasKeyFunction[]
    name string
    projectId number
    projectName string
    regionId number
    regionName string
    secret string
    API key secret
    status string
    createdAt String
    description String
    expire String
    faasKeyId String
    The ID of this resource.
    functions List<Property Map>
    name String
    projectId Number
    projectName String
    regionId Number
    regionName String
    secret String
    API key secret
    status String

    Supporting Types

    FaasKeyFunction, FaasKeyFunctionArgs

    Name string
    Namespace string
    Name string
    Namespace string
    name String
    namespace String
    name string
    namespace string
    name String
    namespace String

    Import

    import using <project_id>:<region_id>:<key_name> format

    $ pulumi import gcore:index/faasKey:FaasKey test 1:6:test_key
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core