outscale 1.0.1 published on Thursday, Mar 13, 2025 by outscale
outscale.getAccessKeys
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- AccessKey List<string>Ids 
- Filters
List<GetAccess Keys Filter> 
- 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).
- AccessKey []stringIds 
- Filters
[]GetAccess Keys Filter 
- 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).
- accessKey List<String>Ids 
- filters
List<GetAccess Keys Filter> 
- 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).
- accessKey string[]Ids 
- filters
GetAccess Keys Filter[] 
- 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_ Sequence[str]ids 
- filters
Sequence[GetAccess Keys Filter] 
- 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).
- accessKey List<String>Ids 
- 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<GetAccess Keys Access Key> 
- A list of access keys.
- Id string
- RequestId string
- AccessKey List<string>Ids 
- Filters
List<GetAccess Keys Filter> 
- States List<string>
- UserName string
- AccessKeys []GetAccess Keys Access Key 
- A list of access keys.
- Id string
- RequestId string
- AccessKey []stringIds 
- Filters
[]GetAccess Keys Filter 
- States []string
- UserName string
- accessKeys List<GetAccess Keys Access Key> 
- A list of access keys.
- id String
- requestId String
- accessKey List<String>Ids 
- filters
List<GetAccess Keys Filter> 
- states List<String>
- userName String
- accessKeys GetAccess Keys Access Key[] 
- A list of access keys.
- id string
- requestId string
- accessKey string[]Ids 
- filters
GetAccess Keys Filter[] 
- states string[]
- userName string
- access_keys Sequence[GetAccess Keys Access Key] 
- A list of access keys.
- id str
- request_id str
- access_key_ Sequence[str]ids 
- filters
Sequence[GetAccess Keys Filter] 
- states Sequence[str]
- user_name str
- accessKeys List<Property Map>
- A list of access keys.
- id String
- requestId String
- accessKey List<String>Ids 
- filters List<Property Map>
- states List<String>
- userName String
Supporting Types
GetAccessKeysAccessKey    
- AccessKey stringId 
- 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.
- LastModification stringDate 
- The date and time (UTC) at which the access key was last modified.
- State string
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
- AccessKey stringId 
- 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.
- LastModification stringDate 
- The date and time (UTC) at which the access key was last modified.
- State string
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
- accessKey StringId 
- 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.
- lastModification StringDate 
- The date and time (UTC) at which the access key was last modified.
- state String
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
- accessKey stringId 
- 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.
- lastModification stringDate 
- The date and time (UTC) at which the access key was last modified.
- state string
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
- access_key_ strid 
- 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_ strdate 
- The date and time (UTC) at which the access key was last modified.
- state str
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
- accessKey StringId 
- 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.
- lastModification StringDate 
- The date and time (UTC) at which the access key was last modified.
- state String
- The state of the access key (ACTIVEif the key is valid for API calls, orINACTIVEif not).
GetAccessKeysFilter   
Package Details
- Repository
- outscale outscale/terraform-provider-outscale
- License
- Notes
- This Pulumi package is based on the outscaleTerraform Provider.