1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. eks
  6. getAccessPolicies
Viewing docs for AWS v7.40.0
published on Thursday, Jul 30, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.40.0
published on Thursday, Jul 30, 2026 by Pulumi

    Data source for managing AWS EKS (Elastic Kubernetes) Access Policies.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.eks.getAccessPolicies({});
    export const eksAccessPolicies = example.then(example => example.accessPolicies);
    export const eksNetworkingPolicy = example.then(example => .filter(ap => ap.name == "AmazonEKSNetworkingPolicy").map(ap => (ap)));
    export const eksAccessPolicyNames = example.then(example => .map(ap => (ap.name)));
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.eks.get_access_policies()
    pulumi.export("eksAccessPolicies", example.access_policies)
    pulumi.export("eksNetworkingPolicy", [ap for ap in example.access_policies if ap.name == "AmazonEKSNetworkingPolicy"])
    pulumi.export("eksAccessPolicyNames", [ap.name for ap in example.access_policies])
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Eks.GetAccessPolicies.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["eksAccessPolicies"] = example.Apply(getAccessPoliciesResult => getAccessPoliciesResult.AccessPolicies),
            ["eksNetworkingPolicy"] = .Where(ap => ap.Name == "AmazonEKSNetworkingPolicy").Select(ap => 
            {
                return ap;
            }).ToList(),
            ["eksAccessPolicyNames"] = .Select(ap => 
            {
                return ap.Name;
            }).ToList(),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    data "aws_eks_getaccesspolicies" "example" {
    }
    
    output "eksAccessPolicies" {
      value = data.aws_eks_getaccesspolicies.example.access_policies
    }
    output "eksNetworkingPolicy" {
      value = [for ap in data.aws_eks_getaccesspolicies.example.access_policies : ap if ap.name == "AmazonEKSNetworkingPolicy"]
    }
    output "eksAccessPolicyNames" {
      value = [for ap in data.aws_eks_getaccesspolicies.example.access_policies : ap.name]
    }
    

    Using getAccessPolicies

    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 getAccessPolicies(args: GetAccessPoliciesArgs, opts?: InvokeOptions): Promise<GetAccessPoliciesResult>
    function getAccessPoliciesOutput(args: GetAccessPoliciesOutputArgs, opts?: InvokeOptions): Output<GetAccessPoliciesResult>
    def get_access_policies(region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAccessPoliciesResult
    def get_access_policies_output(region: pulumi.Input[Optional[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetAccessPoliciesResult]
    func GetAccessPolicies(ctx *Context, args *GetAccessPoliciesArgs, opts ...InvokeOption) (*GetAccessPoliciesResult, error)
    func GetAccessPoliciesOutput(ctx *Context, args *GetAccessPoliciesOutputArgs, opts ...InvokeOption) GetAccessPoliciesResultOutput

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

    public static class GetAccessPolicies 
    {
        public static Task<GetAccessPoliciesResult> InvokeAsync(GetAccessPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessPoliciesResult> Invoke(GetAccessPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessPoliciesResult> getAccessPolicies(GetAccessPoliciesArgs args, InvokeOptions options)
    public static Output<GetAccessPoliciesResult> getAccessPolicies(GetAccessPoliciesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:eks/getAccessPolicies:getAccessPolicies
      arguments:
        # arguments dictionary
    data "aws_eks_get_access_policies" "name" {
        # arguments
    }

    The following arguments are supported:

    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    getAccessPolicies Result

    The following output properties are available:

    AccessPolicies List<GetAccessPoliciesAccessPolicy>
    List of available access policies.
    Region string
    AccessPolicies []GetAccessPoliciesAccessPolicy
    List of available access policies.
    Region string
    access_policies list(object)
    List of available access policies.
    region string
    accessPolicies List<GetAccessPoliciesAccessPolicy>
    List of available access policies.
    region String
    accessPolicies GetAccessPoliciesAccessPolicy[]
    List of available access policies.
    region string
    accessPolicies List<Property Map>
    List of available access policies.
    region String

    Supporting Types

    GetAccessPoliciesAccessPolicy

    Arn string
    ARN of the access policy.
    Name string
    Name of the access policy.
    Arn string
    ARN of the access policy.
    Name string
    Name of the access policy.
    arn string
    ARN of the access policy.
    name string
    Name of the access policy.
    arn String
    ARN of the access policy.
    name String
    Name of the access policy.
    arn string
    ARN of the access policy.
    name string
    Name of the access policy.
    arn str
    ARN of the access policy.
    name str
    Name of the access policy.
    arn String
    ARN of the access policy.
    name String
    Name of the access policy.

    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
    Viewing docs for AWS v7.40.0
    published on Thursday, Jul 30, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial