1. Packages
  2. AWS
  3. API Docs
  4. iam
  5. getAccessKeys
AWS v6.57.0 published on Tuesday, Oct 29, 2024 by Pulumi

aws.iam.getAccessKeys

Explore with Pulumi AI

aws logo
AWS v6.57.0 published on Tuesday, Oct 29, 2024 by Pulumi

    This data source can be used to fetch information about IAM access keys of a specific IAM user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.iam.getAccessKeys({
        user: "an_example_user_name",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.iam.get_access_keys(user="an_example_user_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.GetAccessKeys(ctx, &iam.GetAccessKeysArgs{
    			User: "an_example_user_name",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Iam.GetAccessKeys.Invoke(new()
        {
            User = "an_example_user_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.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 example = IamFunctions.getAccessKeys(GetAccessKeysArgs.builder()
                .user("an_example_user_name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:iam:getAccessKeys
          Arguments:
            user: an_example_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(user: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetAccessKeysResult
    def get_access_keys_output(user: 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:iam/getAccessKeys:getAccessKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    User string
    Name of the IAM user associated with the access keys.
    User string
    Name of the IAM user associated with the access keys.
    user String
    Name of the IAM user associated with the access keys.
    user string
    Name of the IAM user associated with the access keys.
    user str
    Name of the IAM user associated with the access keys.
    user String
    Name of the IAM user associated with the access keys.

    getAccessKeys Result

    The following output properties are available:

    AccessKeys List<GetAccessKeysAccessKey>
    List of the IAM access keys associated with the specified user. See below.
    Id string
    The provider-assigned unique ID for this managed resource.
    User string
    AccessKeys []GetAccessKeysAccessKey
    List of the IAM access keys associated with the specified user. See below.
    Id string
    The provider-assigned unique ID for this managed resource.
    User string
    accessKeys List<GetAccessKeysAccessKey>
    List of the IAM access keys associated with the specified user. See below.
    id String
    The provider-assigned unique ID for this managed resource.
    user String
    accessKeys GetAccessKeysAccessKey[]
    List of the IAM access keys associated with the specified user. See below.
    id string
    The provider-assigned unique ID for this managed resource.
    user string
    access_keys Sequence[GetAccessKeysAccessKey]
    List of the IAM access keys associated with the specified user. See below.
    id str
    The provider-assigned unique ID for this managed resource.
    user str
    accessKeys List<Property Map>
    List of the IAM access keys associated with the specified user. See below.
    id String
    The provider-assigned unique ID for this managed resource.
    user String

    Supporting Types

    GetAccessKeysAccessKey

    AccessKeyId string
    Access key ID.
    CreateDate string
    Date and time in RFC3339 format that the access key was created.
    Status string
    Access key status. Possible values are Active and Inactive.
    AccessKeyId string
    Access key ID.
    CreateDate string
    Date and time in RFC3339 format that the access key was created.
    Status string
    Access key status. Possible values are Active and Inactive.
    accessKeyId String
    Access key ID.
    createDate String
    Date and time in RFC3339 format that the access key was created.
    status String
    Access key status. Possible values are Active and Inactive.
    accessKeyId string
    Access key ID.
    createDate string
    Date and time in RFC3339 format that the access key was created.
    status string
    Access key status. Possible values are Active and Inactive.
    access_key_id str
    Access key ID.
    create_date str
    Date and time in RFC3339 format that the access key was created.
    status str
    Access key status. Possible values are Active and Inactive.
    accessKeyId String
    Access key ID.
    createDate String
    Date and time in RFC3339 format that the access key was created.
    status String
    Access key status. Possible values are Active and Inactive.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.57.0 published on Tuesday, Oct 29, 2024 by Pulumi