1. Packages
  2. Outscale Provider
  3. API Docs
  4. getAccessKeys
outscale 1.0.1 published on Thursday, Mar 13, 2025 by outscale

outscale.getAccessKeys

Explore with Pulumi AI

outscale logo
outscale 1.0.1 published on Thursday, Mar 13, 2025 by outscale

    Provides information about access keys.

    For more information on this resource, see the User Guide.
    For more information on this resource actions, see the API documentation.

    Example Usage

    Get your own access keys (root account or user)

    import * as pulumi from "@pulumi/pulumi";
    import * as outscale from "@pulumi/outscale";
    
    const accessKeys01 = outscale.getAccessKeys({
        filters: [{
            name: "access_key_ids",
            values: [
                "ABCDEFGHIJ0123456789",
                "0123456789ABCDEFGHIJ",
            ],
        }],
    });
    
    import pulumi
    import pulumi_outscale as outscale
    
    access_keys01 = outscale.get_access_keys(filters=[{
        "name": "access_key_ids",
        "values": [
            "ABCDEFGHIJ0123456789",
            "0123456789ABCDEFGHIJ",
        ],
    }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := outscale.GetAccessKeys(ctx, &outscale.GetAccessKeysArgs{
    			Filters: []outscale.GetAccessKeysFilter{
    				{
    					Name: "access_key_ids",
    					Values: []string{
    						"ABCDEFGHIJ0123456789",
    						"0123456789ABCDEFGHIJ",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Outscale = Pulumi.Outscale;
    
    return await Deployment.RunAsync(() => 
    {
        var accessKeys01 = Outscale.GetAccessKeys.Invoke(new()
        {
            Filters = new[]
            {
                new Outscale.Inputs.GetAccessKeysFilterInputArgs
                {
                    Name = "access_key_ids",
                    Values = new[]
                    {
                        "ABCDEFGHIJ0123456789",
                        "0123456789ABCDEFGHIJ",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.outscale.OutscaleFunctions;
    import com.pulumi.outscale.inputs.GetAccessKeysArgs;
    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 accessKeys01 = OutscaleFunctions.getAccessKeys(GetAccessKeysArgs.builder()
                .filters(GetAccessKeysFilterArgs.builder()
                    .name("access_key_ids")
                    .values(                
                        "ABCDEFGHIJ0123456789",
                        "0123456789ABCDEFGHIJ")
                    .build())
                .build());
    
        }
    }
    
    variables:
      accessKeys01:
        fn::invoke:
          function: outscale:getAccessKeys
          arguments:
            filters:
              - name: access_key_ids
                values:
                  - ABCDEFGHIJ0123456789
                  - 0123456789ABCDEFGHIJ
    

    Get the access keys of another user

    import * as pulumi from "@pulumi/pulumi";
    import * as outscale from "@pulumi/outscale";
    
    const accessKeys = outscale.getAccessKeys({
        filters: [
            {
                name: "access_key_ids",
                values: [
                    "XXXXXXXXX",
                    "YYYYYYYYYY",
                ],
            },
            {
                name: "states",
                values: ["ACTIVE"],
            },
        ],
        userName: "user_name",
    });
    
    import pulumi
    import pulumi_outscale as outscale
    
    access_keys = outscale.get_access_keys(filters=[
            {
                "name": "access_key_ids",
                "values": [
                    "XXXXXXXXX",
                    "YYYYYYYYYY",
                ],
            },
            {
                "name": "states",
                "values": ["ACTIVE"],
            },
        ],
        user_name="user_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := outscale.GetAccessKeys(ctx, &outscale.GetAccessKeysArgs{
    			Filters: []outscale.GetAccessKeysFilter{
    				{
    					Name: "access_key_ids",
    					Values: []string{
    						"XXXXXXXXX",
    						"YYYYYYYYYY",
    					},
    				},
    				{
    					Name: "states",
    					Values: []string{
    						"ACTIVE",
    					},
    				},
    			},
    			UserName: pulumi.StringRef("user_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Outscale = Pulumi.Outscale;
    
    return await Deployment.RunAsync(() => 
    {
        var accessKeys = Outscale.GetAccessKeys.Invoke(new()
        {
            Filters = new[]
            {
                new Outscale.Inputs.GetAccessKeysFilterInputArgs
                {
                    Name = "access_key_ids",
                    Values = new[]
                    {
                        "XXXXXXXXX",
                        "YYYYYYYYYY",
                    },
                },
                new Outscale.Inputs.GetAccessKeysFilterInputArgs
                {
                    Name = "states",
                    Values = new[]
                    {
                        "ACTIVE",
                    },
                },
            },
            UserName = "user_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.outscale.OutscaleFunctions;
    import com.pulumi.outscale.inputs.GetAccessKeysArgs;
    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 accessKeys = OutscaleFunctions.getAccessKeys(GetAccessKeysArgs.builder()
                .filters(            
                    GetAccessKeysFilterArgs.builder()
                        .name("access_key_ids")
                        .values(                    
                            "XXXXXXXXX",
                            "YYYYYYYYYY")
                        .build(),
                    GetAccessKeysFilterArgs.builder()
                        .name("states")
                        .values("ACTIVE")
                        .build())
                .userName("user_name")
                .build());
    
        }
    }
    
    variables:
      accessKeys:
        fn::invoke:
          function: outscale:getAccessKeys
          arguments:
            filters:
              - name: access_key_ids
                values:
                  - XXXXXXXXX
                  - YYYYYYYYYY
              - name: states
                values:
                  - ACTIVE
            userName: user_name
    

    Using getAccessKeys

    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 getAccessKeys(args: GetAccessKeysArgs, opts?: InvokeOptions): Promise<GetAccessKeysResult>
    function getAccessKeysOutput(args: GetAccessKeysOutputArgs, opts?: InvokeOptions): Output<GetAccessKeysResult>
    def get_access_keys(access_key_ids: Optional[Sequence[str]] = None,
                        filters: Optional[Sequence[GetAccessKeysFilter]] = None,
                        id: Optional[str] = None,
                        states: Optional[Sequence[str]] = None,
                        user_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetAccessKeysResult
    def get_access_keys_output(access_key_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetAccessKeysFilterArgs]]]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        states: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        user_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetAccessKeysResult]
    func GetAccessKeys(ctx *Context, args *GetAccessKeysArgs, opts ...InvokeOption) (*GetAccessKeysResult, error)
    func GetAccessKeysOutput(ctx *Context, args *GetAccessKeysOutputArgs, opts ...InvokeOption) GetAccessKeysResultOutput

    > Note: This function is named GetAccessKeys in the Go SDK.

    public static class GetAccessKeys 
    {
        public static Task<GetAccessKeysResult> InvokeAsync(GetAccessKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessKeysResult> Invoke(GetAccessKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessKeysResult> getAccessKeys(GetAccessKeysArgs args, InvokeOptions options)
    public static Output<GetAccessKeysResult> getAccessKeys(GetAccessKeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: outscale:index/getAccessKeys:getAccessKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccessKeyIds List<string>
    Filters List<GetAccessKeysFilter>
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    Id string
    States List<string>
    UserName string
    The name of the EIM user. By default, the user who sends the request (which can be the root account).
    AccessKeyIds []string
    Filters []GetAccessKeysFilter
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    Id string
    States []string
    UserName string
    The name of the EIM user. By default, the user who sends the request (which can be the root account).
    accessKeyIds List<String>
    filters List<GetAccessKeysFilter>
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    id String
    states List<String>
    userName String
    The name of the EIM user. By default, the user who sends the request (which can be the root account).
    accessKeyIds string[]
    filters GetAccessKeysFilter[]
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    id string
    states string[]
    userName string
    The name of the EIM user. By default, the user who sends the request (which can be the root account).
    access_key_ids Sequence[str]
    filters Sequence[GetAccessKeysFilter]
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    id str
    states Sequence[str]
    user_name str
    The name of the EIM user. By default, the user who sends the request (which can be the root account).
    accessKeyIds List<String>
    filters List<Property Map>
    A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
    id String
    states List<String>
    userName String
    The name of the EIM user. By default, the user who sends the request (which can be the root account).

    getAccessKeys Result

    The following output properties are available:

    accessKeys List<Property Map>
    A list of access keys.
    id String
    requestId String
    accessKeyIds List<String>
    filters List<Property Map>
    states List<String>
    userName String

    Supporting Types

    GetAccessKeysAccessKey

    AccessKeyId string
    The ID of the access key.
    CreationDate string
    The date and time (UTC) at which the access key was created.
    ExpirationDate string
    The date and time (UTC) at which the access key expires.
    LastModificationDate string
    The date and time (UTC) at which the access key was last modified.
    State string
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).
    AccessKeyId string
    The ID of the access key.
    CreationDate string
    The date and time (UTC) at which the access key was created.
    ExpirationDate string
    The date and time (UTC) at which the access key expires.
    LastModificationDate string
    The date and time (UTC) at which the access key was last modified.
    State string
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).
    accessKeyId String
    The ID of the access key.
    creationDate String
    The date and time (UTC) at which the access key was created.
    expirationDate String
    The date and time (UTC) at which the access key expires.
    lastModificationDate String
    The date and time (UTC) at which the access key was last modified.
    state String
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).
    accessKeyId string
    The ID of the access key.
    creationDate string
    The date and time (UTC) at which the access key was created.
    expirationDate string
    The date and time (UTC) at which the access key expires.
    lastModificationDate string
    The date and time (UTC) at which the access key was last modified.
    state string
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).
    access_key_id str
    The ID of the access key.
    creation_date str
    The date and time (UTC) at which the access key was created.
    expiration_date str
    The date and time (UTC) at which the access key expires.
    last_modification_date str
    The date and time (UTC) at which the access key was last modified.
    state str
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).
    accessKeyId String
    The ID of the access key.
    creationDate String
    The date and time (UTC) at which the access key was created.
    expirationDate String
    The date and time (UTC) at which the access key expires.
    lastModificationDate String
    The date and time (UTC) at which the access key was last modified.
    state String
    The state of the access key (ACTIVE if the key is valid for API calls, or INACTIVE if not).

    GetAccessKeysFilter

    Name string
    Values List<string>
    Name string
    Values []string
    name String
    values List<String>
    name string
    values string[]
    name str
    values Sequence[str]
    name String
    values List<String>

    Package Details

    Repository
    outscale outscale/terraform-provider-outscale
    License
    Notes
    This Pulumi package is based on the outscale Terraform Provider.
    outscale logo
    outscale 1.0.1 published on Thursday, Mar 13, 2025 by outscale