1. Packages
  2. Scaleway
  3. API Docs
  4. IamApiKey
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

scaleway.IamApiKey

Explore with Pulumi AI

scaleway logo
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

    Creates and manages Scaleway IAM API Keys. For more information, please check the documentation

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const ciCd = new scaleway.IamApplication("ciCd", {});
    const main = new scaleway.IamApiKey("main", {
        applicationId: scaleway_iam_application.main.id,
        description: "a description",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    ci_cd = scaleway.IamApplication("ciCd")
    main = scaleway.IamApiKey("main",
        application_id=scaleway_iam_application["main"]["id"],
        description="a description")
    
    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 {
    		_, err := scaleway.NewIamApplication(ctx, "ciCd", nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewIamApiKey(ctx, "main", &scaleway.IamApiKeyArgs{
    			ApplicationId: pulumi.Any(scaleway_iam_application.Main.Id),
    			Description:   pulumi.String("a description"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var ciCd = new Scaleway.IamApplication("ciCd");
    
        var main = new Scaleway.IamApiKey("main", new()
        {
            ApplicationId = scaleway_iam_application.Main.Id,
            Description = "a description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.IamApplication;
    import com.pulumi.scaleway.IamApiKey;
    import com.pulumi.scaleway.IamApiKeyArgs;
    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 ciCd = new IamApplication("ciCd");
    
            var main = new IamApiKey("main", IamApiKeyArgs.builder()        
                .applicationId(scaleway_iam_application.main().id())
                .description("a description")
                .build());
    
        }
    }
    
    resources:
      ciCd:
        type: scaleway:IamApplication
      main:
        type: scaleway:IamApiKey
        properties:
          applicationId: ${scaleway_iam_application.main.id}
          description: a description
    

    Create IamApiKey Resource

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

    Constructor syntax

    new IamApiKey(name: string, args?: IamApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def IamApiKey(resource_name: str,
                  args: Optional[IamApiKeyArgs] = None,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamApiKey(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  application_id: Optional[str] = None,
                  default_project_id: Optional[str] = None,
                  description: Optional[str] = None,
                  expires_at: Optional[str] = None,
                  user_id: Optional[str] = None)
    func NewIamApiKey(ctx *Context, name string, args *IamApiKeyArgs, opts ...ResourceOption) (*IamApiKey, error)
    public IamApiKey(string name, IamApiKeyArgs? args = null, CustomResourceOptions? opts = null)
    public IamApiKey(String name, IamApiKeyArgs args)
    public IamApiKey(String name, IamApiKeyArgs args, CustomResourceOptions options)
    
    type: scaleway:IamApiKey
    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 IamApiKeyArgs
    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 IamApiKeyArgs
    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 IamApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamApiKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var iamApiKeyResource = new Scaleway.IamApiKey("iamApiKeyResource", new()
    {
        ApplicationId = "string",
        DefaultProjectId = "string",
        Description = "string",
        ExpiresAt = "string",
        UserId = "string",
    });
    
    example, err := scaleway.NewIamApiKey(ctx, "iamApiKeyResource", &scaleway.IamApiKeyArgs{
    	ApplicationId:    pulumi.String("string"),
    	DefaultProjectId: pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	ExpiresAt:        pulumi.String("string"),
    	UserId:           pulumi.String("string"),
    })
    
    var iamApiKeyResource = new IamApiKey("iamApiKeyResource", IamApiKeyArgs.builder()        
        .applicationId("string")
        .defaultProjectId("string")
        .description("string")
        .expiresAt("string")
        .userId("string")
        .build());
    
    iam_api_key_resource = scaleway.IamApiKey("iamApiKeyResource",
        application_id="string",
        default_project_id="string",
        description="string",
        expires_at="string",
        user_id="string")
    
    const iamApiKeyResource = new scaleway.IamApiKey("iamApiKeyResource", {
        applicationId: "string",
        defaultProjectId: "string",
        description: "string",
        expiresAt: "string",
        userId: "string",
    });
    
    type: scaleway:IamApiKey
    properties:
        applicationId: string
        defaultProjectId: string
        description: string
        expiresAt: string
        userId: string
    

    IamApiKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The IamApiKey resource accepts the following input properties:

    ApplicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    DefaultProjectId string
    The default project ID to use with object storage.
    Description string
    The description of the iam api key.
    ExpiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    UserId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    ApplicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    DefaultProjectId string
    The default project ID to use with object storage.
    Description string
    The description of the iam api key.
    ExpiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    UserId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    applicationId String
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    defaultProjectId String
    The default project ID to use with object storage.
    description String
    The description of the iam api key.
    expiresAt String
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    userId String
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    applicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    defaultProjectId string
    The default project ID to use with object storage.
    description string
    The description of the iam api key.
    expiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    userId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    application_id str
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    default_project_id str
    The default project ID to use with object storage.
    description str
    The description of the iam api key.
    expires_at str
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    user_id str
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    applicationId String
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    defaultProjectId String
    The default project ID to use with object storage.
    description String
    The description of the iam api key.
    expiresAt String
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    userId String
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.

    Outputs

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

    AccessKey string
    The access key of the iam api key.
    CreatedAt string
    The date and time of the creation of the iam api key.
    CreationIp string
    The IP Address of the device which created the API key.
    Editable bool
    Whether the iam api key is editable.
    Id string
    The provider-assigned unique ID for this managed resource.
    SecretKey string
    The secret Key of the iam api key.
    UpdatedAt string
    The date and time of the last update of the iam api key.
    AccessKey string
    The access key of the iam api key.
    CreatedAt string
    The date and time of the creation of the iam api key.
    CreationIp string
    The IP Address of the device which created the API key.
    Editable bool
    Whether the iam api key is editable.
    Id string
    The provider-assigned unique ID for this managed resource.
    SecretKey string
    The secret Key of the iam api key.
    UpdatedAt string
    The date and time of the last update of the iam api key.
    accessKey String
    The access key of the iam api key.
    createdAt String
    The date and time of the creation of the iam api key.
    creationIp String
    The IP Address of the device which created the API key.
    editable Boolean
    Whether the iam api key is editable.
    id String
    The provider-assigned unique ID for this managed resource.
    secretKey String
    The secret Key of the iam api key.
    updatedAt String
    The date and time of the last update of the iam api key.
    accessKey string
    The access key of the iam api key.
    createdAt string
    The date and time of the creation of the iam api key.
    creationIp string
    The IP Address of the device which created the API key.
    editable boolean
    Whether the iam api key is editable.
    id string
    The provider-assigned unique ID for this managed resource.
    secretKey string
    The secret Key of the iam api key.
    updatedAt string
    The date and time of the last update of the iam api key.
    access_key str
    The access key of the iam api key.
    created_at str
    The date and time of the creation of the iam api key.
    creation_ip str
    The IP Address of the device which created the API key.
    editable bool
    Whether the iam api key is editable.
    id str
    The provider-assigned unique ID for this managed resource.
    secret_key str
    The secret Key of the iam api key.
    updated_at str
    The date and time of the last update of the iam api key.
    accessKey String
    The access key of the iam api key.
    createdAt String
    The date and time of the creation of the iam api key.
    creationIp String
    The IP Address of the device which created the API key.
    editable Boolean
    Whether the iam api key is editable.
    id String
    The provider-assigned unique ID for this managed resource.
    secretKey String
    The secret Key of the iam api key.
    updatedAt String
    The date and time of the last update of the iam api key.

    Look up Existing IamApiKey Resource

    Get an existing IamApiKey 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?: IamApiKeyState, opts?: CustomResourceOptions): IamApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_key: Optional[str] = None,
            application_id: Optional[str] = None,
            created_at: Optional[str] = None,
            creation_ip: Optional[str] = None,
            default_project_id: Optional[str] = None,
            description: Optional[str] = None,
            editable: Optional[bool] = None,
            expires_at: Optional[str] = None,
            secret_key: Optional[str] = None,
            updated_at: Optional[str] = None,
            user_id: Optional[str] = None) -> IamApiKey
    func GetIamApiKey(ctx *Context, name string, id IDInput, state *IamApiKeyState, opts ...ResourceOption) (*IamApiKey, error)
    public static IamApiKey Get(string name, Input<string> id, IamApiKeyState? state, CustomResourceOptions? opts = null)
    public static IamApiKey get(String name, Output<String> id, IamApiKeyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AccessKey string
    The access key of the iam api key.
    ApplicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    CreatedAt string
    The date and time of the creation of the iam api key.
    CreationIp string
    The IP Address of the device which created the API key.
    DefaultProjectId string
    The default project ID to use with object storage.
    Description string
    The description of the iam api key.
    Editable bool
    Whether the iam api key is editable.
    ExpiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    SecretKey string
    The secret Key of the iam api key.
    UpdatedAt string
    The date and time of the last update of the iam api key.
    UserId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    AccessKey string
    The access key of the iam api key.
    ApplicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    CreatedAt string
    The date and time of the creation of the iam api key.
    CreationIp string
    The IP Address of the device which created the API key.
    DefaultProjectId string
    The default project ID to use with object storage.
    Description string
    The description of the iam api key.
    Editable bool
    Whether the iam api key is editable.
    ExpiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    SecretKey string
    The secret Key of the iam api key.
    UpdatedAt string
    The date and time of the last update of the iam api key.
    UserId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    accessKey String
    The access key of the iam api key.
    applicationId String
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    createdAt String
    The date and time of the creation of the iam api key.
    creationIp String
    The IP Address of the device which created the API key.
    defaultProjectId String
    The default project ID to use with object storage.
    description String
    The description of the iam api key.
    editable Boolean
    Whether the iam api key is editable.
    expiresAt String
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    secretKey String
    The secret Key of the iam api key.
    updatedAt String
    The date and time of the last update of the iam api key.
    userId String
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    accessKey string
    The access key of the iam api key.
    applicationId string
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    createdAt string
    The date and time of the creation of the iam api key.
    creationIp string
    The IP Address of the device which created the API key.
    defaultProjectId string
    The default project ID to use with object storage.
    description string
    The description of the iam api key.
    editable boolean
    Whether the iam api key is editable.
    expiresAt string
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    secretKey string
    The secret Key of the iam api key.
    updatedAt string
    The date and time of the last update of the iam api key.
    userId string
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    access_key str
    The access key of the iam api key.
    application_id str
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    created_at str
    The date and time of the creation of the iam api key.
    creation_ip str
    The IP Address of the device which created the API key.
    default_project_id str
    The default project ID to use with object storage.
    description str
    The description of the iam api key.
    editable bool
    Whether the iam api key is editable.
    expires_at str
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    secret_key str
    The secret Key of the iam api key.
    updated_at str
    The date and time of the last update of the iam api key.
    user_id str
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.
    accessKey String
    The access key of the iam api key.
    applicationId String
    ID of the application attached to the api key. Only one of the application_id and user_id should be specified.
    createdAt String
    The date and time of the creation of the iam api key.
    creationIp String
    The IP Address of the device which created the API key.
    defaultProjectId String
    The default project ID to use with object storage.
    description String
    The description of the iam api key.
    editable Boolean
    Whether the iam api key is editable.
    expiresAt String
    The date and time of the expiration of the iam api key. Please note that in case of change, the resource will be recreated.
    secretKey String
    The secret Key of the iam api key.
    updatedAt String
    The date and time of the last update of the iam api key.
    userId String
    ID of the user attached to the api key. Only one of the application_id and user_id should be specified.

    Import

    Api keys can be imported using the {id}, e.g.

    bash

    $ pulumi import scaleway:index/iamApiKey:IamApiKey main 11111111111111111111
    

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

    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.12.1 published on Monday, Apr 15, 2024 by pulumiverse