github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/eks/getAccessEntry.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package eks
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Access Entry Configurations for an EKS Cluster.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := eks.LookupAccessEntry(ctx, &eks.LookupAccessEntryArgs{
    32  //				ClusterName:  exampleAwsEksCluster.Name,
    33  //				PrincipalArn: exampleAwsIamRole.Arn,
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			ctx.Export("eksAccessEntryOutputs", exampleAwsEksAccessEntry)
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupAccessEntry(ctx *pulumi.Context, args *LookupAccessEntryArgs, opts ...pulumi.InvokeOption) (*LookupAccessEntryResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupAccessEntryResult
    48  	err := ctx.Invoke("aws:eks/getAccessEntry:getAccessEntry", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getAccessEntry.
    56  type LookupAccessEntryArgs struct {
    57  	// Name of the EKS Cluster.
    58  	ClusterName string `pulumi:"clusterName"`
    59  	// The IAM Principal ARN which requires Authentication access to the EKS cluster.
    60  	PrincipalArn string            `pulumi:"principalArn"`
    61  	Tags         map[string]string `pulumi:"tags"`
    62  }
    63  
    64  // A collection of values returned by getAccessEntry.
    65  type LookupAccessEntryResult struct {
    66  	// Amazon Resource Name (ARN) of the Access Entry.
    67  	AccessEntryArn string `pulumi:"accessEntryArn"`
    68  	ClusterName    string `pulumi:"clusterName"`
    69  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created.
    70  	CreatedAt string `pulumi:"createdAt"`
    71  	// The provider-assigned unique ID for this managed resource.
    72  	Id string `pulumi:"id"`
    73  	// List of string which can optionally specify the Kubernetes groups the user would belong to when creating an access entry.
    74  	KubernetesGroups []string `pulumi:"kubernetesGroups"`
    75  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated.
    76  	ModifiedAt   string            `pulumi:"modifiedAt"`
    77  	PrincipalArn string            `pulumi:"principalArn"`
    78  	Tags         map[string]string `pulumi:"tags"`
    79  	// (Optional) Key-value map of resource tags, including those inherited from the provider `defaultTags` configuration block.
    80  	TagsAll map[string]string `pulumi:"tagsAll"`
    81  	// Defaults to STANDARD which provides the standard workflow. EC2_LINUX, EC2_WINDOWS, FARGATE_LINUX types disallow users to input a username or groups, and prevent associations.
    82  	Type string `pulumi:"type"`
    83  	// Defaults to principal ARN if user is principal else defaults to assume-role/session-name is role is used.
    84  	UserName string `pulumi:"userName"`
    85  }
    86  
    87  func LookupAccessEntryOutput(ctx *pulumi.Context, args LookupAccessEntryOutputArgs, opts ...pulumi.InvokeOption) LookupAccessEntryResultOutput {
    88  	return pulumi.ToOutputWithContext(context.Background(), args).
    89  		ApplyT(func(v interface{}) (LookupAccessEntryResult, error) {
    90  			args := v.(LookupAccessEntryArgs)
    91  			r, err := LookupAccessEntry(ctx, &args, opts...)
    92  			var s LookupAccessEntryResult
    93  			if r != nil {
    94  				s = *r
    95  			}
    96  			return s, err
    97  		}).(LookupAccessEntryResultOutput)
    98  }
    99  
   100  // A collection of arguments for invoking getAccessEntry.
   101  type LookupAccessEntryOutputArgs struct {
   102  	// Name of the EKS Cluster.
   103  	ClusterName pulumi.StringInput `pulumi:"clusterName"`
   104  	// The IAM Principal ARN which requires Authentication access to the EKS cluster.
   105  	PrincipalArn pulumi.StringInput    `pulumi:"principalArn"`
   106  	Tags         pulumi.StringMapInput `pulumi:"tags"`
   107  }
   108  
   109  func (LookupAccessEntryOutputArgs) ElementType() reflect.Type {
   110  	return reflect.TypeOf((*LookupAccessEntryArgs)(nil)).Elem()
   111  }
   112  
   113  // A collection of values returned by getAccessEntry.
   114  type LookupAccessEntryResultOutput struct{ *pulumi.OutputState }
   115  
   116  func (LookupAccessEntryResultOutput) ElementType() reflect.Type {
   117  	return reflect.TypeOf((*LookupAccessEntryResult)(nil)).Elem()
   118  }
   119  
   120  func (o LookupAccessEntryResultOutput) ToLookupAccessEntryResultOutput() LookupAccessEntryResultOutput {
   121  	return o
   122  }
   123  
   124  func (o LookupAccessEntryResultOutput) ToLookupAccessEntryResultOutputWithContext(ctx context.Context) LookupAccessEntryResultOutput {
   125  	return o
   126  }
   127  
   128  // Amazon Resource Name (ARN) of the Access Entry.
   129  func (o LookupAccessEntryResultOutput) AccessEntryArn() pulumi.StringOutput {
   130  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.AccessEntryArn }).(pulumi.StringOutput)
   131  }
   132  
   133  func (o LookupAccessEntryResultOutput) ClusterName() pulumi.StringOutput {
   134  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.ClusterName }).(pulumi.StringOutput)
   135  }
   136  
   137  // Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created.
   138  func (o LookupAccessEntryResultOutput) CreatedAt() pulumi.StringOutput {
   139  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.CreatedAt }).(pulumi.StringOutput)
   140  }
   141  
   142  // The provider-assigned unique ID for this managed resource.
   143  func (o LookupAccessEntryResultOutput) Id() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.Id }).(pulumi.StringOutput)
   145  }
   146  
   147  // List of string which can optionally specify the Kubernetes groups the user would belong to when creating an access entry.
   148  func (o LookupAccessEntryResultOutput) KubernetesGroups() pulumi.StringArrayOutput {
   149  	return o.ApplyT(func(v LookupAccessEntryResult) []string { return v.KubernetesGroups }).(pulumi.StringArrayOutput)
   150  }
   151  
   152  // Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated.
   153  func (o LookupAccessEntryResultOutput) ModifiedAt() pulumi.StringOutput {
   154  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.ModifiedAt }).(pulumi.StringOutput)
   155  }
   156  
   157  func (o LookupAccessEntryResultOutput) PrincipalArn() pulumi.StringOutput {
   158  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.PrincipalArn }).(pulumi.StringOutput)
   159  }
   160  
   161  func (o LookupAccessEntryResultOutput) Tags() pulumi.StringMapOutput {
   162  	return o.ApplyT(func(v LookupAccessEntryResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   163  }
   164  
   165  // (Optional) Key-value map of resource tags, including those inherited from the provider `defaultTags` configuration block.
   166  func (o LookupAccessEntryResultOutput) TagsAll() pulumi.StringMapOutput {
   167  	return o.ApplyT(func(v LookupAccessEntryResult) map[string]string { return v.TagsAll }).(pulumi.StringMapOutput)
   168  }
   169  
   170  // Defaults to STANDARD which provides the standard workflow. EC2_LINUX, EC2_WINDOWS, FARGATE_LINUX types disallow users to input a username or groups, and prevent associations.
   171  func (o LookupAccessEntryResultOutput) Type() pulumi.StringOutput {
   172  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.Type }).(pulumi.StringOutput)
   173  }
   174  
   175  // Defaults to principal ARN if user is principal else defaults to assume-role/session-name is role is used.
   176  func (o LookupAccessEntryResultOutput) UserName() pulumi.StringOutput {
   177  	return o.ApplyT(func(v LookupAccessEntryResult) string { return v.UserName }).(pulumi.StringOutput)
   178  }
   179  
   180  func init() {
   181  	pulumi.RegisterOutputType(LookupAccessEntryResultOutput{})
   182  }