1. Packages
  2. Scaleway
  3. API Docs
  4. IamApiKey
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

scaleway.IamApiKey

Explore with Pulumi AI

scaleway logo
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

    Creates and manages Scaleway API Keys. For more information, refer to the IAM API documentation.

    Example Usage

    With application

    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
    

    With user

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const mainIamUser = new scaleway.IamUser("mainIamUser", {email: "test@test.com"});
    const mainIamApiKey = new scaleway.IamApiKey("mainIamApiKey", {
        userId: mainIamUser.id,
        description: "a description",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main_iam_user = scaleway.IamUser("mainIamUser", email="test@test.com")
    main_iam_api_key = scaleway.IamApiKey("mainIamApiKey",
        user_id=main_iam_user.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 {
    		mainIamUser, err := scaleway.NewIamUser(ctx, "mainIamUser", &scaleway.IamUserArgs{
    			Email: pulumi.String("test@test.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewIamApiKey(ctx, "mainIamApiKey", &scaleway.IamApiKeyArgs{
    			UserId:      mainIamUser.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 mainIamUser = new Scaleway.IamUser("mainIamUser", new()
        {
            Email = "test@test.com",
        });
    
        var mainIamApiKey = new Scaleway.IamApiKey("mainIamApiKey", new()
        {
            UserId = mainIamUser.Id,
            Description = "a description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.IamUser;
    import com.pulumi.scaleway.IamUserArgs;
    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 mainIamUser = new IamUser("mainIamUser", IamUserArgs.builder()
                .email("test@test.com")
                .build());
    
            var mainIamApiKey = new IamApiKey("mainIamApiKey", IamApiKeyArgs.builder()
                .userId(mainIamUser.id())
                .description("a description")
                .build());
    
        }
    }
    
    resources:
      mainIamUser:
        type: scaleway:IamUser
        properties:
          email: test@test.com
      mainIamApiKey:
        type: scaleway:IamApiKey
        properties:
          userId: ${mainIamUser.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.

    Constructor 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.
    DefaultProjectId string
    The default Project ID to use with Object Storage.
    Description string
    The description of the API key.
    ExpiresAt string
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    UserId string

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    ApplicationId string
    ID of the application attached to the API key.
    DefaultProjectId string
    The default Project ID to use with Object Storage.
    Description string
    The description of the API key.
    ExpiresAt string
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    UserId string

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    applicationId String
    ID of the application attached to the API key.
    defaultProjectId String
    The default Project ID to use with Object Storage.
    description String
    The description of the API key.
    expiresAt String
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    userId String

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    applicationId string
    ID of the application attached to the API key.
    defaultProjectId string
    The default Project ID to use with Object Storage.
    description string
    The description of the API key.
    expiresAt string
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    userId string

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    application_id str
    ID of the application attached to the API key.
    default_project_id str
    The default Project ID to use with Object Storage.
    description str
    The description of the API key.
    expires_at str
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    user_id str

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    applicationId String
    ID of the application attached to the API key.
    defaultProjectId String
    The default Project ID to use with Object Storage.
    description String
    The description of the API key.
    expiresAt String
    The date and time of the expiration of the IAM API key. Please note that in case of any changes, the resource will be recreated.
    userId String

    ID of the user attached to the API key.

    Note You must specify at least one: application_id and/or user_id.

    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.
    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 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    AccessKey string
    The access key of the IAM API key.
    ApplicationId string
    ID of the application attached to the 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.
    DefaultProjectId string
    The default Project ID to use with Object Storage.
    Description string
    The description of the 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    accessKey String
    The access key of the IAM API key.
    applicationId String
    ID of the application attached to the 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.
    defaultProjectId String
    The default Project ID to use with Object Storage.
    description String
    The description of the 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    accessKey string
    The access key of the IAM API key.
    applicationId string
    ID of the application attached to the 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.
    defaultProjectId string
    The default Project ID to use with Object Storage.
    description string
    The description of the 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    access_key str
    The access key of the IAM API key.
    application_id str
    ID of the application attached to the 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.
    default_project_id str
    The default Project ID to use with Object Storage.
    description str
    The description of the 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    accessKey String
    The access key of the IAM API key.
    applicationId String
    ID of the application attached to the 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.
    defaultProjectId String
    The default Project ID to use with Object Storage.
    description String
    The description of the 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 any changes, 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.

    Note You must specify at least one: application_id and/or user_id.

    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.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse